changed deprecated crypto usage and optimizes binary_xor