Skip to content

00F100/fcphp-crypto

Repository files navigation

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