-
-
Save michael-lins/8615d091c3a0b68643adb37a5b6a5d46 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
def xor_encrypt(string, key) | |
string.bytes.map.with_index { |byte, index| (byte ^ key.bytes[index % key.length]).chr }.join | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment