CodeIgniter Forums
CodeIgniter extended Encrypt class to support Advanced encryption algorithms with OpenSSL - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Libraries & Helpers (https://forum.codeigniter.com/forumdisplay.php?fid=22)
+--- Thread: CodeIgniter extended Encrypt class to support Advanced encryption algorithms with OpenSSL (/showthread.php?tid=56346)



CodeIgniter extended Encrypt class to support Advanced encryption algorithms with OpenSSL - El Forum - 12-12-2012

[eluser]digitalhuman[/eluser]
Hi, i extended the CodeIgniter encrypt class to support more encryption algorithms: usage: http://victorangelier.blogspot.se/
The source-code can be downloaded here: http://pastebin.mozilla.org/1989927, but u also find it as attachement. For questions just post them here or notify me on twitter: @digital_human

#UPDATED version 2012-12-13 updated again. There were some minor issues with generating the IV
New source-code: http://pastebin.mozilla.org/1991684

Attachment is old source and i can't update it cause of spam protection or something.
Have fun with it. Cheers


CodeIgniter extended Encrypt class to support Advanced encryption algorithms with OpenSSL - El Forum - 12-13-2012

[eluser]Unknown[/eluser]
I like your class, but there are tow things that could be further improved:

a) let the developer pass the IV to the encryption function so that a different IV can be used for each encrypted string.

b) I've seen that you're using the IV both for the IV and the password. It would be better to let the developer pass the password as input to the function as well.

My $0.02 Smile



CodeIgniter extended Encrypt class to support Advanced encryption algorithms with OpenSSL - El Forum - 12-13-2012

[eluser]digitalhuman[/eluser]
[quote author="tanis" date="1355406243"]I like your class, but there are tow things that could be further improved:

a) let the developer pass the IV to the encryption function so that a different IV can be used for each encrypted string.

b) I've seen that you're using the IV both for the IV and the password. It would be better to let the developer pass the password as input to the function as well.

My $0.02 Smile
[/quote]

a) Hahaha true, well the user can pass his own IV by using $this->encrypt->set_iv("myotheriv"), before using the ecrypt method.

b) Yes i use IV for both password and IV and i need to change that. Thanks for reminding me Smile