samuelpouzet / crypt
Password crypter
Installs: 21
Dependents: 2
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
pkg:composer/samuelpouzet/crypt
Requires
- php: ^8.0.0
This package is auto-updated.
Last update: 2025-09-28 17:29:36 UTC
README
The goal of this module is to create a simple password encryption and verification system.
This module works with two types of algorithms: Bcrypt (default) and ARGON2I/ARGON2ID.
Bcrypt
The Bcrypt algorithm is a hashing algorithm that is widely used and recommended by the security community to store user passwords in a secure way
Bcrypt truncates Input > 72 bytes
The input string of the bcrypt algorithm is limited to 72 bytes. If you use a string with a length more than this limit, bcrypt will consider only the first 72 bytes.
We use a class SamuelPouzet\Crypt\Crypt
Constructor :
$crypt = new Crypt(iterable $options = [], string $algorithm =PASSWORD_DEFAULT)
options :
Bcrypt : cost (number between 4 and 31)
Argon : memory_cost(number), time_cost (number), threads (number)`
**Encode :
**
$crypt->hash(string $plaintext): string
**Verify**
$crypt->verify(string $password, string $hash): bool