crypto
crypto¶
The crypto utility provides cryptographic functions such as hashing, encryption, and decryption.
It is useful for:
- Hashing data
- Generating secure values
- Working with cryptographic algorithms
Availability¶
The crypto utility is available by default.
You can use it in two ways:
-
Directly: crypto.xxx
-
Through modules: modules.crypto.xxx
Both forms work the same.
Creating a SHA256 Hash¶
The same example using modules:
Example Output¶
Notes¶
- Cryptographic operations are synchronous
- Output format depends on the digest method used
- Use strong algorithms like
sha256or higher