public class AesUtil extends Object
| 构造器和说明 |
|---|
AesUtil() |
public static String encrypt(String plainText, String password) throws InvalidKeyException, NoSuchAlgorithmException, NoSuchPaddingException, UnsupportedEncodingException, IllegalBlockSizeException, BadPaddingException
plainText - 明文password - 密码InvalidKeyExceptionNoSuchAlgorithmExceptionNoSuchPaddingExceptionUnsupportedEncodingExceptionIllegalBlockSizeExceptionBadPaddingExceptionpublic static String decrypt(String encryptedText, String password) throws InvalidKeyException, NoSuchAlgorithmException, NoSuchPaddingException, IllegalBlockSizeException, BadPaddingException, NumberFormatException
encryptedText - password - InvalidKeyExceptionNoSuchAlgorithmExceptionNoSuchPaddingExceptionIllegalBlockSizeExceptionBadPaddingExceptionNumberFormatExceptionprivate static String parseByte2HexStr(byte[] buf)
buf - private static byte[] parseHexStr2Byte(String hexStr)
hexStr - Copyright © 2024. All rights reserved.