Download the PHP package krzysztofzylka/hash without Composer
On this page you can find all versions of the php package krzysztofzylka/hash. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Please rate this library. Is it a good library?
Informations about the package hash
VersionedHasher
A modern PHP library for secure password hashing and general-purpose hashing with version support and algorithm migration capabilities.
Features
- Modern Security: Uses Argon2id as the default algorithm (2024 security standard)
- Version Management: Built-in versioning system for seamless algorithm migration
- Multiple Algorithms: Support for 15+ hashing algorithms from secure password hashers to fast checksums
- Backward Compatibility: Seamlessly works with existing PHP
password_hash()outputs - Security Assessment: Built-in tools to evaluate hash strength and recommend upgrades
- Migration Ready: Easy detection of hashes that need security upgrades
Installation
Quick Start
Secure Password Hashing
Custom Algorithm Usage
Supported Algorithms
Password Hashing (Secure)
- argon2id ⭐ (Recommended 2024) - Most secure, resistant to all attacks
- argon2i - Secure alternative to Argon2id
- bcrypt - Widely supported, good security
- scrypt - Memory-hard function
- pbkdf2 - Minimum acceptable security
Cryptographic Hashes
- sha512 / sha256 - Standard cryptographic hashes
- ripemd256 - Alternative cryptographic hash
- snefru / gost - Specialized cryptographic functions
Fast Checksums (Non-secure)
- xxh128 / xxh64 / xxh32 / xxh3 - Ultra-fast checksums
- crc32 / crc32c - Standard checksums
Legacy (Deprecated)
- md5 - Only for compatibility (not secure)
Advanced Usage
Security Assessment
Algorithm Discovery
Custom Configuration
Security Recommendations (2024)
For New Applications
- Use
createSecure()- Automatically uses Argon2id with optimal settings - Regular Assessment - Check
needsRehash()periodically - Monitor Algorithms - Stay updated on algorithm recommendations
For Legacy Applications
- Gradual Migration - Use
needsRehash()to identify upgrade candidates - Backward Compatibility - Library works with existing
password_hash()outputs - User Login Migration - Upgrade hashes during successful logins
Version Format
The library uses a versioned format for all hashes:
Examples:
$014$argon2id$v=19$m=65536,t=4,p=3$...- Argon2id$015$2y$12$abcdef...- bcrypt$002$a665a45920422f9d417e4867efdc4fb8a04a1f3fff1fa07e998e86f7f7a27ae3- SHA256
Performance Guidelines
Password Hashing
- High Security: Argon2id with 128MB+ memory
- Balanced: Default
createSecure()settings (64MB, 4 iterations) - Fast: bcrypt with cost 12
Checksums
- Ultra Fast: xxh64, xxh3
- Standard: crc32, crc32c
- Cryptographic: sha256, sha512
Error Handling
Requirements
- PHP 7.4+
- Hash extension (usually included)
- For Argon2: PHP 7.2+ with password_hash Argon2 support
- For scrypt: libsodium or hash extension with scrypt support
Security Notes
⚠️ Important Security Considerations:
- Never use fast checksums for passwords (xxh*, crc32, md5)
- Upgrade legacy hashes regularly using
needsRehash() - Use secure algorithms for sensitive data
- Monitor algorithm recommendations as security standards evolve
- Test algorithm availability in your environment
License
MIT License - see LICENSE file for details.
Contributing
- Fork the repository
- Create feature branch
- Add tests for new functionality
- Submit pull request
Support
For issues and questions:
- GitHub Issues: [repository-url]
- Documentation: [docs-url]
All versions of hash with dependencies
PHP Build Version
Package Version
Requires
php Version
>=8.3
ext-sodium Version *
ext-sodium Version *
The package krzysztofzylka/hash contains the following files
Loading the files please wait ...