kaleidos / grails-security-stateless

Grails plugin to implement stateless authentication using Spring Security
Apache License 2.0
17 stars 8 forks source link

Use HKDF or any other key derivation function for derive one time encryption keys #25

Open niwinz opened 9 years ago

niwinz commented 9 years ago

You are currently using the pbkdf2 algorithm for derive the encryption key (obviously for encrypt the message/token). PBKDF2 is a key derivartion function designed for use when the master key is not Cryptographically secure, such as passwords. Using it implies a lot of overhead in message encryption in a use case of this library. My recommendation is switch to other policy of deriving a encryption key.

This is my proposal:

General notes for master key management:

One time (per message) key derivation procedure:

We can speak in the office about this if something is not clear.