Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/piotrbaczek/kohana-encrypt
Encryption module for Kohana 3.3. Uses Encrypt-then-MAC scheme with OPENSSL (AES) and Encrypt-then-Sign (RSA).
https://github.com/piotrbaczek/kohana-encrypt
aes encryption kohana kohana-encrypt mac-scheme openssl rsa
Last synced: about 2 months ago
JSON representation
Encryption module for Kohana 3.3. Uses Encrypt-then-MAC scheme with OPENSSL (AES) and Encrypt-then-Sign (RSA).
- Host: GitHub
- URL: https://github.com/piotrbaczek/kohana-encrypt
- Owner: piotrbaczek
- License: mit
- Created: 2016-03-27T21:22:59.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2017-08-29T12:44:08.000Z (over 7 years ago)
- Last Synced: 2024-11-13T01:24:54.050Z (about 2 months ago)
- Topics: aes, encryption, kohana, kohana-encrypt, mac-scheme, openssl, rsa
- Language: PHP
- Homepage:
- Size: 54.7 KB
- Stars: 0
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# kohana-encrypt
Encryption module for Kohana 3.3. Port of Laravel Encrypt-then-MAC scheme for encrypting using OPENSSL (AES and RSA).
Uses AES-256-CBC and AES-128-CBC, and user public and private keys with RSA.### Installation
```sh
$ cd modules
$ git clone [git-repo-url]
```
Add this line to Kohana::modules in your bootstrap.php:
```sh
'kohana-encrypt' => MODPATH . 'kohana-encrypt'
```
Install phpseclib using composer
```sh
$ composer install
```Include autoload.php in your bootstrap.php
```
/**
* Enable composer autoload libraries
*/
require APPPATH . '../vendor/autoload.php';
```Generate AES and RSA keys for your application
```sh
$ php index.php --uri=task/encyptkeys
```It's also possible to generate config inside common module of your application
For example if your core classes are located in /modules/custommodule/classes,
then config will be generated in /modules/custom/config
```sh
$ php index.php --uri=task/encyptkeys --module=custommodule
```### Usage
* OPENSSL (AES-256-CBC or AES-128-CBC)
```sh
$encrypt = Encrypt::instance();
echo $encrypt->encrypt('This is my secret');
```
* RSA
```sh
$encrypt = Encrypt::instance('secondary');
echo $encrypt->encrypt('This is my secret');
```License
----MIT
**Free Software, Hell Yeah!**