/fcphp-crypto

Package to crypto contents using Sodium Lib

Primary LanguagePHPMIT LicenseMIT

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);