: : A variation on this algorithm uses a password.
:
: The algorithm I showed uses a password, too.
:
: : This algorithm uses three strings: a message string, a password string, and an encrypted message string.
: : You simply perform a mathematical expression taking the letters from the message and the password to encrypt a new string. The most simple being an ASCII-addition, example:
: :
: : Message: Encryption algorithm
: : Password: code
: :
: : - Take the first letter of the message and the password, and add them:
: :
: : E (ASCII 69) + c(ASCII 99) = (ASCII 168)
: :
: : - then the second, third etc. until you reach the end of the password.
: : - Now you have a problem, since you cannot add any more letters to the message letters. Solution: start over with the password.
: :
: : In this case: the fifth letter (y) is encrypted with the C of the password.
: : The encrypted message looks like this: __+?F?
: : Which is utter garbage.
:
: Not
really utter garbage. In your example, the alteration of the message repeats every 4 characters! The kind of thing easy for a computer to spot. Actually, this one's easy enough for a human to spot. Imagine some blank space in the message, like:
:
: original = ' '
: encrypted = ''
:
: If we look at the value of each byte:
:
: 131 143 132 133 131 143 132 133 131 143 132 133 131 143 132 133 131 143 132
:
: It doesn't take a master hacker to see that it repeats. Here's the same blank space encrypted with the algorithm I posted.
:
: original = ' '
: encrypted = '-Sn˜'˜ a-l?z-q ' (mostly non-printable chars)
:
:
:
: 186 196 83 252 145 247 39 247 0 97 45 108 169 160 14 122 45 113 199
:
: Utter garbage. ;)
:
: Cheers,
: Eric
:
:
:
:
:
That is correct, but this was merely a simple example. Normally I use much more complicated formulas, and combine it with completely other encryption algorithms, such as a transformation matrix or a simple compression.