00f100 / fcphp-crypto
Crypto content for FcPhp
Installs: 309
Dependents: 2
Suggesters: 0
Security: 0
Stars: 3
Watchers: 1
Forks: 1
Open Issues: 0
Type:package
Requires
- php: >=7.2
- ext-sodium: *
Requires (Dev)
- 00f100/phpdbug: *
- phpunit/phpunit: 6.*
This package is auto-updated.
Last update: 2024-11-18 06:12:56 UTC
README
Package to crypto contents using Sodium PHP Cryptography Extensions
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);