Skip to content

Use of AES key as IV will leak the key #591

Description

@blueben

if(!EVP_EncryptInit_ex(aes_encrypt_ctx, aes_cipher, NULL, arg_aes_key, arg_aes_key)) {

EVP_EncryptInit_ex is being called with arg_aes_key as the IV. This is a problem as an IV must be both unique (used only once) and random when used in a CBC mode (as is the case here). This means that the IV is easily recovered and because the IV is the key, it means that attackers can recover the key and decrypt any data being transported. In short, as implemented today the crypto scheme for dynomite is completely ineffective.

References:
https://en.wikipedia.org/wiki/Initialization_vector
https://defuse.ca/blog/recovering-cbc-mode-iv-chosen-ciphertext.html
http://www.cryptofails.com/post/70059594911/cakephp-using-the-iv-as-the-key
https://nsamteladze.wordpress.com/2016/05/27/initialization-vector-iv-in-aes-cbc/

Metadata

Metadata

Assignees

Labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions