neuralpin/passencryption
最新稳定版本:v1.2
Composer 安装命令:
composer require neuralpin/passencryption
包简介
Helper for secure password encrypting and validating
关键字:
README 文档
README
Description:
Helper for secure password encrypting and validating Github Repo
How to use
Example for encrypting a user password using random salt
use Neuralpin\Passencryption\PasswordEncryptor; $user_plain_password = 'original_password'; $user_encrypted_password = new PasswordEncryptor( $user_plain_password ); // The random salt used ready to store in the database $user_encrypted_password->getSalt(); // The encrypted password ready to store in the database $user_encrypted_password->getPassword();
Example for comparing user password with database password
use Neuralpin\Passencryption\PasswordCompare; $user_plain_password = 'original_password'; $stored_salt = '425d3ab03af14574b52269f91a798168d9858286230da78b26ed82f20e2ab807bcee97650d8a575a883e06156956c5a3ba8752632138c4c0c6a05a108ed10e09'; $stored_password = 'a07eb5af110432cd11191afed23be2720f8c4c35f3d715c9cf763937f4a93ef8508fa80e83df049294aeed00cd4a42d853639683e4aa125e4f0332f0a30274b3'; $password_comparing = new PasswordCompare( $user_plain_password, $stored_salt, $stored_password ); if( $password_comparing->isEqual() ){ // Code for logged user ... echo "Logged in successfully"; }else{ // Code for invalid password ... echo "Invalid password, try again"; }
Use the module with composer
composer config repositories.neuralpin/passencryption vcs https://github.com/neuralpin/neuralpin_passencryption composer require neuralpin/passencryption
统计信息
- 总下载量: 5
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: GPL-3.0-only
- 更新时间: 2025-11-05