Sunday, April 30, 2017

Asymmetric Encryption

Hello Guys. This is my first blog and I am really excited and looking forward to it. As we all know that, it is a need of IT world to protect their confidential data from malicious users while passing it through network.
There are many techniques which prevents the data from malicious users. One of the way which we are going to discuss in this blog is using Encryption technique.

Basic Overview:
Encryption : Encryption is the process of converting a simple text into some-kind of text(i.e Cipher text) that an unauthorized person will not be able to figure out the real text.

There are two types of encryption techniques:
1. Asymmetric Encryption
2. Symmetric Encryption

We are mostly going to discuss Asymmetric encryption technique in great detail.

Asymmetric Encryption:
It is the encryption technique which use a pair of public-private key. The sender will encrypt the data using public key and the receiver will decrypt the encrypt text using the private key.




We are going to use RSA encryption technique which is one of the asymmetric encryption technique for encrypting the text. RSA stands for Ron Rivest, Adi Shamir and Leonard Adleman who first publicly described it in 1978. The algorithm was named after these three scientist.

The mathematical computation for RSA algorithm:
1. Choose two prime number p and q
2. Multiply both prime number and assign it to n
3. Now compute  φ(n)= (p-1)*(q-1)
4. Choose e such that it should satisfy the expression 1<e<φ(n) and e and φ(n) are co-prime
5. Compute d such that (d*e) % φ(n) = 1
6. Public key is (e,n)
7. Private key is (d,n)
8. Let m be the message to be encrypted
    Cipher text C = (m^e) % n
9. Decipher Text m= (C^d) % n

Example:
Let two prime number be p=3 and q=11
n= p*q = 3*11=33
φ(n) = (p-1)*(q-1)=(2)*(10)=20
let e = 7 which co-prime to  φ(n)
let d=3 which satisfy the equation (d*e) % φ(n) = 1 i.e.[ (3*7) % 20 = 1]
Public key is (e,n) = (7,33)
Private key is (d,n) = (3,33)
Let m = 2 be the message to be encrypted.
Let C be the cipher text
Encrypted message C =  (2^7) % 33 = 29
Decrypted message m = (29^3) % 33 = 2

So guys, hopefully you have understood how RSA encryption algorithm computationally works. In next blog i will try to demonstrate how it is practically use in real world.

7 comments:

  1. Chava re chava.... Ek hich chava 👌

    ReplyDelete

  2. One of my favorite topic. In this world of digitization where all our information is on web is highly prone to attacks. Very nicely explained this concept of encryption. Waiting for some more cool topics.

    ReplyDelete
  3. Great work well explained with example.

    ReplyDelete

Pagination using CSS and JQuery Javascript

Hello everyone, we all know how often we have requirement for implementing pagination in a website. As soon as we have this kind of requirem...