Page 1 of 1

some ASCII to String Encryption

Posted: Wed Feb 08, 2006 7:38 pm
by zm50
I have been given a file that is simply encrypted that I need to decode. I have permission to decode this file. I am trying to do this decoding on a server with PHP. Basically the decode algorithim would function something like this: each 3 digit ascii code in the file takes the last of the 3 digit ascii codes, add that value to the code, and then converts the result to an a character. Has anyone seen this done, have code to do this already, or know of any good resources?

Thanks

Posted: Wed Feb 08, 2006 7:54 pm
by raghavan20
if you know the logic properly,,,then you can come up with pseudo code and we will help you to convert it into PHP code...

Posted: Wed Feb 08, 2006 11:42 pm
by josh
Looks like you will need chr() and ord()

Posted: Sat Feb 11, 2006 8:11 pm
by zm50
Hey guys - thanks for your comments; i used the chr() and ord() functions. I am still working on the manipulation the actual values - but have a script now i wrote that can do what i need. thanks again for the help!

Posted: Sat Feb 11, 2006 8:15 pm
by josh
By the way, the encryption sounds pretty weak, a good method involves something that requires a private key to decrypt the string, such as xor'ing each character with a value from the private key