Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
doc: add caveats of algs and key size in crypto
Add description of user responsibility in the choice of cypto
algorithms and its key length. Some of recommendations for the safer
use are also described.
  • Loading branch information
Shigeki Ohtsu committed Oct 22, 2015
commit e4ef21ee1c610b1a08ddb6dbbaf6af3ebf19ba9a
20 changes: 20 additions & 0 deletions doc/api/crypto.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -768,6 +768,25 @@ default, set the `crypto.DEFAULT_ENCODING` field to 'binary'. Note
that new programs will probably expect buffers, so only use this as a
temporary measure.

## Caveats

The crypto module still supports some algorithms which are already
compromised. And the API also allows to use ciphers and hashes with a
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"And the API also allows the use of ciphers and hashes with a" (replace to with the)

small key size that are consider to be weak for a safe use.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"... that are considered to be too weak for safe use."


Users should take full responsibility for selecting the crypto
algorithm and its key size according to their security requirements.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"algorithm and key size..." (remove its)


The following descriptions only show some of recommendations to use
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This sentence is a bit awkward. Should rework it a bit.

crypto module. See [NIST SP 800-131A] for details.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps something like, "Based on the recommendations of [NIST SP 800-131A]:" instead?

- MD5 and SHA-1 are no longer acceptable where collision resistance is
required such as digital signatures.
- The key size of RSA, DSA and DH is recommended to use more than 2048
bits and that of the curve of ECDSA and ECDH is more than 224 bits to
be safe to use for several years.
- The DH groups of `modp1`, `modp2` and `modp5` have a small key size
less than 2048 bits so they are not recommended.

[createCipher()]: #crypto_crypto_createcipher_algorithm_password
[createCipheriv()]: #crypto_crypto_createcipheriv_algorithm_key_iv
Expand All @@ -779,3 +798,4 @@ temporary measure.
[RFC 3526]: http://www.rfc-editor.org/rfc/rfc3526.txt
[crypto.pbkdf2]: #crypto_crypto_pbkdf2_password_salt_iterations_keylen_digest_callback
[EVP_BytesToKey]: https://www.openssl.org/docs/crypto/EVP_BytesToKey.html
[NIST SP 800-131A]: http://csrc.nist.gov/publications/nistpubs/800-131A/sp800-131A.pdf