pentagonal/simple_encrypt

Simple Encryption utility

1.0.0 2017-08-21 14:59 UTC

This package is not auto-updated.

Last update: 2024-04-27 23:01:44 UTC


README

Another Small Encryption Helper

Build Status

Encrypt string or another type of value to encryption. by default encryption use openssl with default AES-256-CBC and another encryption using alternative of str_rot13 and encoded by base64_encode

Encryption

/**
 * Using default encryption mcrypt
 */
Pentagonal\SimpleEncryption\Encryption::encrypt('string to encrypt', 'saltkey');

/**
 * Using alternative type
 */
Pentagonal\SimpleEncryption\Encryption::altEncrypt('string to encrypt', 'saltkey');

Decryption

/**
 * Decrypt encrypted string with auto detect encryption use
 */
Pentagonal\SimpleEncryption\Encryption::decrypt('string to decrypt', 'saltkey');

// or can use
Pentagonal\SimpleEncryption\Encryption::altDecrypt('string to decrypt', 'saltkey');

Install Using Composer

Composer is handy tool for adding library easily from packagist and another resource to your application. Get Install on here : https://getcomposer.org and install on your OS.

{
  "require": {
        "pentagonal/simple_encrypt" : "~1.0"
  }
}

Or directly install via terminal

composer require pentagonal/simple_encrypt

Requirements

This library require php 5.4.0 or later. Suggest to enable openssl on your php configuration.

License

MIT License https://opensource.org/licenses/MIT