Skip to content

Provides a variety of cryptographic traits and classes to PHP

License

Notifications You must be signed in to change notification settings

shgysk8zer0/phpcrypt

Repository files navigation

PHPCrypt

Join the chat at https://gitter.im/shgysk8zer0/phpcrypt Build Status

Provides easy to use classes and traits for cryptographic functions using openssl_*. Intended to be compatible with JSCrypt & SubtleCrypto / JWK

Requires:

Installation:

Provided classes:

Provided traits:

Provided interfaces:

Example code:

<?php
set_include_path('/path/to/classes_dir/' . PATH_SEPARATOR . get_include_path());
spl_autoload_register('spl_autoload');

$keys = new \shgysk8zer0\PHPCrypt\KeyPair(PUBLIC_KEY, PRIVATE_KEY, PASSWORD);

$encrypted = $keys->encrypt(MESSAGE);
$decrypted = $keys->decrypt($encrypted);
$sig       = $keys->sign($encrypted);
$valid     = $keys->verify($encrypted, $sig);
$matches   = MESSAGE === $decrypted;

Releases

No releases published

Packages

No packages published

Languages