RSA Encryption

Person To Person and RSA Encryption

The Story of RSA

RSA Encryption - the security invention which makes the internet work commercially.

Every time you use a credit card you are depending on RSA Encryption to protect you. Its interesting that such a pervasive and critical technology is so little known.

RSA was developed in the 1970’s by three American mathematicians and is today the basis of all financial transactions on the internet. This is due to its unique ability to encrypt a file specifically for another person to open. Its interesting to note that Clifford Cocks, a British mathematician at GCHQ, discovered it 3 years before the American team but never published it.

RSA is unique. All other encryption systems use the same key to encrypt as to decrypt, just like a normal lock and key. RSA splits the key into two, an En-cryption key (the public key because who cares what you En-crypt) and a De-cryption key (private key). Anyone can En-crypt a file for you (using your public key) but only you can De-crypt it (using your private key).

It is accepted by mathematicians that provided a large key length is used, RSA is impossible to crack. The basis of this lies in number theory and has to do with the extreme difficulty of factoring large numbers.

How it works in practice (technical)

The first task in implementing RSA is to generate a digital key. In practical software applications this is normally derived from a password provided by the user.

The more bits it has, the more secure is the RSA Key. One component of an RSA key pair is called the Modulus which is simply the product of two very large prime numbers. To break the key a hacker must factorise the Modulus back into these two numbers.

For a key having length 1024 bits, the Modulus lies between:

1 ^ 10308 and 2 ^ 10308

for a key length of 256 bits the number of possibilities lies between:

5 ^ 1076 and 10 ^ 1076

Mathematically, it is considered infeasible to factorise such massive numbers.

The Modulus is used to generate the private and public keys using Euler’s Totient Function. The public key consists of the modulus n and the public (or encryption) exponent e. The private key consists of the modulus n and the private (or decryption) exponent d which must be kept secret.

Digital Signing - a clever way to fingerprint a message

In practical applications of RSA it becomes necessary to add a function called Digital Signing. The reason for this is that since anyone can RSA-encrypt a file for you using your public key, there has to be a way of knowing who sent it and that is done using digital signing.

Signing a file consists of taking a “hash” of the file data using the Secure Hash Algorithm. This algorithm was produced by the USA National Security Agency in order to provide standard encryption tools for military and commercial use.

Secure Hash Algorithm produces a condensed representation of a message or a data file. The 'condensed representation' is of fixed length and is known as a 'message digest' or 'fingerprint'. What makes this useful is that it is computationally infeasible to produce two messages having the same message digest. This uniqueness enables the message digest to act as a 'fingerprint' of the message, opening up the possibility of using this technology in conjunction with RSA to prove who originated an encrypted message.

RSA with digital signing - two technologies equals one solution

Combining the two mathematical technologies we can create a practical system for data protection of email, memory sticks or any system where data is passed from one person to another.

Lets assume we (the Sender) have a payroll data file which we want to send to a client (the Receiver). This is how we do it using RSA and Digital Signing in Person To Person:

1. Sender and Receiver both install PTP and enter a password

2. PTP uses passwords to create two RSA digital keys for each user, a Private key and a Public Key.

3. Sender and Receiver exchange their Public keys via email using PTP

4. Sender uses PTP to encrypt and email the payroll file to Receiver

5. PTP encrypts the payroll file with RSA using Receiver’s Public key

6. PTP computes the Secure Hash Algorithm for the payroll file

7. PTP encrypts the result of the Secure Hash Algorithm with RSA

8. PTP joins the two RSA encryptions together in a single encryption file

9. The combined encrypted file is emailed to Receiver

10. Receiver’s PTP decrypts the file using Receiver’s Private Key

11. Receiver’s PTP checks that the Secure Hash Algorithm matches the file data

12. Receiver now has the payroll file and legal proof of who encrypted it

The Receiver is the only person who could have opened the file because they are the only person with their Private Key in PTP. Note that no passwords are exchanged in this process which is very important. Passwords are the weakest link in any system which requires data to be transferred from one person to another.

The above all sounds very complicated because the all internal steps are spelt out, however in practice the software PTP is doing all the work and the user just clicks a few buttons.

Digital Signatures - who sent me this file ?

Digital signing proves who encrypted the file, but only insofar as the Public Key actually represents the person involved. In the real world, as opposed to the world of mathematics, it becomes important to validate the person or organisation who is using a particular Public Key.

There are two ways of doing this. One is to use commercial Digital Certificates. The other is Peer-to-Peer Certification.

1. Digital Certificates - anonymous corporation generates your keys, validates your identity, you pay

