PHP Classes

PHP Cryptor: Encrypt and decrypt data using mcrypt

Recommend this page to a friend!
     
  Info   Example   View files Files   Install with Composer Install with Composer   Download Download   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
StarStarStar 52%Total: 400 All time: 6,572 This week: 206Up
Version Licenses PHP version Categories
cryptor 1.0Artistic License, B...5.0PHP 5, Cryptography
Description 

Author

This class can encrypt and decrypt data using mcrypt.

It takes a given string of data and encrypts it using an hash of a given encryption key prepended with a class internal key.

The class can also do the opposite, i.e. decrypt previously encrypted data with the class to restore the original data string.

Picture of Nick Daniels
  Performance   Level  
Name: Nick Daniels <contact>
Classes: 13 packages by
Country: United States United States
Age: 34
All time rank: 1107160 in United States United States
Week rank: 16 Up3 in United States United States Up
Innovation award
Innovation award
Nominee: 4x

Winner: 1x

Example

<?php
/**
 * A Custom Cryptor
 * --------------------
 * Devel: Nick Daniels
 * Twttr: @ManicSec
 */

// Do encryption
echo Cryptor::encrypt("test", md5("sec"))."\n";

// Do decryption
echo Cryptor::decrypt("aHJyZiXvSHk=", md5("sec"));


  Files folder image Files (2)  
File Role Description
Plain text file Cryptor.class.php Class Cryptor Class
Accessible without login Plain text file example.php Example The example file

The PHP Classes site has supported package installation using the Composer tool since 2013, as you may verify by reading this instructions page.
Install with Composer Install with Composer
 Version Control Unique User Downloads Download Rankings  
 0%
Total:400
This week:0
All time:6,572
This week:206Up
 User Ratings  
 
 All time
Utility:75%StarStarStarStar
Consistency:70%StarStarStarStar
Documentation:-
Examples:75%StarStarStarStar
Tests:-
Videos:-
Overall:52%StarStarStar
Rank:2454