Sunday, 10 May 2015

Symmetric Key Encryption:
This is also referred as Secret Key Encryption as a single Secret Key is used for Encryption as well as Decryption. Assume that Alice needs to send some sensitive information to Bob. Alice encrypts the message using a Secret Key and sends it to Bob. The Secret Key is also shared with Bob by some other means. Now, Bob decrypts the received message using the Secret Key which was shared by Alice.

Asymmetric Key Encryption:
Also referred as Public Key Encryption. Two keys, Public & Private are used for Encryption and Decryption. Public Key Encryption is developed by overcoming the limitations that are present in the Symmetric Key Encryption. Referring to the above example, say Alice has shared the Secret Key with Bob over telephone or email. Unfortunately, an attacker has managed to get the Secret Key which was shared in the email. So, now the attacker can decrypt the message. This is the issue when single key is used for Encryption and Decryption.
Public Key Encryption uses a key pair (Public Key, Private Key). Public Key is used for Encryption and Private Key is used for Decryption. Each individual holds a key pair. Public Key is made freely available so that anyone who wants to send a message can use it for encryption. Bob's Public Key is freely available. Now Alice encrypts the message using Bob's Public Key. Bob can decrypt the message with his Private Key. In this process, no key sharing is required.

Encoding vs. Encryption vs. Hashing

Encoding:
Encoding is not a security component, therefore no keys are used. Encoding is to maintain usability. It transforms data into another format so that it can be exchanged between different types of systems. It is a reversible process. Data encoding can be performed by using publicly available schema. Encoded data can be decoded by using the same schema which is used for encoding.
Examples of Encoding schema are: Unicode, Base64, Hex

Encryption:
Encryption is to maintain confidentiality of the data. It transforms plain text into cipher text which is not human understandable. An encryption algorithm with a secret key is used to encrypt the data. It is a reversible process (decryption), but can be done only by a particular user with the secret key and the algorithm used for encryption is known. Encryption is mainly categorized into two: Symmetric Key Encryption and Asymmetric Key Encryption. They are detailed here.
Examples of Encryption algorithms are: RSA, AES, DES, 3DES

Hashing:
Unlike Encoding & Encryption, Hashing is a one way process (irreversible) and it ensures integrity of data. Hashing of any variable length message produces a fixed length message digest or hash. It is almost impossible that two different messages will have the same hash, if this occurs it is called as a collision. Any minor change in the message results in extreme change in the generated hash.
Examples of Hashing algorithms are: MD5, SHA