2017 © Pedro Peláez
 

standalone crypto

Virgil is a stack of security libraries (ECIES with Crypto Agility wrapped in Virgil Cryptogram) and all the necessary infrastructure to enable seamless, end-to-end encryption for any application, platform or device. See below for currently available languages and platforms. Get in touch with us to get preview access to our key infrastructure.

image

virgil/crypto

Virgil is a stack of security libraries (ECIES with Crypto Agility wrapped in Virgil Cryptogram) and all the necessary infrastructure to enable seamless, end-to-end encryption for any application, platform or device. See below for currently available languages and platforms. Get in touch with us to get preview access to our key infrastructure.

  • Monday, May 14, 2018
  • by virgil
  • Repository
  • 26 Watchers
  • 18 Stars
  • 874 Installations
  • PHP
  • 2 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 15 Versions
  • 3 % Grown

The README.md

Virgil Crypto Library PHP

Build Status GitHub license Latest Version on Packagist Total Downloads, (*1)

Introduction | Library purposes | Installation | Usage examples | Docs | License | Support, (*2)

Introduction

Virgil Crypto Library PHP is a stack of security libraries (ECIES with Crypto Agility wrapped in Virgil Cryptogram) and an open-source high-level cryptographic library that allows you to perform all necessary operations for securely storing and transferring data in your digital solutions. Crypto Library is written in C++ and is suitable for mobile and server platforms., (*3)

Library purposes

  • Asymmetric Key Generation
  • Encryption/Decryption of data and streams
  • Generation/Verification of digital signatures
  • Double Ratchet algorithm support
  • Post-quantum algorithms support: Round5 (encryption) and Falcon (signature)
  • Crypto for using Virgil Core SDK

Installation

Requirements:, (*4)

  • PHP 8.2, 8.3

Installation via composer

composer require virgil/crypto

Usage examples

Generate a key pair

Generate a key pair using the default algorithm (EC_X25519):, (*5)

$crypto = new VirgilCrypto();
$keyPair = $crypto->generateKeyPair();

Generate and verify a signature

Generate signature and sign data with a private key:, (*6)

$crypto = new VirgilCrypto();
$senderKeyPair = $crypto->generateKeyPair();

// prepare a message
$messageToSign = "Hello, Bob!";

// generate a signature
$signature = $crypto->generateSignature($messageToSign, $senderKeyPair->getPrivateKey());

Verify a signature with a public key:, (*7)

$crypto = new VirgilCrypto();

$senderKeyPair = $crypto->generateKeyPair();

// prepare a message
$messageToSign = "Hello, Bob!";

// generate a signature
$signature = $crypto->generateSignature($messageToSign, $senderKeyPair->getPrivateKey());

// verify a signature
$verified = $crypto->verifySignature($signature, $messageToSign, $senderKeyPair->getPublicKey());

Encrypt and decrypt data

Encrypt data with a public key:, (*8)

$crypto = new VirgilCrypto();
$receiverKeyPair = $crypto->generateKeyPair();

// prepare a message
$messageToEncrypt = "Hello, Bob!";

// encrypt the message
$encryptedData = $crypto->encrypt($messageToEncrypt, new VirgilPublicKeyCollection($receiverKeyPair->getPublicKey()));

Decrypt the encrypted data with a private key:, (*9)

$crypto = new VirgilCrypto();
$receiverKeyPair = $crypto->generateKeyPair();

// prepare a message
$messageToEncrypt = "Hello, Bob!";

// encrypt the message
$encryptedData = $crypto->encrypt($messageToEncrypt, new VirgilPublicKeyCollection($receiverKeyPair->getPublicKey()));

// prepare data to be decrypted and decrypt the encrypted data using a private key
$decryptedData = $crypto->decrypt($encryptedData, $receiverKeyPair->getPrivateKey());

Import and export keys

Export keys:, (*10)

use Virgil\CryptoImpl\VirgilCrypto;

$crypto = new VirgilCrypto();
$keyPair = $crypto->generateKeys();

// export private key
$privateKeyData = $crypto->exportPrivateKey($keyPair->getPrivateKey(), "YOUR_PASSWORD");
$privateKeyStr = base64_encode($privateKeyData);

// export public key
$publicKeyData = $crypto->exportPublicKey($keyPair->getPrivateKey());
$publicKeyStr = base64_encode($publicKeyData);

Import keys:, (*11)

use Virgil\CryptoImpl\VirgilCrypto;

$crypto = new VirgilCrypto();
$privateKeyStr = "MIGhMF0GCSqGSIb3DQEFDTBQMC8GCSqGSIb3DQEFDDAiBBBtfBoM7VfmWPlvyHuGWvMSAgIZ6zAKBggqhkiG9w0CCjAdBglghkgBZQMEASoEECwaKJKWFNn3OMVoUXEcmqcEQMZ+WWkmPqzwzJXGFrgS/+bEbr2DvreVgEUiLKrggmXL9ZKugPKG0VhNY0omnCNXDzkXi5dCFp25RLqbbSYsCyw=";