Under this scheme you purchase a Digital Certificate from a commercial provider with an annual renewal charge. You must provide them with a lot of personal data such that someone could, if necessary, prove who you are. For example your National Insurance number, passport number, driving licence number, utility bills etc. They will then create your public and private RSA keys for you.

They publish your public key so that anyone can use it. Anyone then using that key has the potential to refer back to the supplier and validate who you are. Needless to say this system had a number of potential security problems. Just the fact that a remote organisation is holding your public and private keys and all your personal details is cause for concern, and there are other technical weaknesses in the system.

2. Peer-to-Peer Certification - generate your own keys, person at each end validates identity, no charge

Here you validate the identity of the person you are communicating with yourself. Lets say someone known to you sends you an email with an RSA-encrypted file. The software PTP is able to create a code derived from their private key without giving the private key away. Because the sender is known to you, you can phone them or text them and check that the code matches up.

This how it works in practice. The PTP decrypts the file and displays an id-code. One time only, the id-code has to be validated with the sender. Therefore the first time you receive a file from Dave you call or text him for his id-code, which he gives you. Lets assume its 8736-2637 for example. If that matches the id-code you have displayed in your PTP then you know it is indeed Dave. This is much safer than an anonymous corporation doing the validation.

Obviously this system depends on your knowing the sender. However, in practice are you going to be exchanging confidential information with strangers ? The benefit is that no-one else in involved apart from the sender and receiver. In security, three's a crowd.

"Secure" Web Servers - is your data safe "in the cloud" ?

Secure web servers use a form of RSA to create a secure link between a web browser and the remote server. The secure web page uses a special form of address called HTTPS which stands for Hypertext Transfer Protocol Secure and is a combination of the Hypertext Transfer Protocol with the SSL/TLS protocol to provide encryption and secure identification of the server. SSL/TLS stands for Secure Sockets Layer and Transport Layer Security. SSL and TLS are based on RSA encryption. HTTPS connections are used for credit card payment transactions on the World Wide Web which means that all credit card payments, online banking and internet shopping rely totally on RSA for security.

For a payroll service provider to exchange documents with their clients they can use an HTTPS web server. They upload files to the secure server and the client logs in and downloads them. There are a number of security problems with this methodology. First of all the data is only secure during the short time of transmission over the internet. It is not secure while it is on the remote server nor is it secure on the PC at either end. In addition there is the problem of password management for access to the remote server. It is unfortunate that the beauty of RSA in not using passwords to achieve a data delivery is compromised in this system by having to use passwords to gain access to the server.

The Data Protection Act stipulates that the Data Controller - in this example the payroll client - must ensure that the Data Processor (the Payoll Bureau) uses adequate security procedures and technologies. If the data is held on a remote server by a 3rd party organisation this requirement is very difficult to satisfy. In addition the remote server might be physically located anywhere in the world and the law reuires that data be held within the EU.

Therefore, while using RSA with HTTPS provides a solution for internet shopping and online banking, it does not provide an effective solution for two individuals exchanging data. For that reason, and also the fact that the remote server might be located outside the European Community, this solution is unlikely to be compliant with the UK Data Protection Act. The latest buzz words like "cloud computing" and "identity based security" sound good but don't stand up to rigorous analysis.

Conclusion - there is only one foolproof solution, RSA Person To Person

Today’s commercial use of RSA is what underpins the Internet. If RSA were cracked commercial transactions on the Web would have to stop because they would no longer be secure - and there is no plan B.

What we call RSA is actually a combination of RSA Encryption and Digital Signing technologies. As more and more commercial organisations use email for delivery of files and documents it is important that a solution is implemented which allows them to comply with the Data Protection Act.

RSA in combination with digital signing provides three services essential to compliance,

1. an uncrackable encryption code

2. decryption only by a single person

3. proof of who did the encryption

Information about individuals must be kept secure as it travels over the internet. In addition to that, files transmitted via the internet are increasingly stored on intermediate servers by Internet Service Providers as a legal requirement. Data is now seen as a valuable recourse which must be protected.

One of the fundamental principles of the UK Data Protection Act states that:

“Appropriate technical and organisational measures shall be taken against unauthorised or unlawful processing of personal data and against accidental loss or destruction of, or damage to, personal data.”

Article 17 of EU Directive 95/46/EC 1995 enforces similar requirements for the security of personal data. In today’s internet world where organisations are using email to deliver information, what technology is available to ensure that we comply with the law ?

There is only one technology available which can do the job effectively when sending personal data over the internet and that technology is RSA Encryption.