Skip to content

This library helps you generate RSA cert and encrypt or decrypt simply.

License

Notifications You must be signed in to change notification settings

salliyme/security

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Security

By [salliyme]

This library helps you generate RSA cert and encrypt and decrypt simply.

Installation

Use Composer to install the library.

$ composer require salliyme/security

Basic usage

use salliyme\security\Encrypt;

$instance = new Encrypt();
$instance->generateKey();
$instance->init();
$plainData = "This is a test Encrypt Encrypt and Decrypt Methods.";
$enc = $instance->private_encrypt($plainData);
$dec = $instance->public_decrypt($enc);
echo "Text:", $dec, PHP_EOL;
$plainText = "This data to test Encrypt public Encrypt and private Decrypt.";
$enc1 = $instance->public_encrypt($plainText);
$dec1 = $instance->private_decrypt($enc1);
echo "Text2:", $dec1, PHP_EOL;

License

This bundle is under the MIT license. For the full copyright and license information please view the LICENSE file that was distributed with this source code.

About

This library helps you generate RSA cert and encrypt or decrypt simply.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages