public static string DecryptAES(this string input, string password) { if (password.Length > 16) { password = password.Substring(0, 16); } else { StringBuilder sb = new StringBuilder(); for (int i = password.Length; i < 16; i++) { sb.Append("*"); } password += sb; } byte[] inputbytes = Convert.FromBase64String(input); byte[] passbytes = Encoding.UTF8.GetBytes(password); if (passbytes.Length > 17) { Array.Resize(ref passbytes, 16); } byte[] outbytes = Cipher.AES_DecryptByte(inputbytes, passbytes, DefaultIV); return(Encoding.UTF8.GetString(outbytes)); }