在 Javalin 框架中加密数据库密码的可能方法

问题描述

更新密码配置以存储 Ignite DB 的加密密码(而不是纯文本)

我知道的一种类型是 AES,是否有任何不同的优缺点加密技术都会有所帮助。

解决方法

最简单(也是非常常见)的方法是使用 Jasypt 基于密码的加密。 例如

String pass = System.getProperty("MySystemPropertyWithPass");
String encryptedValue = "...";
StandardPBEStringEncryptor encryptor = new StandardPBEStringEncryptor();
encryptor.setPassword(pass);
String decryptValue = encryptor.decrypt(encryptedValue);