$privateKeyData = base64_decode($privateKeyStr);

// import a Private key
$privateKey = $crypto->importPrivateKey($privateKeyData, "YOUR_PASSWORD");

//-----------------------------------------------------

$publicKeyStr = "MCowBQYDK2VwAyEA9IVUzsQENtRVzhzraTiEZZy7YLq5LDQOXGQG/q0t0kE=";

$publicKeyData = base64_decode($publicKeyStr);

// import a Public key
$publicKey = $crypto->importPublicKey($publicKeyData);

Additional information

Docs

License

This library is released under the 3-clause BSD License., (*12)

Support

Our developer support team is here to help you. Find out more information on our Help Center., (*13)

You can find us on Twitter or send us email support@VirgilSecurity.com., (*14)

Also, get extra help from our support team on Slack., (*15)

The Versions

14/05 2018

dev-master

9999999-dev http://virgilsecurity.com

Virgil is a stack of security libraries (ECIES with Crypto Agility wrapped in Virgil Cryptogram) and all the necessary infrastructure to enable seamless, end-to-end encryption for any application, platform or device. See below for currently available languages and platforms. Get in touch with us to get preview access to our key infrastructure.

  Sources   Download

BSD BSD-3-Clause

The Requires

 

The Development Requires

authentication security platform encryption cryptography verification elliptic decryption cross passwordless end-to-end virgil ecies virgil.keys virgil.pass perfect forward secrecy pfs

14/05 2018

v5.x-dev

5.9999999.9999999.9999999-dev http://virgilsecurity.com

Virgil is a stack of security libraries (ECIES with Crypto Agility wrapped in Virgil Cryptogram) and all the necessary infrastructure to enable seamless, end-to-end encryption for any application, platform or device. See below for currently available languages and platforms. Get in touch with us to get preview access to our key infrastructure.

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

authentication security platform encryption cryptography verification elliptic decryption cross passwordless end-to-end virgil ecies virgil.keys virgil.pass perfect forward secrecy pfs

14/05 2018

v5.0.0

5.0.0.0 http://virgilsecurity.com

Virgil is a stack of security libraries (ECIES with Crypto Agility wrapped in Virgil Cryptogram) and all the necessary infrastructure to enable seamless, end-to-end encryption for any application, platform or device. See below for currently available languages and platforms. Get in touch with us to get preview access to our key infrastructure.

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

authentication security platform encryption cryptography verification elliptic decryption cross passwordless end-to-end virgil ecies virgil.keys virgil.pass perfect forward secrecy pfs

09/05 2018

v4.x-dev

4.9999999.9999999.9999999-dev http://virgilsecurity.com

Virgil is a stack of security libraries (ECIES with Crypto Agility wrapped in Virgil Cryptogram) and all the necessary infrastructure to enable seamless, end-to-end encryption for any application, platform or device. See below for currently available languages and platforms. Get in touch with us to get preview access to our key infrastructure.

  Sources   Download

BSD-3-Clause

The Requires

  • php >=5.6
  • ext-virgil_crypto_php *

 

authentication security platform encryption cryptography verification elliptic decryption cross passwordless end-to-end virgil ecies virgil.keys virgil.pass perfect forward secrecy pfs

09/05 2018

v4.0.0

4.0.0.0 http://virgilsecurity.com

Virgil is a stack of security libraries (ECIES with Crypto Agility wrapped in Virgil Cryptogram) and all the necessary infrastructure to enable seamless, end-to-end encryption for any application, platform or device. See below for currently available languages and platforms. Get in touch with us to get preview access to our key infrastructure.

  Sources   Download

BSD-3-Clause

The Requires

  • php >=5.6
  • ext-virgil_crypto_php *

 

authentication security platform encryption cryptography verification elliptic decryption cross passwordless end-to-end virgil ecies virgil.keys virgil.pass perfect forward secrecy pfs

01/02 2018

dev-development

dev-development http://virgilsecurity.com

Virgil is a stack of security libraries (ECIES with Crypto Agility wrapped in Virgil Cryptogram) and all the necessary infrastructure to enable seamless, end-to-end encryption for any application, platform or device. See below for currently available languages and platforms. Get in touch with us to get preview access to our key infrastructure.

  Sources   Download

BSD BSD-3-Clause

The Requires

  • php >=5.6
  • ext-virgil_crypto_php 2.2.*

 

authentication security platform encryption cryptography verification elliptic decryption cross passwordless end-to-end virgil ecies virgil.keys virgil.pass perfect forward secrecy pfs

25/07 2017

2.2.2

2.2.2.0 http://virgilsecurity.com

Virgil is a stack of security libraries (ECIES with Crypto Agility wrapped in Virgil Cryptogram) and all the necessary infrastructure to enable seamless, end-to-end encryption for any application, platform or device. See below for currently available languages and platforms. Get in touch with us to get preview access to our key infrastructure.

  Sources   Download

BSD

The Requires

  • php >=5.6
  • ext-virgil_crypto_php 2.2.*

 

