aws / aws/aws-encryption-sdk-java
CryptoOutputStream outputs invalid message when used to encrypt empty plaintext
- Lenguaje dominante
- Java
- Estrellas
- 240
- Forks
- 125
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Descripción
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 "".
Guía de contribución
Línea de trabajo
Comienza con CryptoOutputStream y reproduce el caso que llama a close() sin escribir texto plano. Sigue cómo se emite el frame final vacío y verifica que el mensaje resultante pueda ser parseado y descifrado por una implementación de AWS Encryption SDK, dando como resultado un texto plano vacío.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- java
- Área
- cryptography, security
- Tipo de issue
- Error
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Estado de actividad
- Estancado
- Claridad
- Bastante claro
- Aptitud para principiantes
- 45/100