Guides¶
Each guide explains how to accomplish a common task, with the recommended algorithm and complete code that you can copy. The alternatives, and when to prefer them, come at the end.
I want to… |
Recommended |
Guide |
|---|---|---|
Encrypt data with a secret key |
AES-GCM |
|
Encrypt data with a password |
scrypt + AES-GCM |
|
Store and check users’ passwords |
bcrypt |
|
Encrypt data for a recipient’s public key |
HPKE |
|
Sign data, or verify a signature |
Ed25519 |
|
Compute a hash of data or of a file |
SHA-256 |
|
Authenticate a message with a secret key (MAC) |
HMAC-SHA256 |
|
Generate, save, and load keys |
PEM files (PKCS#8) |
|
Agree on a secret key with another party |
ECDH (P-256) + HKDF |