0

代码看起来像这样:

    from Crypto.Cipher import AES
    import os
    import base64

    def decryption(encryptedString):
        PADDING ='{'
        DecodeAES=lambda c, e:c.decrypt(base64.b64decode(e)).rstrip(PADDING)
        a = open('private_key0.pem','rb')
        key = a.read()
        print(key)
        cipher = AES.new(key)
        decoded = DecodeAES(cipher,encryptedString)
        print (decoded)
        a.close()

    s = open('session_key0.eaes','rb')
    cipher_text = s.read()
    print(cipher_text)
    s.close()

    decryption(cipher_text)

错误在cipher = AES.new(key)decryption(cipher_text) 行中说缺少模式。我需要加密已经加密的文件还是什么?

4

0 回答 0