changed deprecated crypto usage and small optimazation

changed deprecated crypto usage and also replaced binary_xor/2 with crypto:exor. crypto:exor is about six to seven times faster.