Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AES random decryption failure #1057

Open
anisfaw opened this issue Nov 23, 2023 · 1 comment
Open

AES random decryption failure #1057

anisfaw opened this issue Nov 23, 2023 · 1 comment

Comments

@anisfaw
Copy link

anisfaw commented Nov 23, 2023

Hello everyone,

Im facing an issue while decrypting an "encryptedMessage" that occurs randomly using the following method :

METHOD :

    let decryptAES = function (encryptedMessage, key) {
        const decipher = forge.cipher.createDecipher('AES-ECB', forge.util.hexToBytes(key));
        decipher.start();
        decipher.update(forge.util.createBuffer(encryptedMessage));
        decipher.finish();
        return decipher.output.toHex();
    };

Valid decryption :
let ktaDecrypted = decryptAES(forge.util.decode64('rplbhs67wEklyMANzB/I5Q=='), '61A402A2AD37BC383B1640BF40CB34E6');
Result : ktaDecrypted : 'd1f47b35ac2bce1ead510a73bf84a0e2'

Unvalid decryption :
let ktaDecrypted = decryptAES(forge.util.decode64('Ky1HCLxXFKyY7O3Kcsq0OA=='), 'D610315807C4CEB945C7C10EE952D5B9');
Result : ktaDecrypted : ''

in this second case, i get an empty string as an outpu

Can anyone help with that ?

Note: on the other hand, the IOS Team could decrypt this correctly using the same informations.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants