PHPackages                             virgil/crypto-wrapper - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Security](/categories/security)
4. /
5. virgil/crypto-wrapper

ActiveLibrary[Security](/categories/security)

virgil/crypto-wrapper
=====================

Virgil Security Crypto Wrapper

v1.0.0(1y ago)010.2k1[1 PRs](https://github.com/VirgilSecurity/virgil-cryptowrapper-php/pulls)1BSD-3-ClausePHPPHP ^8.3CI passing

Since Mar 19Pushed 3mo ago9 watchersCompare

[ Source](https://github.com/VirgilSecurity/virgil-cryptowrapper-php)[ Packagist](https://packagist.org/packages/virgil/crypto-wrapper)[ Docs](https://virgilsecurity.com)[ RSS](/packages/virgil-crypto-wrapper/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (7)Dependencies (2)Versions (12)Used By (1)

Virgil Security PHP Crypto Library Wrapper
==========================================

[](#virgil-security-php-crypto-library-wrapper)

[![Build Status](https://github.com/VirgilSecurity/virgil-cryptowrapper-php/actions/workflows/build.yml/badge.svg?branch=master)](https://travis-ci.com/VirgilSecurity/virgil-cryptowrapper-php)[![GitHub license](https://camo.githubusercontent.com/0baecd984aa7fcf0f699960bfd1e3e345ca00164672d9771025a55f2e306cd71/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d425344253230332d2d436c617573652d626c75652e737667)](https://github.com/VirgilSecurity/virgil/blob/master/LICENSE)

[Introduction](#introduction) | [Features](#features) | [Installation](#installation) | [Docs](#docs) | [License](#license) | [Contacts](#support)

Introduction
------------

[](#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](https://github.com/VirgilSecurity/virgil-crypto-c).

Features
--------

[](#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

[](#library-foundation)

This library contains basic cryptographic algorithms and can be used as building blocks for complex solutions.

Algorithm PurposeImplementation detailsKey Generation, PRNGCTR\_DRBG [NIST SP 800-90A](http://nvlpubs.nist.gov/nistpubs/SpecialPublications/NIST.SP.800-90Ar1.pdf)Key Derivation[KDF1, KDF2](https://www.shoup.net/iso/std6.pdf), [HKDF](https://tools.ietf.org/html/rfc5869), [PBKDF2](https://tools.ietf.org/html/rfc8018#section-5.2)Key Exchange[X25519](https://tools.ietf.org/html/rfc7748), [RSA](http://nvlpubs.nist.gov/nistpubs/SpecialPublications/NIST.SP.800-56Br1.pdf)Hashing[SHA-2 (224/256/384/512)](https://tools.ietf.org/html/rfc4634)Message Authentication Code[HMAC](https://www.ietf.org/rfc/rfc2104.txt)Digital Signature[Ed25519](https://tools.ietf.org/html/rfc8032), [RSASSA-PSS](https://tools.ietf.org/html/rfc4056)Entropy SourceLinux, macOS [/dev/urandom](https://tls.mbed.org/module-level-design-rng),
Windows [CryptGenRandom()](https://tls.mbed.org/module-level-design-rng)Symmetric Algorithms[AES-256-GCM](http://nvlpubs.nist.gov/nistpubs/Legacy/SP/nistspecialpublication800-38d.pdf), [AES-256-CBC](https://tools.ietf.org/html/rfc3602)Encryption schemes[PBES2](https://tools.ietf.org/html/rfc8018#section-6.2)Elliptic Curves[Ed25519](https://tools.ietf.org/html/rfc8032), [Curve25519](https://tools.ietf.org/html/rfc7748)### Library: PHE

[](#library-phe)

Cryptographic background for the [Password-Hardened Encryption (PHE) protocol](https://virgilsecurity.com/wp-content/uploads/2018/11/PHE-Whitepaper-2018.pdf) 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

[](#library-pythia)

Implementation of the [Pythia](http://pages.cs.wisc.edu/~ace/papers/pythia-full.pdf) protocol.

Installation
------------

[](#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
----------------------

[](#additional-information)

### Manual adding the crypto extension to your server

[](#manual-adding-the-crypto-extension-to-your-server)

- Execute on your server [virgil-test.php](_extensions/virgil-test.php) file.
- Copy [extensions](_extensions/bin) 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](_extensions/bin) 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

[](#extensions-installation-example)

Our web stack is: *Linux, nginx, php7.2-fpm*

- Execute [virgil-test.php](_extensions/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): [![](_extensions/_help/01.png)](_extensions/_help/01.png)
- 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: [![](_extensions/_help/02.png)](_extensions/_help/02.png)
- Reload the page in your browser to see that the extension is loaded: [![](_extensions/_help/03.png)](_extensions/_help/03.png)

Docs
----

[](#docs)

- [Crypto Core Library](https://github.com/VirgilSecurity/virgil-crypto-c)
- [Developer Documentation](https://developer.virgilsecurity.com/)

License
-------

[](#license)

This library is released under the [3-clause BSD License](LICENSE).

Support
-------

[](#support)

Our developer support team is here to help you.

You can find us on [Twitter](https://twitter.com/VirgilSecurity) or send us email .

Also, get extra help from our support team on [Slack](https://virgilsecurity.com/join-community).

###  Health Score

48

—

FairBetter than 94% of packages

Maintenance60

Regular maintenance activity

Popularity24

Limited adoption so far

Community18

Small or concentrated contributor base

Maturity78

Established project with proven stability

 Bus Factor1

Top contributor holds 57.1% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~236 days

Recently: every ~348 days

Total

8

Last Release

594d ago

Major Versions

v0.17.2 → v1.0.02024-09-30

PHP version history (4 changes)v0.13.0PHP ^7

v0.16.0PHP ^7|^8.0

v0.17.1PHP ^8.2

v0.17.2PHP ^8.3

### Community

Maintainers

![](https://www.gravatar.com/avatar/dbf68f51108fed58c83419750ce2961ab0e9a82577dde77fd387c5b5a0c60e69?d=identicon)[virgil](/maintainers/virgil)

---

Top Contributors

[![PetrenkoAnton](https://avatars.githubusercontent.com/u/24354013?v=4)](https://github.com/PetrenkoAnton "PetrenkoAnton (32 commits)")[![SergeySeroshtan](https://avatars.githubusercontent.com/u/2228157?v=4)](https://github.com/SergeySeroshtan "SergeySeroshtan (21 commits)")[![Qzich](https://avatars.githubusercontent.com/u/3338322?v=4)](https://github.com/Qzich "Qzich (2 commits)")[![MariiaMalitska](https://avatars.githubusercontent.com/u/37335222?v=4)](https://github.com/MariiaMalitska "MariiaMalitska (1 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/virgil-crypto-wrapper/health.svg)

```
[![Health](https://phpackages.com/badges/virgil-crypto-wrapper/health.svg)](https://phpackages.com/packages/virgil-crypto-wrapper)
```

###  Alternatives

[defuse/php-encryption

Secure PHP Encryption Library

3.9k162.4M214](/packages/defuse-php-encryption)[roave/security-advisories

Prevents installation of composer packages with known security vulnerabilities: no API, simply require it

2.9k97.3M6.4k](/packages/roave-security-advisories)[mews/purifier

Laravel 5/6/7/8/9/10 HtmlPurifier Package

2.0k16.7M113](/packages/mews-purifier)[robrichards/xmlseclibs

A PHP library for XML Security

41278.1M118](/packages/robrichards-xmlseclibs)[bjeavons/zxcvbn-php

Realistic password strength estimation PHP library based on Zxcvbn JS

86917.5M63](/packages/bjeavons-zxcvbn-php)[illuminate/encryption

The Illuminate Encryption package.

9229.7M280](/packages/illuminate-encryption)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
