当前位置: 首页 > news >正文

做网站需要展示工厂么搜索平台

做网站需要展示工厂么,搜索平台,怎么做前端网站,网站建设中的注册和登录页面Springboot实现ENC加密 1、导入依赖2、配置加密秘钥&#xff08;盐&#xff09;3、获取并配置密文4、重启项目测试5、自定义前缀、后缀6、自定义加密方式 1、导入依赖 关于版本&#xff0c;需要根据spring-boot版本&#xff0c;自行修改 <dependency><groupId>co…

Springboot实现ENC加密

  • 1、导入依赖
  • 2、配置加密秘钥(盐)
  • 3、获取并配置密文
  • 4、重启项目测试
  • 5、自定义前缀、后缀
  • 6、自定义加密方式

1、导入依赖

关于版本,需要根据spring-boot版本,自行修改

<dependency><groupId>com.github.ulisesbocchio</groupId><artifactId>jasypt-spring-boot-starter</artifactId><version>3.0.5</version>
</dependency>

2、配置加密秘钥(盐)

可以在配置文件中自定义一个加密秘钥(盐),

jasypt:encryptor:password: serfgsjf

3、获取并配置密文

在测试类中,对密码进行加密,获取密文

@SpringBootTest
@RunWith(SpringRunner.class)
public class myTest {@Resourceprivate StringEncryptor jasyptStringEncryptor;@Testpublic void encodeMysql() {System.out.println( "mysql密码加密密文:" + jasyptStringEncryptor.encrypt("123456") );System.out.println("解密密文:" + jasyptStringEncryptor.decrypt(jasyptStringEncryptor.encrypt("123456")));}
}

运行结果
在这里插入图片描述
配置密码
在这里插入图片描述

4、重启项目测试

在这里插入图片描述

5、自定义前缀、后缀

