php_nub Posted May 24, 2010 Share Posted May 24, 2010 Hello, Im looking to encrypt any sting no matter how long (well to an extent) so it is only like 16 or so characters long. I was trying to use the crypt function wish a hash... but I found out that you can not decrypt that.... Anyone know of a encryption that is able to be decrypted that will leave a encrypted value around 16 characters? Link to comment https://forums.phpfreaks.com/topic/202707-php-encryption/ Share on other sites More sharing options...
Mchl Posted May 24, 2010 Share Posted May 24, 2010 How long string are we talking here? Link to comment https://forums.phpfreaks.com/topic/202707-php-encryption/#findComment-1062483 Share on other sites More sharing options...
php_nub Posted May 24, 2010 Author Share Posted May 24, 2010 well to be honest it is to mask urls. im trying to make a tinyurl clone... so basically the longest url you can think of. Link to comment https://forums.phpfreaks.com/topic/202707-php-encryption/#findComment-1062489 Share on other sites More sharing options...
Mchl Posted May 24, 2010 Share Posted May 24, 2010 Well... services like tinyurl do not work like you seem to be thinking they do. They store full original url in database, and generate more or less random 'short' url, which is also stored into a database. Then whenever someone tries to access 'short' url, a full url is retrieved from database, and user is redirected there. No compression is used. Link to comment https://forums.phpfreaks.com/topic/202707-php-encryption/#findComment-1062491 Share on other sites More sharing options...
php_nub Posted May 24, 2010 Author Share Posted May 24, 2010 i know. i just wanted to make one like this. i will database it eventually. i figured an encrypted string could be a partial fix. is there an encryption that can do something like this? Link to comment https://forums.phpfreaks.com/topic/202707-php-encryption/#findComment-1062494 Share on other sites More sharing options...
Mchl Posted May 24, 2010 Share Posted May 24, 2010 I don't think so. A url can be hundreds of characters long (think google maps links for example), and I doubt there would be a compression algorithm with such compresion ratio. Link to comment https://forums.phpfreaks.com/topic/202707-php-encryption/#findComment-1062513 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.