A Tutorial on Linear and Differential Cryptanalysis