Created
July 18, 2015 00:53
-
-
Save bjhaid/175c7ac4601a4beb8fb5 to your computer and use it in GitHub Desktop.
Vigenère Cipher (Hex XOR Variant)
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
VigenereHexXOR = fun(Plain, KeyList) -> G = fun([H|T], [B|R], Q, List, F) -> | |
F(T, R, Q, [H bxor list_to_integer(B, 16)|List], F); | |
(Act, [], Q, List, F) -> | |
F(Act, Q, Q, List, F); | |
([], _, _, List, _) -> [integer_to_list(X, 16) || X <- lists:reverse(List)] | |
end, | |
G(Plain, KeyList, KeyList, [], G) | |
end. | |
VigenereHexXOR("cool!", ["01", "3F"]). | |
["62","50","6E","53","20"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment