RSA in 12 lines of Python

--

I set myself a task to write a minimal number of lines to implement a full RSA key generation, encryption and decryption system, and I got it down to 12 lines (not including import statements). The code is [here]:

--

--

Prof Bill Buchanan OBE FRSE
ASecuritySite: When Bob Met Alice

Professor of Cryptography. Serial innovator. Believer in fairness, justice & freedom. Based in Edinburgh. Old World Breaker. New World Creator. Building trust.