Encryption is a mathematical process that alters data using an encryption algorithm and a key. Unlike Hashing, encrypted text can be decrypted to get the original.
Cipher is a method for encrypting messages
- Symmetric
- Asymmetric
Symmetric Encryption
- Same key used for encryption and decryption
- Strength of algorithm ∝ size of key
- A symmetric key is just a set of characters (string)
Strengths
- Fast
- Bulk encryption
Challenges
- Key distribution
- Scalability
Types of symmetric algorithms -
| Block cipher | Stream cipher |
|---|---|
| Operate by encrypting a fixed amount, or block(64 or 128bit) of data | Treats the message as a stream of bits or bytes and performs math functions on them individually |
Examples
- DES (Data Encryption standard) (deprecated)
- AES (Advance Encryption standard) - Key length= 128/192/256 bits
Asymmetric Encryption
- Uses a key pair (public and private key)
- The two keys are mathematically related but cannot be derived from each other.
Success
- Better key distribution and scalability
Caution
- Slower than symmetric systems
Examples
- Rivest-Shamir-Adleman (RSA)
- Elliptic curve cryptosystem (ECC)