This document summarizes the std.crypto
module in Zig's standard library, focusing on common cryptographic operations and how to use them. The library provides a wide range of cryptographic primitives and high-level APIs designed for security and ease of use.
- Hashing: Creating fixed-size digests of data (e.g., for integrity checks). See
`crypto.hash`
. - Authentication (MAC): Creating tags to verify data integrity and authenticity using a secret key. See
`crypto.auth`
. - Password Hashing: Securely hashing passwords for storage, designed to be slow and resource-intensive. See
`crypto.pwhash`
. - Encryption (AEAD): Encrypting data while also providing integrity and authenticity verification (Authenticated Encryption with Associated Data). Preferred over raw stream/block ciphers. See
`crypto.aead`
.