Created
August 11, 2013 06:27
-
-
Save RickCarlino/6203679 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
encryption = (plain_text, key) -> | |
# Note: plain_text and key must be the same length | |
return if plain_text.length != > key.length | |
a = [] | |
b = [] | |
c = [] | |
d = [] | |
for char in w1 | |
a.push char.charCodeAt(0) | |
for char in w2 | |
b.push char.charCodeAt(0) | |
for i in [0..(w1.length - 1)] | |
c.push (a[i] + b[i]) % 127 | |
# Need to add function to loop over each ascii number in n and generate the encrypted string ;) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment