steein/cryptopad

This component provides a secure encryption using AES-256-CBC..

1.1 2017-01-22 17:36 UTC

This package is not auto-updated.

Last update: 2024-04-27 18:04:20 UTC


README

This component provides a secure encryption using AES-256-CBC.

Version PHP : >= 7.0

$crypto = new \SteeinCrypt\CryptoPad();

//Test key and global key
$key        = 'rUhidagNflImJ3wB';
$global_key = '%31.1e$i86e$f!8jz';

Standard encryption text

$encrypt = $crypto->encrypt('default text', $key);
echo $encrypt;

Standard decryption text

$decrypt = $crypto->decrypt($encrypt, $key);
echo $decrypt;

Encryption and Decryption of text in base64

$encryptBase64 = $crypto->encryptBase64('base64_encrypt', $key, true);
$crypto->decryptBase64($encryptBase64, $key, true);

Encryption using the global key

$global_crypt = $crypto
    ->setKey($global_key)
    ->encrypt('default_text', $key);
$crypto->decrypt($global_crypt, $key);

Support or Contact