View Single Post
  #4  
Old 12-19-2012, 04:44 PM
scriptless scriptless is offline
Banned
Join Date: Dec 2008
Location: N-Pulse
Posts: 1,412
scriptless is a splendid one to beholdscriptless is a splendid one to beholdscriptless is a splendid one to beholdscriptless is a splendid one to behold
Quote:
Originally Posted by Gunderak View Post
Little confused, I was thinking of creating a character map eg, a is equivalent to "7", b "K" and so on, but eh this way looked better.
And the reason I divide by 2 then multiply etc is to make it more confusing.
If someone was trying to crack the string, without knowing the script they could probably tell it's using base64, then when they decipher it they'd see hang on each letter represents a number, and catch on. Where as this, it represents a number, but the number is "hashed" sort of.
Never actually tried to encrypt information properly before, so this was more of a learning curve.
But it's not a hash. Hash's cannot be decrypted. Such as SHA and MD5.

Here is an example of what I mean.

Input
PHP Code:
Hello World 
Encryption Key
PHP Code:
dog 
Lets look at the binary value
PHP Code:
Hello World 0100100001100101011011000110110001101111001000000101011101101111011100100110110001100100
dog 
011001000110111101100111 
What you can then do is copy and past the binary from "dog" untill it's as long as the Hello World.. then just "xor" it..

Xor Eample:

PHP Code:
//Hello:
01001000 01100101 01101100 01101100 01101111
//dogdo:
01100100 01101111 01100111 01100100 01101111

//result:
00101100 00001010 00001011 00001000 00000000

//and back:
00101100 00001010 00001011 00001000 00000000
xor
01100100 01101111 01100111 01100100 01101111
=
01001000 01100101 01101100 01101100 01101111 
Which means the first "l" is 00001011 while the second is 00001000.. It's not easy pattern at all to figure out even.

Since the size of the encrypted string is the same, we can just xor it again, by the same value, and it should decrypt the string
Reply With Quote