cryptox - Cryptographic Functions
Overview
The cryptox module provides cryptographic functions including hashing, encryption, and secure random number generation.
Hash Functions
Md5()
Calculate MD5 hash.
Parameters:
s- String or bytes to hash
Returns:
- MD5 hash as hexadecimal string
Example:
Warning: MD5 is not cryptographically secure. Use for non-security purposes only.
SHA1()
Calculate SHA1 hash.
Parameters:
s- String or bytes to hash
Returns:
- SHA1 hash as hexadecimal string
Example:
Warning: SHA1 is considered weak. Use SHA256 or higher for security.
Sha224()
Calculate SHA-224 hash.
Parameters:
s- String or bytes to hash
Returns:
- SHA-224 hash as hexadecimal string
Example:
Sha256()
Calculate SHA-256 hash.
Parameters:
s- String or bytes to hash
Returns:
- SHA-256 hash as hexadecimal string
Example:
Sha384()
Calculate SHA-384 hash.
Parameters:
s- String or bytes to hash
Returns:
- SHA-384 hash as hexadecimal string
Example:
Sha512()
Calculate SHA-512 hash.
Parameters:
s- String or bytes to hash
Returns:
- SHA-512 hash as hexadecimal string
Example:
Sha512_224()
Calculate SHA-512/224 hash.
Parameters:
s- String or bytes to hash
Returns:
- SHA-512/224 hash as hexadecimal string
Example:
Sha512_256()
Calculate SHA-512/256 hash.
Parameters:
s- String or bytes to hash
Returns:
- SHA-512/256 hash as hexadecimal string
Example:
Usage Patterns
Password Hashing
File Integrity
Data Fingerprinting
Cache Keys
Best Practices
Hash Selection
Performance Considerations
Related Documentation
- pgp - PGP operations
- API Documentation
- Module Overview