Closed ghost closed 6 years ago
I have a different (nicer) idea to solve this, will get back on this tomorrow :-)
Sweet! How's it going with the idea? :)
Nice one AJ 👌🏼
You can now optionally choose a cypher in the constructor, eg:
<?php
$crypter = new Crypter('mykeystring', 'AES-256-ECB');
Really nice!
Hi!
As it is right now, the class will only encrypt in 128-bit AES. In order to change it to 256-bit, you must change
AES-128-ECB
on the rows 39, 45, and 65 toAES-256-ECB
. When the class is being updated, you must change it manually once more.To prevent this, add a extra variable to the class, like this:
Then use
$crypter->decrypt($string, '256');
to encrypt the string with 256-bit AES.I have no idea if this will work, but you get the idea. So, please add this!