-
Notifications
You must be signed in to change notification settings - Fork 532
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
Add explicit initialization vector to aes_encrypt() #618
base: dev
Are you sure you want to change the base?
Add explicit initialization vector to aes_encrypt() #618
Conversation
aes_encrypt() now prepends one block of cryptographically strong pseudo-random bytes to the plaintext. This block is used in the decryption of subsequent blocks as per CBC mode of operation, playing the role of a unique and random initialization vector by making encryption non-deterministic. This scheme of prepending a random block to the plaintext provides a simpler alternative to communicating a random and unique IV between the encryption and decryption routine (which would typically involve sending the IV over the wire, or managing shared state between the two routines).
My proposed solution for #627. |
If we start updating a cluster with live traffic will this break replication? We need to make sure that we can gracefully upgrade clusters to make it work properly. |
For a change like this to support incremental rollout (i.e. backwards compatibility) it might be easiest to add a new dmsg version and provide the explicit IV functionality via a branch on version. It appears everywhere This would require updating a cluster in two-stages:
As far as I can tell there is no way for a sender to know the version of its receiver in advance. Also interested in hearing other suggestions on ways to go about allowing incremental rollout for a change to underlying messages like this! |
aes_encrypt()
now prepends one block of cryptographically strongpseudo-random bytes to the plaintext. This block is used in the
decryption of subsequent blocks as per CBC mode of operation,
playing the role of a unique and random initialization vector by
making encryption non-deterministic.
This scheme of prepending a random block to the plaintext provides
a simpler alternative to communicating a random and unique IV between
the encryption and decryption routine (which would typically involve
sending the IV over the wire, or managing shared state between the
two routines).