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

无锡网站设计制作域名注册的网站有哪些

无锡网站设计制作,域名注册的网站有哪些,怎样做网站性能优化,深圳百度贴吧springboot使用jasypt对配置文件加密 springboot配置通过明文获取加密的值通过密文和盐值解密得到明文代码封装工具类 dependencygroupIdcom.github.ulisesbocchio/groupIdartifactIdjasypt-spring-boot-starter/artifactIdversio… springboot使用jasypt对配置文件加密 springboot配置通过明文获取加密的值通过密文和盐值解密得到明文代码封装工具类 dependencygroupIdcom.github.ulisesbocchio/groupIdartifactIdjasypt-spring-boot-starter/artifactIdversion1.14/version /dependencyspringboot配置 jasypt:encryptor:password: saltValue #salt值密文加盐 spring:datasource: # 数据库链接db1:jdbc-url: jdbc:mysql://x.x.x.x:3306/db_test?useUnicodetruecharacterEncodingutf8useSSLfalseallowPublicKeyRetrievaltrueserverTimezoneGMT%2B8username: root #也可以加密用户名,依然是ENC()格式这里没有进行加密password: ENC(OVL1V3KDtTa8w9IIOVuSdeyCOsZXAN0) #加密了密码ENC()括号内为密文driver-class-name: com.mysql.cj.jdbc.Drivermapper-locations: classpath*:mapper/otcmapper/*.xml 启动类添加注解EnableEncryptableProperties SpringBootApplication(exclude DataSourceAutoConfiguration.class) EnableEncryptableProperties EnableScheduling //EnableAsync public class SpBatchApplication {public static void main(String[] args) {SpringApplication.run(SpBatchApplication.class, args);} }通过明文获取加密的值 cmd在自己的maven仓库目录下执行命令要保证依赖下载下来了 解释 input文字的明文 password加密的盐值可随意必须jasypt:encryptor:password: saltValue algorithmPBEWithMD5AndDES默认算法 java -cp org/jasypt/jasypt/1.9.2/jasypt-1.9.2.jar org.jasypt.intf.cli.JasyptPBEStringEncryptionCLI input密码明文 passwordsaltValue algorithmPBEWithMD5AndDES执行后输出结果OUTPUT就是密文了把密文替换yml的属性值就行 ENC(OVL1V3KDtTa8w9IIOVuSdeyCOsZXAN0) ----ARGUMENTS-------------------algorithm: PBEWithMD5AndDES input: 密码明文 password: saltValue----OUTPUT----------------------OVL1V3KDtTa8w9IIOVuSdeyCOsZXAN0 启动springboot就会自动解密了 通过密文和盐值解密得到明文 java -cp jasypt-1.9.2.jar org.jasypt.intf.cli.JasyptPBEStringDecryptionCLI input加密后的密文 passwordsaltValue algorithmPBEWithMD5AndDES代码封装工具类 public class JasyptUtil {private static final String PBEWITHMD5ANDDES PBEWithMD5AndDES;private static final String PBEWITHHMACSHA512ANDAES_256 PBEWITHHMACSHA512ANDAES_256;/*** * param text 待加密原文* param crack 盐值密钥* return 加密后的字符串* Description: Jasypt加密PBEWithMD5AndDES*/public static String encryptWithMD5(String text, String crack) { //1.创建加解密工具实例StandardPBEStringEncryptor encryptor new StandardPBEStringEncryptor(); //2.加解密配置EnvironmentStringPBEConfig config new EnvironmentStringPBEConfig();config.setAlgorithm(PBEWITHMD5ANDDES);config.setPassword(crack);encryptor.setConfig(config); //3.加密return encryptor.encrypt(text);}/*** * param text 待解密原文* param crack 盐值密钥* return 解密后的字符串* Description: Jasypt解密PBEWithMD5AndDES*/public static String decryptWithMD5(String text, String crack) { //1.创建加解密工具实例StandardPBEStringEncryptor encryptor new StandardPBEStringEncryptor(); //2.加解密配置EnvironmentStringPBEConfig config new EnvironmentStringPBEConfig();config.setAlgorithm(PBEWITHMD5ANDDES);config.setPassword(crack);encryptor.setConfig(config); //解密return encryptor.decrypt(text);}/*** * param text 待加密的原文* param crack 盐值密钥* return 加密后的字符串* Description: jasypt 加密PBEWITHHMACSHA512ANDAES_256*/public static String encryptWithSHA512(String text, String crack) { //1.创建加解密工具实例PooledPBEStringEncryptor encryptor new PooledPBEStringEncryptor(); //2.加解密配置SimpleStringPBEConfig config new SimpleStringPBEConfig();config.setPassword(crack);config.setAlgorithm(PBEWITHHMACSHA512ANDAES_256); // 为减少配置文件的书写以下都是 Jasypt 3.x 版本配置文件默认配置config.setKeyObtentionIterations(1000);config.setPoolSize(1);config.setProviderName(SunJCE);config.setSaltGeneratorClassName(org.jasypt.salt.RandomSaltGenerator);config.setIvGeneratorClassName(org.jasypt.iv.RandomIvGenerator);config.setStringOutputType(base64);encryptor.setConfig(config); //3.加密return encryptor.encrypt(text);}/*** * param text 待解密原文* param crack 盐值密钥* return 解密后的字符串* Description: jasypt 解密PBEWITHHMACSHA512ANDAES_256*/public static String decryptWithSHA512(String text, String crack) { //1.创建加解密工具实例PooledPBEStringEncryptor encryptor new PooledPBEStringEncryptor(); //2.加解密配置SimpleStringPBEConfig config new SimpleStringPBEConfig();config.setPassword(crack);config.setAlgorithm(PBEWITHHMACSHA512ANDAES_256); // 为减少配置文件的书写以下都是 Jasypt 3.x 版本配置文件默认配置config.setKeyObtentionIterations(1000);config.setPoolSize(1);config.setProviderName(SunJCE);config.setSaltGeneratorClassName(org.jasypt.salt.RandomSaltGenerator);config.setIvGeneratorClassName(org.jasypt.iv.RandomIvGenerator);config.setStringOutputType(base64);encryptor.setConfig(config); //3.解密return encryptor.decrypt(text);} }
http://www.zqtcl.cn/news/158636/

相关文章:

  • 做网站需要办什么手续html简单网页代码实例
  • 中文网页设计模板免费下载超级优化小说
  • 做网站的流程前端做什么网站建设与管理专业学什么
  • 用wordpress做购物网站西安建设工程网站
  • 响应式网站免费模板下载电商怎么做如何从零开始视频
  • 江西网站开发学校联系我们网站制作
  • 做网站首页图片素材营销网站制作要素
  • 云阳网站建设百度对 wordpress 排名
  • 做电商网站需要多少时间网站建设答辩ppt
  • 营销型网站的案例江苏seo网站排名优化
  • 企业网站 备案 网站名称凡科做视频网站
  • 湘潭建设公司网站杭州网站优化
  • 工信部备案网站网站空间服务商
  • 深圳市企业网站seo营销工具桂林百姓网
  • 网站建设所需材料wordpress nginx配置文件
  • 给企业做网站运营广州制作网站公司
  • 一个网站可以有几个关键词网页游戏制作过程
  • 网站可视化后台桥西区网站建设
  • 个人怎么建设网站北京朝阳区最好的小区
  • 企业应该如何建设网站江苏润祥建设集团网站
  • 沈阳网站建设价格wordpress h1标签
  • 找别人做网站一般注意什么三亚专业做网站
  • 企业营销网站的建设罗湖做网站
  • 百度蜘蛛抓取新网站WordPress20w文章
  • 国际贸易网站有哪些可植入代码网站开发
  • 信息服务平台有哪些网站东莞网站关键词
  • 青岛网站定制手机软件开发和网站开发
  • 网站数据库地址是什么看企业网站怎么做到百度秒收
  • 南昌网站建设资讯wordpress dynamo
  • 网站建设招标样本南宁培训网站建设