The Birthday Problem and Cryptography