PHP Classes

Simple PHP Cipher Encryption: Encrypt and decrypt text by mapping characters

Recommend this page to a friend!
  Info   View files Example   View files View files (4)   DownloadInstall with Composer Download .zip   Reputation   Support forum (1)   Blog    
Ratings Unique User Downloads Download Rankings
StarStarStarStar 72%Total: 180 All time: 8,597 This week: 332Up
Version License PHP version Categories
simple-cipher 1.0GNU General Publi...5PHP 5, Conversion
Description Author

This class can encrypt and decrypt text by mapping characters.

It can take a text string and encrypt it using two text strings that define which characters should be mapped to what other characters depending on the position of the character in the string.

The class can also do the opposite, i.e. take a previously encrypted string and invert the process to recover the original string.

The key strings with the characters to be mapped are configurable.

Picture of Dave Smith
  Performance   Level  
Name: Dave Smith is available for providing paid consulting. Contact Dave Smith .
Classes: 51 packages by
Country: United States United States
Age: 56
All time rank: 679 in United States United States
Week rank: 20 Up2 in United States United States Up
Innovation award
Innovation award
Nominee: 32x

Winner: 7x

Class: simpleCipher
Version: 1.0 11/17/2016

Copyright 2015 Wagon Trader, All Rights Reserved


This class will encrypt and decrypt text using a cipher that determines the replacement character by a mapped character and position in the message.

Since the position is also considered, common words like 'the' will always be different in encrypted message.


simplecipher.class.php - Main class

example.php - Simple application example


Upload files to a web accessible location on your server (eg. public_html)


No configuration needed.

If you use this in production, you will want to generate and save a new map. Simply run the following code in a script.

$cipher = new simpleCipher();
echo $cipher->generateMap(true);

Copy the new map and use it to replace the $cipherMap variable in class.


Refer to example.php file for a simple usage example.

Refer to simplecipher.class.php for available methods and their usage.



Initial release
  Files folder image Files  
File Role Description
Accessible without login Plain text file example.php Example Usage Example
Accessible without login Plain text file license.txt Lic. License
Accessible without login Plain text file manual.txt Doc. Documentation
Plain text file simplecipher.class.php Class Main Class

 Version Control Unique User Downloads Download Rankings  
This week:0
All time:8,597
This week:332Up
User Ratings User Comments (2)
 All time
Great job on custom encryption.
4 years ago (Anthony Amolochitis)
Great job on custom encryption.
4 years ago (Anthony Amolochitis)
For more information send a message to info at phpclasses dot org.