So What’s In An RSA Public and a Private Key?

--

You have probably viewed a digital certificate, and one which contains the key pair (the public and private keys) and also the distributed version (with just the public key). You should never distribute the one with the private key, as this could allow someone to break encryption tunnels, or pretend to be the entity who has had their private key stolen. The Lenovo hack a few years ago was a good example of this, and where the key pair was distributed with the software, and where it took someone just a few minutes to crack the password on it. After that, anyone could crack the tunnelled communication to Google (as there was a back-door in the communications).

But what is actually on a key? Well, let’s look at an RSA key [here].

RSA is an asymmetric encryption algorithm, which uses two keys, one to encrypt and the other to decrypt. It was created in 1977 by Ron Rivest, Adi Shamir, and Leonard Adleman, and is still one of the most widely used encryption methods. Basically, we have a modulus N and which is the multiplication of two prime numbers: P and Q. We select a value of E, and our encryption key (the public key) is (E,N). After this, we determine the decryption key (D), and our private key becomes (D,N). Here is RSA is 12 lines of Python code [link].

--

--

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.