Fork me on GitHub

Library - EnDecrypt

#EnDecrypt

#OverView

This Encrypt/Decrypt class allows you to encode data to encrypted string or decrypted string for security. In order to comunicate between devices such as server, mobile , etc.

#support Ciphers

#Server Requirements

some OS distributions may require you to manually install the PHP MCrypt extension. When using Ubuntu, this can be done via apt-get install php-mcrypt.

#How To Use

PHP code


<?php

use CafeLatte\Libraries\Endecrypt;

$key = "secureKey_whatever_you_want";
$iv = "iv";
$text = "test";
$cipher = "aes-256-cbc";

$encryptedText = Endecrypt::create($key, $iv, $cipher)->encrypt($text);
echo "encrypted Text : ". $encryptedText . "\n";

$decryptedText = Endecrypt::create($key, $iv)->decrypt($encryptedText);
echo "decrypted Text : ".  $decryptedText . "\n";