Package to crypto contents using Sodium PHP Cryptography Extensions
Composer:
$ composer require 00f100/fcphp-crypto
or add in composer.json
{
"require": {
"00f100/fcphp-crypto": "*"
}
}
<?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);