Protocols

There are a lot of areas around cryptography protocols and what one should do to accomplish various things, see the table below for a good summary of many different areas.

Area Percival in 2009 Ptacek in 2015 Latacora in 2018
Online backups tarsnap tarsnap tarsnap
Symmetric key length 256-bit 256-bit 256 bit
Symmetric “Signatures” HMAC HMAC HMAC
Random IDs 256-bit 256-bit 256-bit
Hashing algorithm SHA256 (SHA-2) SHA-2 SHA-2
Password handling Algorithms: Algorithms: Algorithms:
- scrypt - scrypt - scrypt
- PBKDF2 - bcrypt - argon2
- PBKDF2 - bcrypt
- PBKDF2
Website security OpenSSL Libraries: Libraries:
- OpenSSL - AWS ALB/ELB
- BoringSSL - OpenSSL
- AWS ALB/ELB - LetsEncrypt
Client-server app security OpenSSL Libraries: Libraries:
- OpenSSL - AWS ALB/ELB
- BoringSSL - OpenSSL
- AWS ELBs - LetsEncrypt
Asymmetric encryption Use RSAES-OAEP 1 NaCl/libsodium NaCl/libsodium
Asymmetric signatures Use RSASSA-PSS 2 Algorithms: Algorithms:
- NaCl - NaCl
- Ed25519 - Ed25519
- RFC6979
Diffie-Hellman 2048-bit Group #14 with a generator or 2 Algorithms: Algorithms:
- DH-2048 - Nothing
- NaCl - Curve25519
Encrypting Data AES-CTR HMAC Algorithms: Algorithms:
- NaCl/libsodium default - Amazon KMS
- ChaCha20-Poly1305 - XSalsa20+Poly1305
- AES-GCM

Above table idea from: https://news.ycombinator.com/item?id=16748400 (author: weinzierl) sources for the table:

Crypto Libraries

  • OpenSSL is fine to use, it had a down-period, but it's being
  • maintained again now, try to stay on their LTS releases.

  1. with SHA256 as the hash function, MGF1+SHA256 as the mask generation function, and a public exponent of 65537. Make sure that you follow the decryption algorithm to the letter in order to avoid side channel attacks. [return]
  2. with SHA256 as the hash function, MGF1+SHA256 as the mask generation function, and a public exponent of 65537. [return]