After some investigation into prototyping and fast ciphers, I have a few observations and an implementation
Observations:
It's clear that ChaCha and AES are winners in the speed category of ciphers
(http://bench.cr.yp.to/results-stream.html)
Stream ciphers are probably the wrong use-case here because we most likely want authenticated encryption, which
rules out ChaCha.
Most block ciphers require an IV (which must be unique, but can be predictable) *
AES-GCM is an authenticated encryption mechanism that could be very useful here *
Implementation Details:
I have chosen to make the IV be the SignedId.Entropy, since it is unique but predictable and public. The key
then becomes the hashed SecretKey which is private.
CryptKey := AES-GCM( Key , Iv )
Key := PBKDF2WithHmacSHA1( SecretKey )
Iv := SignedId.Entropy
This means that all sessions will be encrypted with the same secret, but they will have a unique IV based on the
entropy of the session id. Note: secrets are rotated daily.
Alternatively, you could create a new SignedId every time Session data is stored
After some investigation into prototyping and fast ciphers, I have a few observations and an implementation Observations:
Implementation Details: I have chosen to make the IV be the SignedId.Entropy, since it is unique but predictable and public. The key then becomes the hashed SecretKey which is private.
CryptKey := AES-GCM( Key , Iv ) Key := PBKDF2WithHmacSHA1( SecretKey ) Iv := SignedId.Entropy
This means that all sessions will be encrypted with the same secret, but they will have a unique IV based on the entropy of the session id. Note: secrets are rotated daily.
Alternatively, you could create a new SignedId every time Session data is stored