Add explicit initialization vector to aes_encrypt()#618
Add explicit initialization vector to aes_encrypt()#618numberten wants to merge 5 commits intoNetflix:devfrom
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).