Exercise 11.9
also moved RSA algorithm to own .py file