aws / aws/aws-encryption-sdk-java

CryptoOutputStream outputs invalid message when used to encrypt empty plaintext

Aperta
#218 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub
bug
Lingua principale
Java
Stelle
240
Fork
125
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

In order to perform the "encrypt a zero length plaintext" using a CryptoOutputStream, the correct setup would be to create the CryptoOutputStream, don't write any bytes to it, then immediately call `close()`.

This results in the CryptoOutputStream only writing bytes for an empty final frame (and possibly a footer). It does not write any header bytes, resulting in an invalid message that cannot be parsed by any AWS Encryption SDK implementation.

This should be fixed such that this use case will correctly write header bytes before the message body and footer, resulting in a message that can be successfully decrypted into the plaintext "".

Guida per i contributori

Apri la guida per i contributori

Direzione di ricerca

Start with CryptoOutputStream and reproduce the case that calls close() without writing plaintext. Trace how the empty final frame is emitted and verify that the resulting message can be parsed and decrypted by an AWS Encryption SDK implementation to the empty plaintext.

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

Valutazione

Stack tecnologico
java
Ambito
cryptography, security
Tipo di issue
Bug
Difficoltà
3/5
Tempo stimato
1-2 giorni
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
45/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.