Skip to content

IV re-use and multiple calls to encrypt #1

@fabrice102

Description

@fabrice102

If encrypt may be called several times for the same key, the IV should not be derived from the the key:

const iv = derivation.slice(keylen);

Instead, it should be generated uniformly at random and prepended to the ciphertext. Re-using IV in AES-CBC modes allows to know if the same data has been encrypted twice or not. See https://security.stackexchange.com/a/1097

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions