实践Jasypt Posted on 2018-06-04 | In Java | Visitors jasypt jasypt-spring-boot 对明文参数进行加密,例如使用密钥test123对mysql进行加密得到密文AalZ8yu+F1RuYK/oUma2cw== 12345678910111213141516171819$ java -cp org/jasypt/jasypt/1.9.2/jasypt-1.9.2.jar org.jasypt.intf.cli.JasyptPBEStringEncryptionCLI input="mysql" password=test123 algorithm=PBEWithMD5AndDES ----ENVIRONMENT----------------- Runtime: Oracle Corporation Java HotSpot(TM) 64-Bit Server VM 25.152-b16 ----ARGUMENTS------------------- algorithm: PBEWithMD5AndDES input: mysql password: test123 ----OUTPUT---------------------- AalZ8yu+F1RuYK/oUma2cw== 配置密钥 1jasypt.encryptor.password=test123 配置密文参数 1dataSource.myDS.password=ENC(AalZ8yu+F1RuYK/oUma2cw==)