1- # Virgil Crypto Library PHP
1+ # Virgil Crypto Library PHP
22
3- [ ![ Build Status] ( https://api.travis-ci. com/VirgilSecurity/virgil-crypto-php. svg?branch=master )] ( https://travis-ci.com/VirgilSecurity/virgil-crypto-php/ )
3+ [ ![ Build Status] ( https://github. com/VirgilSecurity/virgil-crypto-php/actions/workflows/build.yml/badge. svg?branch=master )] ( https://travis-ci.com/VirgilSecurity/virgil-crypto-php )
44[ ![ GitHub license] ( https://img.shields.io/badge/license-BSD%203--Clause-blue.svg )] ( https://github.com/VirgilSecurity/virgil/blob/master/LICENSE )
55[ ![ Latest Version on Packagist] ( https://img.shields.io/packagist/v/virgil/crypto.svg?style=flat-square )] ( https://packagist.org/packages/virgil/crypto )
66[ ![ Total Downloads] ( https://img.shields.io/packagist/dt/virgil/crypto.svg?style=flat-square )] ( https://packagist.org/packages/virgil/crypto )
@@ -13,17 +13,18 @@ Virgil Crypto Library PHP is a stack of security libraries (ECIES with Crypto Ag
1313
1414## Library purposes
1515
16- * Asymmetric Key Generation
17- * Encryption/Decryption of data and streams
18- * Generation/Verification of digital signatures
19- * Double Ratchet algorithm support
20- * ** Post-quantum algorithms support** : [ Round5] ( https://round5.org/ ) (encryption) and [ Falcon] ( https://falcon-sign.info/ ) (signature)
21- * Crypto for using [ Virgil Core SDK] ( https://github.com/VirgilSecurity/virgil-sdk-php )
16+ - Asymmetric Key Generation
17+ - Encryption/Decryption of data and streams
18+ - Generation/Verification of digital signatures
19+ - Double Ratchet algorithm support
20+ - ** Post-quantum algorithms support** : [ Round5] ( https://round5.org/ ) (encryption) and [ Falcon] ( https://falcon-sign.info/ ) (signature)
21+ - Crypto for using [ Virgil Core SDK] ( https://github.com/VirgilSecurity/virgil-sdk-php )
2222
2323## Installation
2424
2525** Requirements** :
26- - PHP 7.3 / 7.4 / 8.0
26+
27+ - PHP 8.2, 8.3
2728
2829#### Installation via composer
2930
@@ -36,6 +37,7 @@ composer require virgil/crypto
3637### Generate a key pair
3738
3839Generate a key pair using the default algorithm (EC_X25519):
40+
3941``` php
4042$crypto = new VirgilCrypto();
4143$keyPair = $crypto->generateKeyPair();
@@ -44,6 +46,7 @@ $keyPair = $crypto->generateKeyPair();
4446### Generate and verify a signature
4547
4648Generate signature and sign data with a private key:
49+
4750``` php
4851$crypto = new VirgilCrypto();
4952$senderKeyPair = $crypto->generateKeyPair();
@@ -56,20 +59,22 @@ $signature = $crypto->generateSignature($messageToSign, $senderKeyPair->getPriva
5659```
5760
5861Verify a signature with a public key:
62+
5963``` php
6064$crypto = new VirgilCrypto();
61-
62- $senderKeyPair = $crypto->generateKeyPair();
63-
65+
66+ $senderKeyPair = $crypto->generateKeyPair();
67+
6468// prepare a message
6569$messageToSign = "Hello, Bob!";
6670
6771// generate a signature
6872$signature = $crypto->generateSignature($messageToSign, $senderKeyPair->getPrivateKey());
69-
73+
7074// verify a signature
7175$verified = $crypto->verifySignature($signature, $messageToSign, $senderKeyPair->getPublicKey());
7276```
77+
7378### Encrypt and decrypt data
7479
7580Encrypt data with a public key:
@@ -84,6 +89,7 @@ $messageToEncrypt = "Hello, Bob!";
8489// encrypt the message
8590$encryptedData = $crypto->encrypt($messageToEncrypt, new VirgilPublicKeyCollection($receiverKeyPair->getPublicKey()));
8691```
92+
8793Decrypt the encrypted data with a private key:
8894
8995``` php
@@ -156,6 +162,7 @@ $publicKey = $crypto->importPublicKey($publicKeyData);
156162This library is released under the [ 3-clause BSD License] ( LICENSE ) .
157163
158164## Support
165+
159166Our developer support team is here to help you. Find out more information on our [ Help Center] ( https://help.virgilsecurity.com/ ) .
160167
161168You can find us on [ Twitter] ( https://twitter.com/VirgilSecurity ) or send us email support@VirgilSecurity.com .
0 commit comments