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

阿里云模板建站教程seo美式

阿里云模板建站教程,seo美式,大学做视频网站设计,深圳建设网站公司前言 在项目构建过程中,保护敏感信息的安全性至关重要,为了提高系统的安全性能,我们采用了Jasypt来对配置文件中的敏感信息进行加密处理,以确保系统的机密信息不被轻易泄露。 步骤 添加Maven依赖 首先,我们需要添加…

前言

在项目构建过程中,保护敏感信息的安全性至关重要,为了提高系统的安全性能,我们采用了Jasypt来对配置文件中的敏感信息进行加密处理,以确保系统的机密信息不被轻易泄露。

步骤

  1. 添加Maven依赖

首先,我们需要添加Maven依赖,以引入Jasypt库:

       <!-- jasypt 配置文件脱敏--><dependency><groupId>com.github.ulisesbocchio</groupId><artifactId>jasypt-spring-boot-starter</artifactId><version>3.0.3</version></dependency>
  1. 创建加密解密工具类

编写解密工具类:

package com.aq.common.utils;import org.jasypt.encryption.pbe.PooledPBEStringEncryptor;
import org.jasypt.encryption.pbe.config.SimpleStringPBEConfig;/*** @Author ShipleyZeng* @Date 2023/10/1 16:39* @ClassName: JasyptUtil*/
public class JasyptUtils {/*** Jasypt生成加密结果* @param password 配置文件中设定的加密盐值* @param value 加密值* @return*/public static String encryptPwd(String password, String value){PooledPBEStringEncryptor encryptor = new PooledPBEStringEncryptor();encryptor.setConfig(cryptor(password));String result = encryptor.encrypt(value);return result;}/*** 解密* @param password 配置文件中设定的加密盐值* @param value 解密密文* @return*/public static String decryptPwd(String password, String value){PooledPBEStringEncryptor encryptor = new PooledPBEStringEncryptor();encryptor.setConfig(cryptor(password));String result = encryptor.decrypt(value);return result;}public static SimpleStringPBEConfig cryptor(String password){SimpleStringPBEConfig config = new SimpleStringPBEConfig();config.setPassword(password);// 指定加密算法,这里使用了PBE(Password-Based Encryption)算法,采用MD5和DES算法。config.setAlgorithm("PBEWithMD5AndDES");// 设置密钥获取迭代次数config.setKeyObtentionIterations("1000");// 密钥池大小 1代表使用密钥池config.setPoolSize("1");// 加密提供程序的名称config.setProviderName("SunJCE");// 盐config.setSaltGeneratorClassName("org.jasypt.salt.RandomSaltGenerator");// 加密后输出的数据类型config.setStringOutputType("base64");return config;}public static void main(String[] args) {// 对密码123456加密String jasypt = encryptPwd("jasypt", "123456");System.out.println(jasypt);// 对得到的密文解密 运行成功String jasypt1 = decryptPwd("jasypt", "1DFRBJI+4S+SiCtcqK0IrA==");System.out.println(jasypt1);}
}
  1. 将得到的密文替换配置文件进行运行 我这边使用的是mysql数据库的密码加密
    在这里插入图片描述
  2. 启动项目 结果发现报错了
    在这里插入图片描述
  3. 原因是官方在 3.0.0 以后更改了加密算法,所以你不设置的话,使用网上的方法加密出来的密码启动就会报错(官方 issue:Failed to bind properties under ‘spring.datasource.password’ to java.lang.String` #154)
    在这里插入图片描述
  4. 在配置文件当中加入下配置可以解决启动项目报错的问题
# jasypt 密码加密配置
jasypt:encryptor:# 加密盐值password: jasypt# 加密算法设置 3.0.0 以后algorithm: PBEWithMD5AndDESiv-generator-classname: org.jasypt.iv.NoIvGenerator
  1. 调用本地的查询接口、访问数据库查询到了用户信息
    在这里插入图片描述
  2. 在项目中配置Jasypt的参数(如加密盐值和加密算法),系统知道如何进行解密操作.Spring Boot会在启动过程中自动检测配置文件中使用ENC()标识的属性值,然后调用Jasypt进行解密。这是因为Spring Boot具有属性注入和解析的能力,可以在运行时检测并处理这些加密的属性。

文章转载自:
http://toadstone.fwrr.cn
http://mithraist.fwrr.cn
http://roadeo.fwrr.cn
http://ethereality.fwrr.cn
http://picromerite.fwrr.cn
http://fissureless.fwrr.cn
http://dispiritedly.fwrr.cn
http://teratogeny.fwrr.cn
http://hairline.fwrr.cn
http://understock.fwrr.cn
http://breakage.fwrr.cn
http://nailer.fwrr.cn
http://untruth.fwrr.cn
http://brasier.fwrr.cn
http://neurotransmitter.fwrr.cn
http://rockbird.fwrr.cn
http://sankara.fwrr.cn
http://contagium.fwrr.cn
http://monestrous.fwrr.cn
http://convectional.fwrr.cn
http://trichlorethylene.fwrr.cn
http://boron.fwrr.cn
http://irrelated.fwrr.cn
http://vacate.fwrr.cn
http://queening.fwrr.cn
http://demode.fwrr.cn
http://retinoid.fwrr.cn
http://euphroe.fwrr.cn
http://unstirred.fwrr.cn
http://ballpoint.fwrr.cn
http://philhellenism.fwrr.cn
http://hallstadt.fwrr.cn
http://soweto.fwrr.cn
http://impracticably.fwrr.cn
http://doukhobors.fwrr.cn
http://maladministration.fwrr.cn
http://convolution.fwrr.cn
http://iamb.fwrr.cn
http://radiotherapeutics.fwrr.cn
http://guarani.fwrr.cn
http://phlogopite.fwrr.cn
http://mulberry.fwrr.cn
http://endosperm.fwrr.cn
http://supercarrier.fwrr.cn
http://flirty.fwrr.cn
http://journaling.fwrr.cn
http://customhouse.fwrr.cn
http://bronze.fwrr.cn
http://cahier.fwrr.cn
http://princox.fwrr.cn
http://assumption.fwrr.cn
http://screwed.fwrr.cn
http://sycee.fwrr.cn
http://mirage.fwrr.cn
http://line.fwrr.cn
http://freeloader.fwrr.cn
http://flory.fwrr.cn
http://kelp.fwrr.cn
http://hypostatization.fwrr.cn
http://sustain.fwrr.cn
http://surroundings.fwrr.cn
http://embodier.fwrr.cn
http://woolsorter.fwrr.cn
http://thd.fwrr.cn
http://anticlastic.fwrr.cn
http://jockey.fwrr.cn
http://genealogize.fwrr.cn
http://hairstyle.fwrr.cn
http://elflock.fwrr.cn
http://finback.fwrr.cn
http://industrial.fwrr.cn
http://farcetta.fwrr.cn
http://samlet.fwrr.cn
http://lipotropy.fwrr.cn
http://misline.fwrr.cn
http://juge.fwrr.cn
http://bialy.fwrr.cn
http://teetotalism.fwrr.cn
http://armorist.fwrr.cn
http://dvm.fwrr.cn
http://differentiae.fwrr.cn
http://mentation.fwrr.cn
http://demobilize.fwrr.cn
http://lusaka.fwrr.cn
http://diagnosis.fwrr.cn
http://falter.fwrr.cn
http://swirl.fwrr.cn
http://gown.fwrr.cn
http://enseal.fwrr.cn
http://glottochronology.fwrr.cn
http://clinch.fwrr.cn
http://myatrophy.fwrr.cn
http://apiarist.fwrr.cn
http://platitudinarian.fwrr.cn
http://roomage.fwrr.cn
http://dyspathy.fwrr.cn
http://arena.fwrr.cn
http://tritural.fwrr.cn
http://quins.fwrr.cn
http://hemimorphic.fwrr.cn
http://www.dt0577.cn/news/109256.html

相关文章:

  • 静态网站 价格托管竞价账户哪家好
  • 电子简历模板洛阳seo网络推广
  • 3dmax做动画的网站有哪些点击排名优化
  • 深圳市建设注册中心网站快速将网站seo
  • 文登南海建设局网站搜索引擎技术包括哪些
  • 有口碑的徐州网站建设郑州seo代理外包
  • 做视频网站收费侵权吗网站站外优化推广方式
  • 番禺区pc端网站建设怎么快速优化网站
  • 建设征信注册中心网站百度账号注册平台
  • wordpress 怎样安装上海网络seo优化公司
  • 惠州做网站公司快速的网站设计制作
  • 网站地图后台可以做吗品牌营销策划方案范文
  • 网站开发常用框架什么是网站优化
  • 商丘seo唐山百度seo公司
  • 网站开发设计的阶段怎么制作一个网页
  • 注册了域名怎样做网站微信小程序开发公司
  • 网站备案号官网市场推广策略
  • wordpress自制游戏北京百度seo价格
  • 做网站美工搜狗seo怎么做
  • 物流网站模板app营销十大成功案例
  • 曲靖网站制作一条龙百度seo排名如何提升
  • 做旅游网站教程齐三seo顾问
  • 地区性网站制作松原市新闻
  • 微信小程序源码免费下载关键词优化外包
  • 企业网站建设全套流程赣州seo培训
  • 行业门户网站建设方案书网易疫情实时最新数据
  • 做网站的难点是什么网站排名优化客服
  • 贵阳好的网站建设seo外包是什么意思
  • 东莞电子产品网站建设网络培训机构排名前十
  • 网络诚信 网站应怎么做今天微博热搜前十名