CodeIgniter Forums
AES Encryption without Mcrypt library - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Development (https://forum.codeigniter.com/forumdisplay.php?fid=6)
+--- Forum: CodeIgniter 2.x (https://forum.codeigniter.com/forumdisplay.php?fid=18)
+--- Thread: AES Encryption without Mcrypt library (/showthread.php?tid=53)



AES Encryption without Mcrypt library - array81 - 10-30-2014

Is there a free and pure PHP library for AES Encryption?

Thanks


RE: AES Encryption without Mcrypt library - Hobbes - 10-30-2014

i have not tried this library but you could giver a go:

phpCrypt: https://github.com/gilfether/phpcrypt

Description from the github page:

phpCrypt is an encryption library written in PHP from scratch. It aims to implement all major encryption ciphers, modes, and other tools used for encryption and decryption. phpCrypt does not rely on mCrypt, other PHP extentions, or PEAR libraries


RE: AES Encryption without Mcrypt library - ivantcholakov - 10-30-2014

https://github.com/ivantcholakov/gibberish-aes-php

This class tries ti use openssl_*() functions at first place, if they don't exist then uses mcrypt. If you want not to depend on mcrypt, your PHP version should be minimum 5.3.3.

See also this CodeIgniter compatible wrapper library:
https://github.com/ivantcholakov/starter-public-edition-3/blob/master/platform/application/libraries/Gibberish.php


RE: AES Encryption without Mcrypt library - Narf - 10-31-2014

(10-30-2014, 08:21 PM)ivantcholakov Wrote: https://github.com/ivantcholakov/gibberish-aes-php

This class tries ti use openssl_*() functions at first place, if they don't exist then uses mcrypt. If you want not to depend on mcrypt, your PHP version should be minimum 5.3.3.

See also this CodeIgniter compatible wrapper library:
https://github.com/ivantcholakov/starter-public-edition-3/blob/master/platform/application/libraries/Gibberish.php

Well, at least the name is approprate. Big Grin

Seriously though, just upgrade to CI 3.0-dev, the new Encryption library in it can work without Mcrypt.


RE: AES Encryption without Mcrypt library - ivantcholakov - 10-31-2014

The Encryption library is like a Swiss knife and it needs some boilerplate code for achieving the desired encryption algorithm. This may be not convenient for all, there are details to be understood. I also think, its default algorithm choice could be AES 256 CBC for good.

What I did is a compatible implementation in PHP from a JavaScript project called "Gibberish AES" https://github.com/mdp/gibberish-aes This is where this funny name comes from, but the work is serious.


RE: AES Encryption without Mcrypt library - Narf - 11-01-2014

(10-31-2014, 06:22 PM)ivantcholakov Wrote: The Encryption library is like a Swiss knife and it needs some boilerplate code for achieving the desired encryption algorithm. This may be not convenient for all, there are details to be understood. I also think, its default algorithm choice could be AES 256 CBC for good.

It uses AES-128-CBC by default and you don't need any boilerplate code to use that.

(10-31-2014, 06:22 PM)ivantcholakov Wrote: What I did is a compatible implementation in PHP from a JavaScript project called "Gibberish AES" https://github.com/mdp/gibberish-aes This is where this funny name comes from, but the work is serious.

Yes, I saw that it's just a port of another library ... and "gibberish" is very appropriate for that library. It doesn't do a lot of things right if at all.