package com.infoepoch.pms.dispatchassistant.common.utils;

import org.jasypt.util.text.BasicTextEncryptor;

public class JasyptEncryptUtils {
    public static void main(String[] args) {


        //读取环境变量 Jasypt加密密钥，解密同样需要
        BasicTextEncryptor encryptor = new BasicTextEncryptor();
        encryptor.setPassword("INFO_epoch1"); // 密钥需保密，后续启动时注入
        String encryptedPwd = encryptor.encrypt("Epoinfo0004#3"); // 加密原始密码ec6CMgdEf3adQen
        System.out.println("加密后的密码：" + encryptedPwd); // 复制该密文
        String decPwd = encryptor.decrypt(encryptedPwd);
        System.out.println("解密后的密码：" + decPwd); // 复制该密文
    }
}