News Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

NETTUTS.com:
Creating a Crypter Class with PHP
September 28, 2009 @ 07:51:19

On the NETTUTS.com site there's a new tutorial posted looking at creating a "crypter" class in PHP - a handy class to make encryption and decryption of data simpler.

Think about what we might need a class like this for? We want to encrypt important data with a password for security reasons. We also want, as already mentioned, to be able to decrypt that data when necessary. Why should you use symmetric algorithms? It's easy; when you're offering a password sent via email or something like that, you need the password to be sent in plaintext. The hash algorithms are not reversible. Once you have hashed a string you can't decipher the original text from the hash.

He lays out his basic class with three methods - the constructor that sets up the key and algorithm and the encrypt and decrypt functions. These use to mcrypt functions to handle the heavy lifting.

0 comments voice your opinion now!
encrypt decrypt tutorial


blog comments powered by Disqus

Similar Posts

SitePoint PHP Blog: IronMQ and Laravel: Delays and Retries

Script-Tutorials.com: Functional Programming - How to Write Functional Code in PHP

NetTuts.com: Working With Controllers in Symfony 2

Codewalkers.com: New Tutorial - Coding \"Best Practices\" - or at least \"Better Practices\"

Eran Galperin's Blog: Profiling queries with Zend_Db and optimizing them by hand


Community Events

Don't see your event here?
Let us know!


laravel library language interview example podcast opinion conference configure framework series release php7 community introduction voicesoftheelephpant symfony2 performance api application

All content copyright, 2015 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework