This the second installment in my series of post related to modern cryptography...Click here for part 1 on RSA ciphers
Most ciphers require the sender and the receiver to exchange a key prior to exchanging coded messages.But the key which is exchanged may itself be vulnerable to attack by an unauthorized third party while it is being transmitted over a network.So serious effort is essential to ensure the safety the safety of the key so that it does not all into the wrong hands.
Suppose two people Alice and Bob want to exchange a secret.So at first Alice puts the secret in a box and locks it up using a padlock(which only she can unlock) and sends the locked box to Bob.Bob who is unable to open the padlock puts another padlock on the box(which only he can open and sends the box back to Alice.Now Alice receives the box with two padlocks and she opens up her padlock and returns the box to Bob.Notice that now the box only contains Bob's padlock.After receiving the box Bob opens up his own padlock and hence opens the box containing the secret.
Step 1. Together Alice and Bob choose a 200-digit number p which is likely to be a prime and a number such that
Alice secretly chooses an integer
Bob secretly chooses an integer
Alice computes and tells that to Bob.
Bob computes and tells that to Alice.
The shared secret key is now
Notice that both Alice and Bob can easily compute it. Alice computes this as Bob computes this as
Now they can communicate with each other using their agreed upon secret key by encrypting messages using a suitable cipher(like Arcfour,Bowfish,Cast128 etc).
in order to understand the conversation between Alice and Bob the eavesdropper needs the shared secret k .BUt it is extremely difficult to compute given only .One way to compute would be to compute n from the knowledge of and bt for extremely large values of p this is computationally in-feasible.A polynomial time bound in a quantum computer was provided by Peter Shor.This is known as the .
Part of the reason why this is difficult is because the logarithm of real numbers is continuous but (minimum) logarithm of a number bounces around at random.
The above plot shows this exotic behavior.
Suppose when Alice is sending a message to Bob announcing , a mamn(eavesdropper) intercepts the message and sends his own number to Bob.Eventually Bob and the man agree on a secret key and Alice and the Man agree upon the key .
When Alice sens a message to Bob she unknowingly uses the secret key ,the man intercepts it decrypts it,changes it and re-encrypts it using the key and sends it to Bob.This is bad because the man can now read every message between Alice and Bob and moreover can change them in submission in subtle ways.
One way to get around this attack is to use the Digital Signature Scheme based on the RSA Cryptosystem.
Please reshare as much as possible if you want more such posts on modern cryptography!!Feel free to ask any questions related to this in the comments ...and if you want to make another series of notes alongside this cryptography series then post your suggestions in the comment box.
Have a nice day!! :)