I made a simple encryption program. It works like this: the ascii value of every character in string A is added to the ascii value of the corresponding character in string B. If the value is greater than 255 or less than 0, it is wrapped around; if string B is shorter than string A, it is repeated.
For example, using this algorithm on the following strings:
"The quick brown fox jumps over the lazy dog" (string A)
and "Jackdaws love my big sphinx of quartz" (string B)
will output:
"žÉÈ‹ÕÖàÖ‹ŒÑèÔ—Û™†ÑᇊèÃÂØÜŽç–ÔØ@Ã¥ÃÂÆ’àÛ...
Decryption works in reverse - the ascii value of each character in string B is subtracted from the ascii value of each character in the encrypted string.
How easy/hard would it be to decrypt the output string if string B is unknown? Also, how secure (and practical) is the algorithm in general?
Tags: