util
This commit is contained in:
parent
8e052e3cb0
commit
d9850db280
|
|
@ -9,6 +9,7 @@ import cn.hutool.crypto.symmetric.AES;
|
|||
//import net.xnzn.core.common.encrypt.SpringContextHolder;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import javax.crypto.spec.IvParameterSpec;
|
||||
|
|
@ -57,7 +58,7 @@ public class AesEncryptUtil {
|
|||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
System.out.println(aesEncrypt("Bonus$2026"));
|
||||
System.out.println(aesEncrypt("Bd@19901"));
|
||||
System.out.println(aesDecode("PCAGz8j5ByU2AzoT6vtlLA=="));
|
||||
System.out.println();
|
||||
|
||||
|
|
@ -67,5 +68,8 @@ public class AesEncryptUtil {
|
|||
|
||||
System.out.println(aesEncrypt("Bd@19901"));
|
||||
System.out.println(aesDecode("mgURks4Khhn55E1qSpw8ZA=="));
|
||||
|
||||
BCryptPasswordEncoder passwordEncoder = new BCryptPasswordEncoder();
|
||||
System.out.println(passwordEncoder.encode(aesEncrypt("Bd@19901")));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -70,8 +70,8 @@ public class SM4EncryptUtils {
|
|||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
// System.out.println(sm4Encrypt("18110922397"));
|
||||
// System.out.println(sm4Decrypt("J1KE3IyZqIqgWk09Z2gWpQ==##encrypted"));
|
||||
System.out.println(sm4Encrypt("18715460609"));
|
||||
System.out.println(sm4Decrypt("PCAGz8j5ByU2AzoT6vtlLA=="));
|
||||
//
|
||||
// System.out.println(sm4Encrypt("13866134935"));
|
||||
// System.out.println(sm4Decrypt("29G1AUHDmLvPe1tt0t12Dw==##encrypted"));
|
||||
|
|
|
|||
Reference in New Issue