0

Does anyone know of a way to encrypt a string and output it as x number of characters? I need it to always return the same number of characters. I know MD5 always returns it as 32 characters. I'd like for it to return less that that, maybe 20 or 24 (the number has to be divisible by 4). And I'd like to be able to decrypt it. I can't figure out how to do it.

Can anyone give me suggestions?

Thanks!

2
Contributors
2
Replies
3
Views
5 Years
Discussion Span
Last Post by skraps
0

use AES and if its not divisible by 4 pick a character pseudo character to pad the buffer with and then split. and you will end up with more than 24bytes but it is 2 way encryption unlike md5 and sha variants. It always returns a value that is at least divisible by 2.

0

Theres a screenshot of the data that is produced once encrypting AES twice on a project that I was working on but have kinda stopped for the moment and getting ahold of myself Wordpress AES all data stored is divisible by 4 inside the database and is double encrypted at the time. I just need to add in somefunctions to store the data into a variable count the length with strlen and and then use substr to split it up and manipulate it a few more times.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.