News Feed
Sections




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

Smashing Magazine:
Replicating MySQL AES Encryption Methods With PHP
May 30, 2012 @ 08:43:04

On the Smashing Magazine site today there's a new tutorial showing you how to replace your MySQL encryption methods for AES with their PHP equivalent.

At our company, we process a lot of requests on the leading gift cards and coupons websites in the world. The senior developers had a meeting in late October to discuss working on a solution to replicate the MySQL functions of AES_ENCRYPT and AES_DECRYPT in the language of PHP. This article centers on what was produced by senior developer Derek Woods and how to use it in your own applications.

He starts with a little bit of backstory - why to even bother using encryption, what AES encryption is and why you should probably avoid using the MySQL implementation of it in your apps. PHP's mcrypt functions don't return the same hashes as their MySQL counterparts (he includes the "why" of this) and includes some quick code to replicate the MySQL behavior. He also mentions some issues with the transformation, newlines and shows the source for their completed "aes_crypt" and "aes_decrypt" functions.

0 comments voice your opinion now!
mysql aes encryption method tutorial


blog comments powered by Disqus

Similar Posts

SitePoint PHP Blog: Build a Database with Eloquent, Faker and Flysystem

James Fuller: Use @dataProvider to reduce duplication and improve the maintainability of your tests

Padraic Brady's Blog: Example Zend Framework Blog Application Tutorial: Parts 1-8 Revisited

Chad Lung's Blog: Install Lighttpd, PHP and MySQL on Ubuntu 10.10

Alan Knowles' Blog: Getting Started with HTML_FlexyFramework, DataObjects and HTML_Template_Flexy


Community Events





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


version podcast language laravel library voicesoftheelephpant series composer tool release framework package interview application install introduction security community opinion symfony

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