AES Decrypt - IV Error

Sup, I was going through AES Decryption in OB2, I tried with a working Key and IV but idk it’s showing the error “CryptographicException: Specified initialization vector (IV) does not match the block size for this algorithm.

I tried to decrypt the same Cipher Text with the KEY & IV on an online website and it just worked fine.
Help Plox.

Here is the LS Code:

BLOCK:AESDecryptString
  cipherText = Pe+vf4/XZl4T05XQ5XNxoq8bM/Kv2s7el1exSdnzEdHMWYM1Lb+CL2gWI1rperSY4TzKemUa/cZrhbXv15m8Wm6XWyPfqKngEu+wptW6lOPkNUK01xduBwfHuBSRuxs+jkB26SjJbqVgnTaMOvAey9/RQw3L4aLti0A/0RXah8E=
  key = x3UJQeY2ift0AaCH7e7hQYvQyhOtpt87
  iv = gpR6JLD2qpDD406l
  => VAR @aESDecryptStringOutput
ENDBLOCK

Hello, please open an issue on the github repository

1 Like

For now u can use this to decrypt the aes string:

BLOCK:Script
INTERPRETER:NodeJS
INPUT 
BEGIN SCRIPT
const crypto = require('crypto');

const textToDecrypt = 'Pe+vf4/XZl4T05XQ5XNxoq8bM/Kv2s7el1exSdnzEdHMWYM1Lb+CL2gWI1rperSY4TzKemUa/cZrhbXv15m8Wm6XWyPfqKngEu+wptW6lOPkNUK01xduBwfHuBSRuxs+jkB26SjJbqVgnTaMOvAey9/RQw3L4aLti0A/0RXah8E=';
const secretKey = 'x3UJQeY2ift0AaCH7e7hQYvQyhOtpt87';
const mode = 'CBC';
const keySize = 256;
const dataFormat = 'base64';
const iv = 'gpR6JLD2qpDD406l';

const decipher = crypto.createDecipheriv('aes-' + keySize + '-' + mode, secretKey, iv);
let decrypted = decipher.update(textToDecrypt, dataFormat, 'utf8');
decrypted += decipher.final('utf8');
END SCRIPT
OUTPUT String @decrypted
ENDBLOCK

(made it based on the js of the site u provided)

1 Like

Thanks for the help Mate <3