Crypto for Everyone
summary
Libsodium lands in PHP 7.2 and provides concrete, secure defaults: Argon2 password hashing (Argon2i present, Argon2id slated for 7.3), constant‑time verification, and high‑level APIs like secretbox and crypto_box. Examples use 32‑byte key and 24‑byte nonce, ChaCha20‑Poly1305 or AES with AEAD, random_bytes for nonces, and password_hash/password_verify replacements. A working stateless API token is built by encrypting userID+expiry with secretbox and tacking the nonce on front; decryption and validation succeed.
AI-written summary · about
chapters (16)
- 0:00Intro
- 2:28CRYPTOGRAPHIC FUNCTIONS
- 7:41WHICH EXTENSION TO USE?
- 9:06PHP CRYPTO LIBRARIES
- 10:25WHATS LIBSODIUM?
- 12:12SALTY PEOPLE
- 15:36EXAMPLE: SIDE CHANNEL VULNERABILITY
- 23:43HASHING WITH SODIUM
- 25:24MESSAGE AUTHENTICATION CODES
- 35:57SECRET-KEY ENCRYPTION EXAMPLES
- 39:02PUBLIC-KEY ENCRYPTION
- 41:16EXAMPLE: PUBLICKEY ENCRYPTION
- 43:24OTHER CRYPTO FUNCTIONS
- 48:29EXAMPLE: STATELESS API TOKEN GENERATION IN LARAVEL
- 50:33EXAMPLE: STATELESS API TOKEN VALIDATION IN LARAVEL
- 52:37DOCUMENTATION








