Skip to content

Latest commit

 

History

History
44 lines (30 loc) · 1.22 KB

README.md

File metadata and controls

44 lines (30 loc) · 1.22 KB

FcPhp Crypto

Package to crypto contents using Sodium PHP Cryptography Extensions

Build Status codecov

PHP Version Packagist Version Total Downloads

How to install

Composer:

$ composer require 00f100/fcphp-crypto

or add in composer.json

{
    "require": {
        "00f100/fcphp-crypto": "*"
    }
}

How to use

<?php

use FcPhp\Crypto\Crypto;

// Configure crypto
$nonce = Crypto::getNonce();
$cryto = new Crypto($nonce);
$key = $cryto->generateKey();


// Example
$var = ['index' => 'value'];
$encode = $crypto->encode($key, $var);
$decode = $crypto->decode($key, $encode);