package com.mes.metering.util; import lombok.extern.slf4j.Slf4j; import sun.misc.BASE64Decoder; import sun.misc.BASE64Encoder; import javax.crypto.Cipher; import javax.crypto.KeyGenerator; import javax.crypto.SecretKey; import javax.crypto.spec.SecretKeySpec; import java.security.SecureRandom; /** * @program: wx-template * @description * @author: sgy * @create: 2022-05-05 16:36 **/ @Slf4j public class AESUtil { private static final String sysKey = "是对付苏联的佛山"; public static void main(String[] args) { String s1 = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJwYXNzd29yZCI6IjEyMyIsImV4cCI6MTY1MTY2NjgxMiwidXNlcm5hbWUiOiJ6aGFuZ3NhbiJ9.ufQzpVE0scbG1xznt1WdZvCiZgCkyNEfRzk_jpeFMw4"; String s11 = AESUtil.encrypt(s1); String s111 = AESUtil.decrypt(s11); System.out.println(String.format("s1=%s \n s11=%s \n s111=%s", s1, s11, s111)); } /** * 加密 * * @p
AESUtil 方法加密
最新推荐文章于 2024-07-27 17:56:15 发布