public static string Decrypt(string Key, string Iv, CipherMode Mode, PaddingMode Padding, string Encrypted, ByteEncodeMethod ByteEncode, Encoding TextEncode) { byte[] encrypted = ByteArrayEncoder.Decode(Encrypted, ByteEncode); byte[] key = ByteArrayEncoder.Decode(Key, ByteEncode); byte[] iv = ByteArrayEncoder.Decode(Iv, ByteEncode); byte[] bytes = AesWrapper.Decrypt(key, iv, Mode, Padding, encrypted); return(TextEncode.GetString(bytes)); }
public static string Decrypt(string Key, string Encrypted) { return(AesWrapper.Decrypt(Key, string.Empty, CipherMode.ECB, PaddingMode.PKCS7, Encrypted, ByteEncodeMethod.Base64, Encoding.UTF8)); }