Text this: Mathematical aspects of classical and quantum cryptography