-
-
Notifications
You must be signed in to change notification settings - Fork 34.2k
Closed
Labels
cryptoIssues and PRs related to the crypto subsystem.Issues and PRs related to the crypto subsystem.docIssues and PRs related to the documentations.Issues and PRs related to the documentations.
Description
doc/api/crypto.md currently says this:
it is recommended that developers derive a key and IV on their own using
crypto.pbkdf2()
That's only sound when the key+IV are used once. Using the same key+IV twice is undesirable in general and downright disastrous with counter mode ciphers:
- identical plaintexts encrypt to the same ciphertext (usually not what you want)
- leaks information about the initial plaintext block with CBC and CFB ciphers
- completely destroys the security of CTR, GCM and OFB ciphers
It would be good to add some guidelines on how to safely create and store IVs. They should be unpredictable but don't need to be kept secret after encrypting. Are there exceptions to this rule?
Refs: indexzero/nconf#299
Metadata
Metadata
Assignees
Labels
cryptoIssues and PRs related to the crypto subsystem.Issues and PRs related to the crypto subsystem.docIssues and PRs related to the documentations.Issues and PRs related to the documentations.