Encryption is the conversion of electronic data into another form, called ciphertext, which cannot be easily understood by anyone except authorized parties.
The purpose of encryption is to protect the confidentiality of digital data stored on computer system or transmitted via the internet or other computer networks.
There is 2 categories of encryption algorithms:
Symmetric key ciphers use the same key, for encrypting and decrypting a message or file.
Symmetric key sizes typically 128 or 256 bits.
Symmetric key encryption is much faster than asymmetric encryption.
AES is the most widely used symmetric key.
Asymmetric uses 2 different but mathematically linked keys, known as public key and private key.
The public key can be shared with everyone, whereas the private key must be kept secret.
Asymmetric keys typically 1024 or 2048 bits.
RSA is the most widely used asymmetric algorithm.
Asymmetric encryption is more secure compared to symmetric encryption.
If you encrypt data with the public key, only the holder of the corresponding private key can decrypt the data.
SSL is a protocol that utilizes asymmetic encryption to provide communication security on the internet
Since asymmetric keys are bigger than symmetric keys, data that is encrypted asymmetrically is tougher to crack than data that is symmetrically encrypted.
However, this does not mean that asymmetric keys are better.
Rather than being compared by their size, these keys should compared by the following properties:
1. computational burden
2. ease of distribution.
Symmetric keys are smaller than asymmetric, so they require less computational burden.
However, symmetric keys also have a major disadvantage if you use them for securing data transfers.
Because the same key is used for symmetric encryption and decryption, both you and the recipient need the key.
Asymmetric encryption doesn’t have this problem. As long as you keep your private key secret, no one can decrypt your messages.
You can distribute the corresponding public key without worrying who gets it.
Anyone who has the public key can encrypt data, but only the person with the private key can decrypt it.
SSL is a standard security technology for establishing an encrypted link between a server and a client
1. Server send asymmetric public key
2. Browser creates a symmetric session key, encrypt using asymmetric public key
3. Server decrypts the encrypted session key using private key
4. Server and Browser encrypt and decrypt using symmetric session key