CodeIgniter encryption key generator updated

My apologies. I don’t think I’ve looked at it since I posted it back in 2011, but since it’s still the most popular post on this site (and still getting comments), I updated the CodeIgniter encryption key generator. The update was based on feedback from the original post, and I’ll address a few of the comments here.

On 30 July 2012, 123kerala asked if the source code was available. It both was and it wasn’t. The code to generate the key is very simple and is basically Andrew Johnson’s genToken function. The actual code on the CI encryption key generator page is now available as a Gist.

On 20 January 2013, ataub2qf mentioned that the CodeIgniter user guide specifies that a “key should be as random a string as you can concoct, with numbers and uppercase and lowercase letters,” but that my generator included non-alphanumeric characters. This is a good point! The updated CI key generator is now alphanumeric only.

Leave a Reply