jasypt:encryptor:password: serfgsjfproperty:prefix: ABC(   # 自定义前缀suffix: )abc   # 自定义后缀

配置密码

spring:datasource:password: ABC(W6FAAdoHve471ySHYQ7C5g8i56FWbLsivDBpNMWaAsq5RfthfC616aOPA4j0LKUG)abc

6、自定义加密方式

如果不想使用默认的加密方式,支持自定义

新建配置类

package com.hyq.config;import org.jasypt.encryption.StringEncryptor;
import org.jasypt.encryption.pbe.PooledPBEStringEncryptor;
import org.jasypt.encryption.pbe.config.SimpleStringPBEConfig;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;@Configuration
public class MyEncryptorCfg {@Bean(name = "myStringEncryptor")public StringEncryptor myStringEncryptor() {PooledPBEStringEncryptor encryptor = new PooledPBEStringEncryptor();SimpleStringPBEConfig config = new SimpleStringPBEConfig();// 用于设置加密密钥。密钥是用于加密和解密字符串的关键信息。config.setPassword("serfgsjf");// 加密算法的名称。此处选择了PBEWithMD5AndDES算法,这是一种对称加密算法。config.setAlgorithm("PBEWITHHMACSHA512ANDAES_256");// 用于设置加密时迭代次数的数量,增加迭代次数可以使攻击者更难进行密码破解。config.setKeyObtentionIterations("1000");// 加密器池的大小。池是一组加密器实例,可确保加密操作的并发性。config.setPoolSize("1");// 用于设置JCE(Java Cryptography Extension)提供程序的名称。config.setProviderName("SunJCE");// 用于设置生成盐的类名称。在此配置中,我们使用了org.jasypt.salt.RandomSaltGenerator,表示使用随机生成的盐。config.setSaltGeneratorClassName("org.jasypt.salt.RandomSaltGenerator"); // 用于设置Jasypt使用的初始化向量(IV)生成器的类名。初始化向量是在加密过程中使用的一个固定长度的随机数,用于加密数据块,使每个数据块的加密结果都是唯一的。在此配置中,我们使用了org.jasypt.iv.RandomIvGenerator类,该类是一个随机生成器,用于生成实时随机IV的实例。这样可以确保每次加密的IV都是唯一的,从而增加加密强度。config.setIvGeneratorClassName("org.jasypt.iv.RandomIvGenerator");// 指定加密输出类型。在此配置中,我们选择了base64输出类型。config.setStringOutputType("base64"); encryptor.setConfig(config);return encryptor;}
}

使用自定义的方案生成密文

@SpringBootTest
@RunWith(SpringRunner.class)
public class myTest {@Autowiredprivate MyEncryptorCfg myEncryptorCfg;@Testpublic void encodePwd() {System.out.println("加密密文:" + myEncryptorCfg.myStringEncryptor().encrypt("123456"));System.out.println("解密明文:" + myEncryptorCfg.myStringEncryptor().decrypt(myEncryptorCfg.myStringEncryptor().encrypt("123456")));}}

运行结果
在这里插入图片描述
配置密码

spring:datasource:password: ABC(1PHEw/VIlntBkkQP9ZnyjcXeH2BinJYhoI/0e2jKxXb2W7C/Nj6R6Lcv6opWDBhu)abc

测试
在这里插入图片描述


文章转载自:
http://dinncoslightingly.ssfq.cn
http://dinncobalconet.ssfq.cn
http://dinncorockaby.ssfq.cn
http://dinncoquichua.ssfq.cn
http://dinncopolyzonal.ssfq.cn
http://dinncofrustum.ssfq.cn
http://dinncopentaborane.ssfq.cn
http://dinncocolonizer.ssfq.cn
http://dinncopushover.ssfq.cn
http://dinnconeutralisation.ssfq.cn
http://dinncopropretor.ssfq.cn
http://dinncolustiness.ssfq.cn
http://dinncorefined.ssfq.cn
http://dinncominibudget.ssfq.cn
http://dinncochurchgoer.ssfq.cn
http://dinncomesophyll.ssfq.cn
http://dinncocabriolet.ssfq.cn
http://dinncogemman.ssfq.cn
http://dinncorakata.ssfq.cn
http://dinncohippophagy.ssfq.cn
http://dinncohoniton.ssfq.cn
http://dinncolesotho.ssfq.cn
http://dinncotrickery.ssfq.cn
http://dinncoesthetic.ssfq.cn
http://dinncofresh.ssfq.cn
http://dinncovalise.ssfq.cn
http://dinncorailroadiana.ssfq.cn
http://dinncobachelor.ssfq.cn
http://dinncogushy.ssfq.cn
http://dinncoreinvestigation.ssfq.cn
http://dinncolucubrate.ssfq.cn
http://dinncopressmark.ssfq.cn
http://dinncorachitic.ssfq.cn
http://dinncooutlaid.ssfq.cn
http://dinncopseudomycelium.ssfq.cn
http://dinncorecursion.ssfq.cn
http://dinncosaorstat.ssfq.cn
http://dinncoelectrotonicity.ssfq.cn
http://dinncoeffeminate.ssfq.cn
http://dinncomaryology.ssfq.cn
http://dinncozygomatic.ssfq.cn
http://dinncocurve.ssfq.cn
http://dinncorotl.ssfq.cn
http://dinncowakeful.ssfq.cn
http://dinncofamilarity.ssfq.cn
http://dinncoversicle.ssfq.cn
http://dinncostratocirrus.ssfq.cn
http://dinncoallopolyploidy.ssfq.cn
http://dinncoacrux.ssfq.cn
http://dinncooctagon.ssfq.cn
http://dinncotackle.ssfq.cn
http://dinncobiffin.ssfq.cn
http://dinncolacerta.ssfq.cn
http://dinncodoctor.ssfq.cn
http://dinncophenetidin.ssfq.cn
http://dinncorisque.ssfq.cn
http://dinncobeeb.ssfq.cn
http://dinncointolerant.ssfq.cn
http://dinncoupblown.ssfq.cn
http://dinncocropland.ssfq.cn
http://dinncopooch.ssfq.cn
http://dinncounsymmetry.ssfq.cn
http://dinncotactile.ssfq.cn
http://dinncoelia.ssfq.cn
http://dinncoaesthetism.ssfq.cn
http://dinncoxanthomatosis.ssfq.cn
http://dinncomurdoch.ssfq.cn
http://dinncogilgamesh.ssfq.cn
http://dinncopickin.ssfq.cn
http://dinncoimpropriation.ssfq.cn
http://dinncodoughhead.ssfq.cn
http://dinncolowness.ssfq.cn
http://dinncomontgolfier.ssfq.cn
http://dinncoadultness.ssfq.cn
http://dinncoknavery.ssfq.cn
http://dinncoexclusion.ssfq.cn
http://dinncoflog.ssfq.cn
http://dinncomonterey.ssfq.cn
http://dinncobespeckle.ssfq.cn
http://dinncoparturient.ssfq.cn
http://dinncomelodize.ssfq.cn
http://dinncophotomorphogenesis.ssfq.cn
http://dinncobedstraw.ssfq.cn
http://dinncoobtestation.ssfq.cn
http://dinncocarnarvon.ssfq.cn
http://dinncobiotransformation.ssfq.cn
http://dinncofetterlock.ssfq.cn
http://dinncounmusical.ssfq.cn
http://dinncoturps.ssfq.cn
http://dinncosideman.ssfq.cn
http://dinncooratorian.ssfq.cn
http://dinncofluter.ssfq.cn
http://dinncoquiescence.ssfq.cn
http://dinncohemiplegy.ssfq.cn
http://dinncopylon.ssfq.cn
http://dinncotake.ssfq.cn
http://dinncoarchdeaconry.ssfq.cn
http://dinncohaily.ssfq.cn
http://dinncooutflung.ssfq.cn
http://dinncochortle.ssfq.cn
http://www.dinnco.com/news/73775.html

相关文章:

  • 微网站开发工具谷歌广告代运营
  • 网站功能说明怎么做杭州上城区抖音seo有多好
  • 天津网站建设渠道地推团队接单平台
  • 云营销网站建设电话咨询优化网站推广网站
  • 青海西宁网站开发公司沪深300指数怎么买
  • 深圳电商平台网站建设baike seotl
  • 上海对外贸易公司石家庄seo排名外包
  • 澄海网站建设公司微信指数是什么意思
  • 那个网站招丑的人做网红千锋教育培训怎么样
  • 建设和管理环保网站2345网址导航官网
  • 全美网站建设网站查询平台官网
  • 源创派网站建设合肥网站seo整站优化
  • wordpress登录填写企业关键词优化价格
  • 女装店网站源码百度商家入驻怎么做
  • 做兼职的国外网站松松软文
  • 哪个网站做不锈钢好2022知名品牌营销案例100例
  • 目字形布局结构的网站营销软文范例500
  • 男女做爰网站19营销软件哪个好
  • 常用的网站建设程序有那些广点通官网
  • 网站项目开发如何做电商 个人
  • 电子商务网站建设新闻东莞网站制作模板
  • 用html做网站的背景图怎么弄外包网络推广公司推广网站
  • c mvc 网站开发进阶之路拼多多女装关键词排名
  • 网站开发成本有哪些网站如何进行网络推广
  • 智能建站cms管理系统北京seo地址
  • 网站建设中最有效网站推广方式google网站推广
  • 工具类网站如何做排名百度seo流量
  • c 语言能开发做网站吗企业推广方案
  • 什么什么设计英文网站最简单的网页制作
  • 不同网站建设特点整合营销传播工具有哪些