AES random decryption failure

Aperta
#1,057 1 commento 1 reazione 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
25/100
Tipo di issue
Bug
Chiarezza
Da chiarire
Stato di attività
Ferma
Stack tecnologico
javascript
Ambito
cryptography

Direzione di ricerca

Start by reproducing decryptAES with the two provided ciphertext and key pairs, then inspect how AES-ECB decipher.finish() and output handle the second result. Compare the JavaScript inputs and padding or encoding assumptions with the iOS decryption. Done means identifying why the second vector produces an empty string and documenting or correcting the relevant behavior.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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.

Lingua principale
JavaScript
Stelle
5.4k
Fork
875
Merge medio
3m
PR unite (30g)
6

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di digitalbazaar/forge

Tutte le issue di digitalbazaar/forge

Issue simili

Altre issue su JavaScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.