CryptographyIts a science of writing in secret code, i.e. to protect message from being viewed by unauthorised parties.
A message is converted to a form, that even if its intercepted by unauthorised parties, they can not make any sense out of that message.
Cryptography TerminologyPlaintext: the actual message
Encryption: Encoding of message content to hide it contents.
Ciphertext: encrypted message
Decryption: Process of retrieving plain text from cypher text.
Encryption/decryption usually make use of a key, following are the two classes of key based encryption algorithms:
1. Symmetric (Secret key)
2. Asymmetric (Public key)
Symmetric (secret key) CryptographySingle key is used for both encryption & decryption
- It is called symmetric as single key is used for both encryption & decryption.
- Obviously key must be known to both sender and receiver, but it should remain secret for outside world.
- Biggest difficulty with this system is distribution of key
- e.g. DSA algorithm
Asymmetric (public key) cryptography
- This system uses separate keys for encryption and decryption.
- Computationally infeasible to determine decryption key from encryption key and vice-versa.
- One key is designated as public and advertised as widely as owner wants, the other key is private and is never revealed.
- For e.g. suppose Alice publishes its encryption key, anyone can use that key to encrypt message, but only Alice can decrypt it (as he only has the private key)
- e.g. RSA algorithm
Private key Vs Public key
Computing public key cipher takes much longer than using symmetric key for encoding the same message.
But with symmetric key, distribution of key in safe manner is difficult.
So In practice, below approach is used:
- Message is encrypted using secret key cryptography
- secret key itself is encoded using public key cryptography
- i.e. public key system "transports" the secret key
- As secret key is usually much shorter than the message, it results in significantly faster processing than using public key cryptography alone.
In this post we discussed basic concepts of cryptography. We understood two types of cryptographic systems: public key and secret key.
In next post we will discuss what are digital signatures and digital certificates.