Symmetric and Asymmetric Encryption | O Level Computer Science 2210 & IGCSE Computer Science 0478 | Detailed Free Notes To Score An A Star (A*)
The Purpose of Encryption
- Public network based data transmission has a risk of interception
- A hacker in such circumstances is called an eavesdropper
- Encryption can lower the risk
- Encryption means converting data into unreadable form
- It DOES NOT prevent interception
- Instead, it stops the data from being understood by the eavesdropper.
- Extremely crucial if the data is confidential or sensitive
- Plaintext and ciphertext
- Plaintext
- Original data being sent
- Ciphertext
- After the data has passed through encryption algorithm
- Process
- Plaintext goes through encryption algorithm based on an encryption key to create cyphertext, which is transferred over the internet. Once transferred, the data undergoes decryption algorithm using the decryption key to reproduce the plaintext.
- Plaintext
Symmetric Encryption
- One encryption key is used to both encrypt and decrypt the data.
- The key can be based on any idea. For example, if I use the key 175825. Then I would start moving the alphabets ahead by 1, 7, 5, 8, 2, and 5 steps.
- For example, if the plain text is Hunain, then H will be moved forward by 1 step, U will be moved by 7 steps, N will be moved by 5 steps, A will be moved by 8 steps, I will be moved by 2 steps and N will be moved by 5 steps. The final result in the cyphertext will be IBSIKS.
- Once the data will be transferred, it will use the same key, opposite in direction, to get back to the plain text. So IBSIKS will become HUNAIN, as the key will be -1-7-5-8-2-5.
- Modern computers can crack the keys easily
- Crack means find out what the key means
- Therefore, now we use a 256-bit binary encryption system instead, where it gives us 2^256 possibilities to encrypt.
- Quantum computers can still decrypt this information.
- Therefore, symmetric encryption, using the same key on both ends, will always pose security problems.
- Distribution problem
- Refers to the situation where the symmetric key falls in wrong hands
- Modullo-11 system can be used to control this risk
- Both sender and receiver can calculate the encryption key instead of being sent during the exchange process.
Asymmetric Encryption
- 2 keys are used and both are needed to encrypt and decrypt messages
- Public key
- Available to everyone
- Private key
- Only known to the computer user.
- Public key
- Method
- Receiver will use the algorithm to generate matching pair of keys
- The public and private key.
- It is stored on their computer
- Are mathematically linked but can not be found from each other
- Receiver sends public key to Sender
- Sender user public key for document encryption
- Sender sends the cyphertext to the receiver
- Receiver uses his matching private key to decrypt the document (PUBLIC KEY CAN’T DECRYPT THE DOCUMENT)
- The same public key can be shared to multiple senders, but the private key will remain with the receiver.
- If two-way communication is required with multiple senders, then each sender has to develop their own public and matching private key as well. They will then become the receiver in the process when data is received by them.
- Receiver will use the algorithm to generate matching pair of keys