authentication security platform encryption cryptography verification elliptic decryption cross passwordless end-to-end virgil ecies virgil.keys virgil.pass perfect forward secrecy pfs

12/01 2017

2.0.4

2.0.4.0 http://virgilsecurity.com

Virgil is a stack of security libraries (ECIES with Crypto Agility wrapped in Virgil Cryptogram) and all the necessary infrastructure to enable seamless, end-to-end encryption for any application, platform or device. See below for currently available languages and platforms. Get in touch with us to get preview access to our key infrastructure.

  Sources   Download

BSD

The Requires

  • php >=5.3
  • ext-virgil_crypto_php 2.0.*

 

authentication security platform encryption cryptography verification elliptic decryption cross passwordless end-to-end virgil ecies virgil.keys virgil.pass

10/10 2016

2.0.0

2.0.0.0 http://virgilsecurity.com

Virgil is a stack of security libraries (ECIES with Crypto Agility wrapped in Virgil Cryptogram) and all the necessary infrastructure to enable seamless, end-to-end encryption for any application, platform or device. See below for currently available languages and platforms. Get in touch with us to get preview access to our key infrastructure.

  Sources   Download

BSD

The Requires

  • php >=5.3
  • ext-virgil_crypto_php 2.0.*

 

authentication security platform encryption cryptography verification elliptic decryption cross passwordless end-to-end virgil ecies virgil.keys virgil.pass

06/04 2016

1.4.0

1.4.0.0 http://virgilsecurity.com

Virgil is a stack of security libraries (ECIES with Crypto Agility wrapped in Virgil Cryptogram) and all the necessary infrastructure to enable seamless, end-to-end encryption for any application, platform or device. See below for currently available languages and platforms. Get in touch with us to get preview access to our key infrastructure.

  Sources   Download

BSD

The Requires

  • php >=5.3
  • ext-virgil_crypto_php 1.4.*

 

authentication security platform encryption cryptography verification elliptic decryption cross passwordless end-to-end virgil ecies virgil.keys virgil.pass

28/03 2016

1.3.4

1.3.4.0 http://virgilsecurity.com

Virgil is a stack of security libraries (ECIES with Crypto Agility wrapped in Virgil Cryptogram) and all the necessary infrastructure to enable seamless, end-to-end encryption for any application, platform or device. See below for currently available languages and platforms. Get in touch with us to get preview access to our key infrastructure.

  Sources   Download

BSD

The Requires

  • php >=5.3
  • ext-virgil_crypto_php 1.3.*

 

authentication security platform encryption cryptography verification elliptic decryption cross passwordless end-to-end virgil ecies virgil.keys virgil.pass

28/03 2016

1.3.3

1.3.3.0 http://virgilsecurity.com

Virgil is a stack of security libraries (ECIES with Crypto Agility wrapped in Virgil Cryptogram) and all the necessary infrastructure to enable seamless, end-to-end encryption for any application, platform or device. See below for currently available languages and platforms. Get in touch with us to get preview access to our key infrastructure.

  Sources   Download

BSD

The Requires

  • php >=5.3
  • ext-virgil_crypto_php 1.3.1

 

authentication security platform encryption cryptography verification elliptic decryption cross passwordless end-to-end virgil ecies virgil.keys virgil.pass

16/03 2016

1.3.1

1.3.1.0 http://virgilsecurity.com

Virgil is a stack of security libraries (ECIES with Crypto Agility wrapped in Virgil Cryptogram) and all the necessary infrastructure to enable seamless, end-to-end encryption for any application, platform or device. See below for currently available languages and platforms. Get in touch with us to get preview access to our key infrastructure.

  Sources   Download

BSD

The Requires

  • php >=5.3
  • ext-virgil_crypto_php 1.3.1

 

authentication security platform encryption cryptography verification elliptic decryption cross passwordless end-to-end virgil ecies virgil.keys virgil.pass

14/01 2016

1.2.0

1.2.0.0 http://virgilsecurity.com

Virgil is a stack of security libraries (ECIES with Crypto Agility wrapped in Virgil Cryptogram) and all the necessary infrastructure to enable seamless, end-to-end encryption for any application, platform or device. See below for currently available languages and platforms. Get in touch with us to get preview access to our key infrastructure.

  Sources   Download

BSD

The Requires

  • php >=5.3
  • ext-virgil_crypto_php 1.2.0

 

authentication security platform encryption cryptography verification elliptic decryption cross passwordless end-to-end virgil ecies virgil.keys virgil.pass

01/09 2015

1.0.1

1.0.1.0 http://virgilsecurity.com

Virgil is a stack of security libraries (ECIES with Crypto Agility wrapped in Virgil Cryptogram) and all the necessary infrastructure to enable seamless, end-to-end encryption for any application, platform or device. See below for currently available languages and platforms. Get in touch with us to get preview access to our key infrastructure.

  Sources   Download

BSD

The Requires

  • php >=5.3
  • ext-virgil_php 1.0.1

 

authentication security platform encryption cryptography verification elliptic decryption cross passwordless end-to-end virgil ecies virgil.keys virgil.pass