Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: allow using ciphers with no IV or the same IV for every encryption #3

Closed
wants to merge 2 commits into from

Conversation

svandenakker
Copy link
Member

This commit enables modes of operation that do not require an IV, such
as ECB. It also allows reusing of IVs. This is not recommended if it can
be avoided, because if the (first few blocks of) plaintext are the same,
the (first few blocks of) the ciphertext will be the same, thus
disclosing information. However, this can be useful to implement a form
of "searchable encryption", where one can search whether a string is
present without having to decrypt all ciphertexts first.

This commit also renames references to "salt" with "IV". A salt is some
random string added to a passphrase. Some algorithm (such as PBKDF2) is
then used to derive a key from this passphrase. This key is then used by
the block cipher. The salt makes sure the same passphrase does not
always result in the same key. An IV, on the other hand, is used by a
block cipher mode of operation (such as CBC) to ensure that the same
plaintext does not always encrypt to the same ciphertext. In this case,
it is clear "IV" was meant.

This commit enables modes of operation that do not require an IV, such
as ECB. It also allows reusing of IVs. This is not recommended if it can
be avoided, because if the (first few blocks of) plaintext are the same,
the (first few blocks of) the ciphertext will be the same, thus
disclosing information. However, this can be useful to implement a form
of "searchable encryption", where one can search whether a string is
present without having to decrypt all ciphertexts first.

This commit also renames references to "salt" with "IV". A salt is some
random string added to a passphrase. Some algorithm (such as PBKDF2) is
then used to derive a key from this passphrase. This key is then used by
the block cipher. The salt makes sure the same passphrase does not
always result in the same key. An IV, on the other hand, is used by a
block cipher mode of operation (such as CBC) to ensure that the same
plaintext does not always encrypt to the same ciphertext. In this case,
it is clear "IV" was meant.
@svandenakker
Copy link
Member Author

Turns out, this was a pretty half-baked idea. A new MR is coming that should be a bit better.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant