cryptoguides.fyi

The cryptography you actually have to get right — hashing, passwords, encryption, signatures, key exchange — shown the correct way in seven languages, using each one's standard library or its most trusted crypto package.

🐹Go🐍Python🟩Node.js💠.NET⚙️C++Java🦀Rust
🎲

Secure random bytes

Generate cryptographically secure random bytes for keys, nonces, salts, and tokens.

01 / 12

#️⃣

Hashing with SHA-256

Compute a SHA-256 digest for integrity, deduplication, and content addressing.

02 / 12

🔐

Password hashing with Argon2id

Store passwords safely with Argon2id — the slow, salted, memory-hard standard.

03 / 12

🧾

Message authentication with HMAC

Authenticate a message with HMAC-SHA256 and verify it in constant time.

04 / 12

🔢

Time-based one-time passwords (TOTP)

Generate and verify the 6-digit rotating codes from authenticator apps (RFC 6238).

05 / 12

🔒

Symmetric encryption with AES-256-GCM

Encrypt and authenticate data with AES-256-GCM — authenticated encryption done right.

06 / 12

🌊

Streaming & large-file encryption

Encrypt data too big to hold in memory — chunk it, authenticate every chunk, and bind the order.

07 / 12

🗝️

Password-based encryption

Encrypt data with a passphrase: stretch it into a key with Argon2id, then seal it with AES-256-GCM.

08 / 12

🔑

Key derivation with HKDF

Derive one or more independent keys from a high-entropy secret using HKDF-SHA256.

09 / 12

✍️

Digital signatures with Ed25519

Sign and verify data with Ed25519 — the modern, footgun-free signature scheme.

10 / 12

🤝

Key exchange with X25519

Derive a shared secret over a public channel with X25519 Diffie-Hellman.

11 / 12

⏱️

Constant-time comparison

Compare secrets without leaking them through timing side channels.

12 / 12

Why this site?

Most cryptography bugs are not broken algorithms — they are the small things around them: a predictable random source, a reused nonce, a password run through a plain SHA-256, a MAC compared with ==. The primitives are the easy part; using them safely is where code goes wrong.

Each guide picks the modern, boring, correct option for one task and shows it end to end in Go, Python, Node.js, .NET, C++, Java, and Rust — preferring each language's standard library, and reaching for a well-established package (pyca/cryptography, libsodium, RustCrypto, BouncyCastle) only when there is no built-in. Pick your language once; it follows you from guide to guide.

A note on scope. These are starting points that show the right primitive and the right way to call it — not a substitute for review of your full threat model, key management, and protocol design. When a vetted high-level library or protocol (TLS, age, libsodium's secretbox, a password-hashing library) already solves your problem, use it instead of assembling primitives by hand.