druid 連接池加密算法
阿新 • • 發佈:2017-08-31
decrypt rgs 信息 私鑰 filter keypair com except bsp
package juint; import com.alibaba.druid.filter.config.ConfigTools; public class DruidTest { public static void main(String[] args) throws Exception { // 密碼明文 String password = "1q2w3e4r"; System.out.println("密碼[ " + password + " ]的加密信息如下:\n"); String[] keyPair= ConfigTools.genKeyPair(512); // 私鑰 String privateKey = keyPair[0]; // 公鑰 String publicKey = keyPair[1]; // 用私鑰加密後的密文 password = ConfigTools.encrypt(privateKey, password); System.out.println("privateKey:" + privateKey); System.out.println("publicKey:" + publicKey); System.out.println("password:" + password); String decryptPassword = ConfigTools.decrypt(publicKey, password); System.out.println("decryptPassword:" + decryptPassword); } }
druid 連接池加密算法