- package com.wengegroup.dqgzSystem.utils;//package com.zyc.commons.utils.utils;
-
- import org.jasypt.encryption.pbe.StandardPBEStringEncryptor;
-
- /**
- * @author fubc
- * @date 2022/10/12 12:06
- * @Deception jasypt加密解密工具类
- */
- public class CryptoUtil {
-
- //ZYC-SERVICE-2023
- private static String password="02700083-9fd9-4b82-a4b4-9177e0560e92" ;
-
- /**
- * 原始值加密
- *
- * @param sourceValue 原始值
- * @return lang.String
- */
- public static String encrypt(String sourceValue) {
- StandardPBEStringEncryptor textEncryptor = new StandardPBEStringEncryptor();
- textEncryptor.setPassword(password);
- return textEncryptor.encrypt(sourceValue);
- }
-
- /**
- * 加密值解密
- *
- * @param encryptValue 加密结果值
- * @return lang.String
- */
- public static String decrypt(String encryptValue) {
- StandardPBEStringEncryptor textEncryptor = new StandardPBEStringEncryptor();
- textEncryptor.setPassword(password);
- return textEncryptor.decrypt(encryptValue);
- }
-
- public static void main(String[] args) {
- System.out.println(encrypt("sprint01"));
- System.out.println(encrypt("Sprint02@mysql"));
-
- System.out.println(encrypt("elastic"));
- System.out.println(encrypt("eTB31k3xozXS6CsGtkSa"));
-
- }
-
- }
-
username: ENC(B7or6y0UK+QwsKlJYmRbUA==)
password: ENC(Km0L2gDrFTPtJ+VTDZN2fXYv19UZ+OAM0am5+ACv8Wg=)