Giter Site home page Giter Site logo

shgysk8zer0 / phpcrypt Goto Github PK

View Code? Open in Web Editor NEW
1.0 4.0 3.0 59 KB

Provides a variety of cryptographic traits and classes to PHP

License: GNU General Public License v3.0

PHP 100.00%
php php-7 spl-autoload cryptography aes rsa traits aes256 jscrypt phpcrypt

phpcrypt's Introduction

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;

phpcrypt's People

Contributors

gitter-badger avatar shgysk8zer0 avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar

phpcrypt's Issues

Composer?

Even though this uses spl_autolaod, can I make it compatible with Composer? Which PSR?

Add CLI support

Add ability to sign, verify, encrypt, decrypt, and generate key pair via command line.

Add hashing traits & interfaces

Add trait and interface for hashing strings and files.

Should be similar to JScrypt Hash in that it provides the same static methods.

File hashing should be similar as well, except with method names implying that they work on files.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.