I’m solving this ctf where you have to encrypt a message with DES using the PyCryptodome module. the message is “La lunghezza di questa frase non è divisibile per 8” (is italian). I cannot convert to bytes this message because accented chars are not included in utf-8 (I think this is the exaplaination). Someone can help me encrypt the message?
from Crypto.Util.Padding import pad
from Crypto.Cipher import DES
Cipher = 'DES'
Mode_of_operation = 'CBC'
plaintext = b'La lunghezza di questa frase non è divisibile per 8'
padding_scheme = 'x923'
print(plaintext)
key = bytes.fromhex('fc479b5296ec6938')
cipher = DES.new(key, DES.MODE_CBC)
enc_message = cipher.encrypt(pad(plaintext, 8,padding_scheme))
print(cipher.iv.hex())
print(enc_message.hex())
I tried to convert the accented char into “xe8” but the ctf platform declared it incorrect.