1、代码
import cn.hutool.crypto.Mode; import cn.hutool.crypto.Padding; import cn.hutool.crypto.symmetric.AES; import javax.crypto.spec.IvParameterSpec; import javax.crypto.spec.SecretKeySpec; public class Test { public static void main(String [] args) { SecretKeySpec secretKeySpec = new SecretKeySpec("thanks,pig4cloud".getBytes(), "AES"); IvParameterSpec ivParameterSpec = new IvParameterSpec("thanks,pig4cloud".getBytes()); AES aes = new AES(Mode.CFB, Padding.NoPadding, secretKeySpec, ivParameterSpec); String password = aes.decryptStr("YehdBPev"); System.out.println("password:" + password); } }
2、验证截图