Algorithms, complexity and cryptography