|
Helping ordinary people create extraordinary websites! |
A Reversible Encryption Routine for PHPBy Tony Marston2005-04-15
A Reversible Encryption Routine for PHP Intended Audience This tutorial is intended for those PHP developers who want a password encryption routine that is reversible - i.e. the encrypted password can be decrypted back into plain text. The reason for wanting such a routine could be that your web hosting service does not include an acceptable encryption module in his PHP build, or perhaps you want a routine that allows a certain amount of customisation that makes it totally different from the encryption routines used by others. Prerequisites A working PHP development environment. Expert knowledge of PHP is not required, although an understanding of classes and OOP (Object Oriented Programming) would be useful. Encryption Methods Many different methods of encryption have been used over the years, some are simple and can be broken easily while others are more complex and therefore more difficult to break. Tutorial Pages: » A Reversible Encryption Routine for PHP » Rotating each character a fixed number of positions » Swapping between two different character strings » Manipulating the index number between the two strings » Customising the Encryption Algorithm » Class Variables » Class Constructor » The ConvertKey function » The ApplyFudgeFactor function » The CheckRange Function » The Decrypt function » Using the Encryption Class » Summary |
|