PHP Classes

PHP AES-128-CBC Encryption and Decryption: Encrypt and decrypt data using mcrypt

Recommend this page to a friend!
  Info   View files Example   View files View files (2)   DownloadInstall with Composer Download .zip   Reputation   Support forum (1)   Blog    
Ratings Unique User Downloads Download Rankings
StarStarStarStar 66%Total: 672 This week: 2All time: 4,810 This week: 94Up
Version License PHP version Categories
php-aes-128-cbc 1.0.0BSD License5PHP 5, Cryptography
Description 

Author

This class can encrypt and decrypt data using mcrypt.

It can encrypt data with a given key or generates a random key to encrypt the data using mcrypt. It also encodes the data before encrypting.

The class can also decrypt previously encrypted data with the class.

Picture of Name Removed
  Performance   Level  
Name: Name Removed <contact>
Classes: 4 packages by
Country: ???
Age: ???
All time rank: 2029
Week rank: 109 Up

Example

<?php

/****
****
*** @ PHP AES-128-CBC class
*** @ Developed by Takis Maletsas
****
****/

require "aes.class.php";

$aes = new AES;
$aes->setData("Hello world !");

$encrypted = $aes->encrypt();

//You can use setKey() and setIV() in the encryption process.
//If you don't, the class will produce random key and IV.
//You can get them with getKey() and getIV().

$aes->setKey($aes->getKey());
$aes->setIV($aes->getIV());
$aes->setData($encrypted);

$decrypted = $aes->decrypt();

echo
$encrypted . "<br/>" . $decrypted;

//Encrypted: hibcqPrxD0rv2E5b5/LzYQ==
//Decrypted: Hello world !

?>


  Files folder image Files  
File Role Description
Plain text file aes.class.php Class Source
Accessible without login Plain text file example.php Example Example

 Version Control Unique User Downloads Download Rankings  
 0%
Total:672
This week:2
All time:4,810
This week:94Up
 User Ratings  
 
 All time
Utility:93%StarStarStarStarStar
Consistency:100%StarStarStarStarStarStar
Documentation:-
Examples:100%StarStarStarStarStarStar
Tests:-
Videos:-
Overall:66%StarStarStarStar
Rank:480