Reputation: 36
I want to decode some text from a database. I know the texts are encoded with rijndael-128 CBC256 algorithm. The instruction to decode the text is to transform the text to base64 format first then use rijndael-128 / CBC256 algorithm. I also have the key which is 32 bytes.
The problem is that when I decode the initial text with base64, I get an output like this :
{
"iv":"zv2rEAMi38LKD2FJlIeMMg==",
"value":"UnnuNWqoZIgiALa4IchFA4ReYcBYwIdtpQEefEmt\/ViEMgBVMhfCAydGo1tXVRAdNNRSfMm6VelGT5vORxTFM\/03t3id5f5RQaPxSQ1rDRsn2yGyANDLF04szC+FhvVXiW5SBVAEtpFe....."
}
As you can see IV is more than 16 bytes, this gives me an error when I want to decrypt the text, using this line of code:
aes = AES.new(input_key, AES.MODE_CBC, iv)
the error:
ValueError: Data must be padded to 16 byte boundary in CBC mode
Please tell me what to do if you have any ideas. Please consider that I should use the given IV and Value to be able to get the decoded text. Thanks
I searched to see what I am supposed to do, but none of existing solutions worked for me. I want a python code to decode texts using rijndael-128 / CBC256 algorithm after I decode the text using Base64 algorithm.
Upvotes: 0
Views: 162