|
|
@@ -0,0 +1,30 @@
|
|
|
+package com.punchsettle.server;
|
|
|
+
|
|
|
+import org.jasypt.encryption.pbe.StandardPBEStringEncryptor;
|
|
|
+import org.jasypt.iv.RandomIvGenerator;
|
|
|
+import org.jasypt.salt.RandomSaltGenerator;
|
|
|
+
|
|
|
+/**
|
|
|
+ * 加密工具
|
|
|
+ */
|
|
|
+public class JasyptGenerator {
|
|
|
+
|
|
|
+ public static void main(String[] args) {
|
|
|
+ StandardPBEStringEncryptor standardPBEStringEncryptor = new StandardPBEStringEncryptor();
|
|
|
+ standardPBEStringEncryptor.setPassword("");
|
|
|
+ standardPBEStringEncryptor.setAlgorithm("PBEWithMD5AndDES");
|
|
|
+ standardPBEStringEncryptor.setSaltGenerator(new RandomSaltGenerator());
|
|
|
+ standardPBEStringEncryptor.setIvGenerator(new RandomIvGenerator());
|
|
|
+ String url = standardPBEStringEncryptor.encrypt("jdbc:mysql://47.119.150.157:3306/punch_settle?useSSL=true&useUnicode=true&characterEncoding=utf-8&serverTimezone=Asia/Shanghai");
|
|
|
+ System.out.println("url:" + url);
|
|
|
+ String username = standardPBEStringEncryptor.encrypt("");
|
|
|
+ System.out.println("username:" + username);
|
|
|
+ String password = standardPBEStringEncryptor.encrypt("");
|
|
|
+ System.out.println("password:" + password);
|
|
|
+
|
|
|
+ String appid = standardPBEStringEncryptor.encrypt("");
|
|
|
+ System.out.println("appid:" + appid);
|
|
|
+ String secret = standardPBEStringEncryptor.encrypt("");
|
|
|
+ System.out.println("secret:" + secret);
|
|
|
+ }
|
|
|
+}
|