Move previous cryptopals work into an Erlang subfolder, start cryptopals in Python 3
[sandbox] / cryptopals-erlang / 01.03 / main.erl
1 -module(main).
2 -export([run/0]).
3
4 % TODO Scoring function to identify which string is English
5
6 get_xored_possibilities() ->
7     Base = hex:decode("1b37373331363f78151b7f2b783431333d78397828372d363c78373e783a393b3736"),
8     XorBytes = lists:seq(0,255),
9     lists:map(fun(XorByte) -> hex:single_byte_xor(XorByte,Base) end, XorBytes).
10
11 get_comparison_text() ->
12     {ok, Data} = file:read_file("1984.html"),
13     Data.
14
15 print_all(List) -> lists:map(fun(S) -> io:format("~s~n",[S]) end, List).
16
17 run() -> print_all(get_xored_possibilities()).