Closed trung109 closed 7 months ago
Hello, I tried the code AES encryption with 2 modes CFB and OFB:
from Crypto.Cipher import AES key = bytes.fromhex('00112233445566778899aabbccddeeff') iv = bytes.fromhex('00112233445566778899aabbccddeeff') msg = bytes.fromhex('00112233445566778899aabbccddeeff') def encrypt(mode, msg): cipher = AES.new(key,mode, iv=iv) enc = cipher.encrypt(msg) return enc.hex() print(encrypt(AES.MODE_CFB, msg)) print(encrypt(AES.MODE_OFB, msg))
But i got 2 different ciphertexts, wouldn't it be the same according to Wiki?
62a121ba20c02a034a5d5986c2ecbdb6 62e75b8d6fa5bf46ec87a9276f9df54d
Hello, I tried the code AES encryption with 2 modes CFB and OFB:
But i got 2 different ciphertexts, wouldn't it be the same according to Wiki?