haskell Cryptographic numbers: functions and algorithms