virgil/crypto-wrapper
Composer 安装命令:
composer require virgil/crypto-wrapper
包简介
Virgil Security Crypto Wrapper
README 文档
README
Introduction | Features | Installation | Docs | License | Contacts
Introduction
This library is designed to be a small, flexible and convenient wrapper for a variety of crypto algorithms. So it can be used in a small microcontroller as well as in a high load server application. Also, it provides a bunch of custom hybrid algorithms that combine different crypto algorithms to solve common complex cryptographic problems in an easy way. That eliminates requirement for developers to have strong cryptographic skills.
Virgil Security PHP Crypto Library Wrapper is a wrapper for Virgil Security Crypto Library.
Features
Virgil Security Crypto library wrapper is decomposed to small libraries with specific purposes, so a developer can freely choose a subset of them.
Library: Foundation
This library contains basic cryptographic algorithms and can be used as building blocks for complex solutions.
| Algorithm Purpose | Implementation details |
|---|---|
| Key Generation, PRNG | CTR_DRBG NIST SP 800-90A |
| Key Derivation | KDF1, KDF2, HKDF, PBKDF2 |
| Key Exchange | X25519, RSA |
| Hashing | SHA-2 (224/256/384/512) |
| Message Authentication Code | HMAC |
| Digital Signature | Ed25519, RSASSA-PSS |
| Entropy Source | Linux, macOS /dev/urandom, Windows CryptGenRandom() |
| Symmetric Algorithms | AES-256-GCM, AES-256-CBC |
| Encryption schemes | PBES2 |
| Elliptic Curves | Ed25519, Curve25519 |
Library: PHE
Cryptographic background for the Password-Hardened Encryption (PHE) protocol that provides developers with a technology to protect users passwords from offline attacks and make stolen passwords useless even if your database has been compromised.
Library: Pythia
Implementation of the Pythia protocol.
Installation
This package is available for PHP versions: 8.2, 8.3.
-
Step #1. Install the crypto wrapper with the following code:
composer require virgil/crypto-wrapper
-
Step #2. Add the crypto extensions into your server with the following code and follow the instructions below:
sh vendor/virgil/crypto-wrapper/_extensions/setup.sh -all -vendor
Additional information
Manual adding the crypto extension to your server
-
Execute on your server virgil-test.php file.
-
Copy extensions files according to your server operating system and PHP version to the extensions directory.
- For Linux/Darwin:
$ path="{PASTE_PATH_TO_EXTENSIONS_DIR_HERE}" $ cp {PASTE_EXTENSION_NAME_HERE} $path- For Windows:
$ set path={PASTE_PATH_TO_EXTENSIONS_DIR_HERE} $ copy {PASTE_EXTENSION_NAME_HERE} %path% -
Copy virgil_crypto.ini file according to your server operating system and PHP version to the PATH_TO_ADDITIONAL_INI_FILES:
- For Linux/Darwin
$ cp virgil_crypto.ini {PASTE_PATH_TO_ADDITIONAL_INI_FILE_HERE}- For Windows:
$ copy virgil_crypto.ini {PASTE_PATH_TO_ADDITIONAL_INI_FILE_HERE} -
Restart your server or php-fpm service
Extensions installation example
Our web stack is: Linux, nginx, php7.2-fpm
-
Execute virgil-test.php to find your path to the extensions directory and the path to the additional ini files (or to the main php.ini file):

-
Then, go to the command line interface (CLI) to specify the paths you've identified in the previous step and restart your server or php-fpm service:

-
Reload the page in your browser to see that the extension is loaded:

Docs
License
This library is released under the 3-clause BSD License.
Support
Our developer support team is here to help you.
You can find us on Twitter or send us email support@VirgilSecurity.com.
Also, get extra help from our support team on Slack.
virgil/crypto-wrapper 适用场景与选型建议
virgil/crypto-wrapper 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 10.86k 次下载、GitHub Stars 达 0, 最近一次更新时间为 2020 年 03 月 19 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 virgil/crypto-wrapper 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 virgil/crypto-wrapper 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 10.86k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 13
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: BSD-3-Clause
- 更新时间: 2020-03-19