I have this python snippet which always worked for me:
from Crypto.Cipher import AES # pip install pycryptodome
import os
def aes_cfb(data, key, iv):
ctx = AES.new(key, AES.MODE_CFB, iv = iv, segment_size = 128)
decrypted = ctx.decrypt(data)
return decrypted
filesize = os.stat('./config_enc.bin').st_size
with open('./config_enc.bin','rb') as rf:
data = rf.read(filesize)
decrypted = aes_cfb(data, b'3398699acebda0da', b'b39a46f5cc4f0d45')
with open('./config.xml', 'wb') as wf:
wf.write(decrypted)
So I have decided to use openssl.exe
as a command line tool for testing (because it is more practical than a python code), and it never worked for me.
Here is the command line tool I used using version OpenSSL 1.1.1j 16 Feb 2021
:
openssl.exe enc -d -aes-128-cfb -in config_enc.bin -out config.xml -K 3398699acebda0da -iv b39a46f5cc4f0d45
So, what I am doing wrong here? or maybe OpenSSL is not compatible at all! If so, then I should drop it and replace it with something else.
Encrypted file: https://filebin.net/xm85gfwfauf4mutv (Expires 1 week from now).