fwq
2024-09-27 4034fdffb309c5636c2f7430b8f52bc2b0f2b514
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
package com.hx.phip;
 
import com.hx.util.AesUtil;
import com.hx.util.rsa.RSAUtil;
import org.jasypt.util.text.BasicTextEncryptor;
 
public class Rsa {
    public static void main(String[] args) {
 
       System.out.println(AesUtil.aesEncryp("ev8i6tfy9Gg0eyaF6SDyvNHcsNGNeff8enwT_eLKf_0"));
 
        BasicTextEncryptor encryptor = new BasicTextEncryptor();
        encryptor.setPassword(AesUtil.SECRET);
        String encrypted = encryptor.encrypt("99sdfa5454a4f5asd4f55saf4");
        System.out.println(encrypted);
 
        //配置文件数据加密
        /*BasicTextEncryptor encryptor = new BasicTextEncryptor();
        encryptor.setPassword(AesUtil.SECRET);
        String encrypted = encryptor.encrypt("pis_rw:UYWoCz#4^@w5Soj*");
        System.out.println(encrypted);*/
        //解密
        //String decrypt = encryptor.decrypt("uFESkQwpAXSxg0SUR6BOlTujZqFC3pfIi3eTfuP0Lmrd0fqxG5XC4X0ho0Sp2FEV");
        //System.out.println("decrypt:"+decrypt);
 
        //RSAUtil.main(null);
    }
 
}