I'm using codeigniter 3 ecryption library with default settings from the codeigniter PHP framework to crypt some simple alphanumeric strings.
Here's a small example on how it works inside a codeigniter helper:
<?php
function shortCrypt($string) {
$CI =& get_instance();
$CI->load->library('encryption');
return $CI->encryption->encrypt($string);
}
The returned crypted string is too long for my purposes and i would like to make it shorter without losing any information. I thought to pass the AES-128 crypted string via md5 to reach a 32 characters lenght but the only problem is i can't obtain the original string back.
Is there a way to "compress" the AES-128 crypted string to obtain a shorter one without losing the original?
Sorry for my bad english.