AESencryption与pycrypto
我有一个javascript代码片段,我试图转换为python
var cipherAlgorithm = 'aes256'; var decipher = crypto.createDecipher(cipherAlgorithm, cipher); password = decipher.update(encryptedpass, 'hex', 'utf8')+ decipher.final('utf8');
我试图用pythoncrypto重写python,无论我做什么,我都会得到错误的值
cyphertext=faaafaaa" cipher=AES.new(key, AES.MODE_CBC, "\0"*16) cipher.decrypt(cypertext)
并返回错误的值。 (没有正确解密)在JavaScript代码(我不是一个JS专家)我注意到,输出编码是utf8,所以我尝试这样的事情
unicode(cipher.decrypt(cyphertext), "utf-8")
但我得到一个错误'utf8'编解码器无法解码位置6字节0x81:无效起始字节
什么解决scheme?