Objectives: Students should be able to —
- 1 Explain what is meant by Encryption.
- 2 State the difference between Plain text and Cipher text.
- 3 Give reason why data need to be encrypted.
- 4 Identify and describe Symmetric and Asymmetric Encryption.
- 5 Show understanding about the use of public and private key in asymmetric encryption.
Securing of Data with Encryption
(a) Describe Encryption and the security it provides:
Encryption converts human readable meaningful plain text into meaningless cipher text.
It works by scrambling data into grabbed code using an encryption algorithm and a secret encryption key.
Even if data is stolen, it cannot be understood by the hacker.
Only authorized person who has the secret decryption key will be able to decrypt and read the data.
Plaintext → [Encryption algorithm] → Ciphertext → (Internet/Cloud) → Ciphertext → [Decryption algorithm] → Plaintext
(Encryption Key ↓) (↑ Decryption Key)
(b) Give 3 circumstances where encryption would be used:
- Any file containing confidential data, like bank account or credit-card details.
- When buying items on the Internet by sharing credit-card details.
- Email or SMS that you wish to remain private and confidential.
- While doing online bank transactions, because Internet is a public network and anyone can trap your outgoing traffic and steal your data.
(c) Describe the following key components of encryption:
- Plain Text: Meaningful data or information is called plain text.
- Cipher Text: Encrypted data or meaningless data is called cipher text.
- Cryptographic or Encryption Algorithm: A mathematical procedure for performing encryption on data.
- Encryption Key: A piece of information that determines the functional output of a cryptographic or encryption algorithm. It specifies the transformation of plaintext into ciphertext, and vice versa.
(d) State how the strength of the encryption can be improved:
- Increase the length of the encryption key. The longer the key length, the more possible combinations of bits need to be tried to determine the key.
- Use a more complex encryption algorithm.
Symmetric Encryption
Symmetric encryption is a cryptographic algorithm that uses the same encryption key (a secret key) to encrypt the plaintext and decrypt the ciphertext.
While encrypting data, the plaintext is scrambled into grabbed code using an encryption algorithm and a secret key.
If encrypted data is stolen, it cannot be understood by the hacker.
It is extremely fast, relatively less complex and hence efficient for large amounts of data.
The secret encryption key has to be shared with the recipient, so that it can be used to decrypt the message.
Sender → Plaintext → [Encrypt] → Ciphertext → [Decrypt] → Plaintext → Receiver
Shared Secret Key used at both Encrypt and Decrypt stages.
(a) Encrypt using symmetric key 4291362856:
Method: To convert the meaningful plaintext to meaningless ciphertext, shift each character of the alphabet by +4, +2, +9, … so on, places towards right.
| Row | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 |
|---|---|---|---|---|---|---|---|---|---|
| Plaintext | C | O | M | P | U | T | E | R | S |
| Key | +4 | +2 | +9 | +1 | +3 | +6 | +2 | +8 | +5 |
| Cipher | G | Q | V | Q | X | Z | G | Z | X |
Continuing the same pattern for the remaining words gives the full cipher text:
GQVQXZGZ XIMGWDH OU MCIMVROJ
If encrypted ciphertext is stolen, it is impossible for hacker to read without decrypting, using the same encryption key.
(b) Decrypt using the same symmetric key:
Method: To convert the meaningless ciphertext to meaningful plaintext, reverse the algorithm — shift each character of the alphabet by -4, -2, -9, … so on, places towards left.
| Row | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 |
|---|---|---|---|---|---|---|---|---|---|
| Cipher | G | Q | V | Q | X | Z | G | Z | X |
| Key | -4 | -2 | -9 | -1 | -3 | -6 | -2 | -8 | -5 |
| Plaintext | C | O | M | P | U | T | E | R | S |
Continuing the same pattern for the remaining words decrypts the full ciphertext back to: COMPUTER SCIENCE IS EXCITING
(c) Comment on the strength of the encryption key used:
The encryption key of length 10 digits gives 1010 possible combinations of codes, which is very difficult for hackers (also called eavesdroppers) to guess.
The longer the key length, the more possible combinations of codes need to be tried to determine the key.
(a) State how Selma could email her personal data more securely:
Selma could use Symmetric Encryption.
(b) Describe how your chosen solution works:
- Selma has to use a Symmetric Encryption Algorithm.
- Make use of an encryption key (secret code) to encrypt her confidential data.
- Encryption converts human readable plain text to meaningless grabbed code called cipher text.
- Email her encrypted cipher text and send the encryption key separately through another channel like mobile phone, to her employer to decrypt and read it.
Asymmetric Encryption
Asymmetric encryption is an encryption algorithm that uses public-key to encrypt and private-key to decrypt the message.
The Public-key is shared between sender and receiver and made available to everybody.
The secret Private-key will not be shared with the recipient.
Both Public and Private keys are needed to encrypt and decrypt the message.
It uses very complex mathematical algorithm, so it is slower than symmetric encryption.
Sender → Plaintext → [Encrypt using Recipient's Public Key] → Ciphertext → [Decrypt using Recipient's Private Key] → Plaintext → Receiver
Key Distribution Routine: The following algorithm shows how the sender and recipient end up with the required encryption-key without sharing their secure private key.
| Stage | Sender | Recipient |
|---|---|---|
| 1 | The sender uses an encryption algorithm and chooses a value. e.g. X = 2 (kept secret as Private-key) | The recipient uses the same algorithm and also chooses a value. e.g. Y = 4 (kept secret as Private-key) |
| 2 | This value of 'X' is put into a simple algorithm: 7X (MOD 11) MOD gives the remainder when dividing a number by 11. Working: 72 (MOD 11) = 49 (MOD 11) = 5 | This value of 'Y' is put into a simple algorithm: 7Y (MOD 11) MOD gives the remainder when dividing a number by 11. Working: 74 (MOD 11) = 2401 (MOD 11) = 3 |
| 3 | The sender now sends the value just calculated as Public-key (e.g. 5 to the recipient). | The recipient now sends the value just calculated as Public-key (e.g. 3 to the sender). |
| 4 | The sender puts the recipient's public-key 3 into the same algorithm in place of "7": 3X (MOD 11) Working: 32 (MOD 11) = 9 (MOD 11) = 9 | The recipient puts the sender's public-key 5 into the same algorithm in place of "7": 5Y (MOD 11) Working: 54 (MOD 11) = 625 (MOD 11) = 9 |
Even though the public key and the private key are not the same thing, they are related. The sender creates the message then encrypts it with his own private and recipient's public key. After that, if the recipient wants to decrypt the message he/she would have to do it with his/her private key.
- Public key is provided by the recipient. It is made available to anyone who wishes to send an encrypted message to the recipient. Safe to share as it can only encrypt the data, not decrypt the message.
- Private key remains private on the computer, never sent or shared. Only the private key can decrypt the data encrypted using the public-key.
Asymmetric encryption is used to encrypt a symmetric encryption key, thus resolving the key distribution problem.
It is better to ultimately transmit data using symmetric encryption because it is faster.
Stages of Asymmetric Encryption:
- User A applies a symmetric key to encrypt the message.
- The symmetric key is then encrypted using the public key known to both A and B (generated by recipient, usually sent via SSL certificate).
- User A sends the encrypted message with encrypted symmetric key over the internet (unreadable if intercepted).
- User B decrypts the symmetric key using his own private key.
- The decoded symmetric key is now used to decrypt the message sent by User A.
| Symmetric Encryption | Asymmetric (Public-key) Encryption |
|---|---|
| Only one key (symmetric key) is used. | Two different cryptographic keys (asymmetric keys) are used, called Public and Private keys. |
| The same key is used to encrypt and decrypt the message. | Public key is used to encrypt and Private key is used to decrypt message. |
| The secret encryption key needs to be shared with the recipient. | The secret private-key will not be shared with the recipient. |
| Uses less complex algorithm, so it is extremely fast. | Uses very complex algorithm, so it is slower than symmetric encryption. |
| It is mostly used when large amount of data needs to be transferred. | It is used in smaller transactions, primarily to authenticate and establish a secure communication channel prior to the actual data transfer. |
SSL (Secure Socket Layer)
(a) Describe SSL (Secure Socket Layer):
- Secure Socket Layer (SSL) is a standard security technology used for establishing an encrypted link between a web-server and a web-browser.
- SSL is a secure protocol that uses asymmetric encryption to encrypt data (so only the web browser and web server can make sense of what is being transmitted).
- It uses the 'https' protocol that ensures the exchange of data remains confidential.
- It activates a small padlock to be displayed at the top-left of the address bar of the browser.
- It uses digital SSL Certificates, which are sent by the web-server to the user's web-browser when requested.
- The SSL certificate contains the public key and the website or organization details.
- The user's web-browser checks whether the SSL certificate is trustworthy or not, and sends a message to the web-server.
- The web-server sends back an acknowledgement to start an SSL encrypted session.
(b) State what is meant by SSL Certificate:
- An SSL Certificate is a small data file that digitally binds the website's public key to its organizational details that identify the owner of the website or company.
- It is sent by the web-server to the web-browser to establish an encrypted link between web-server and web-browser.
- An SSL certificate is used to validate the authenticity of the web-server. It is like an ID card that proves someone is who they claim to be.
(c) State the purpose of SSL Certificate:
- An SSL certificate is used to validate the authenticity of the web-server.
- To ensure that the exchange of information remains private between the intended parties only.
Stages — what happens between web browser and web server:
- The web-browser attempts to connect to a website which is secured by SSL.
- The web-browser requests the web-server to identify itself.
- The web-server sends a copy of its SSL Certificate to the web-browser.
- The web-browser checks whether the SSL certificate is trustworthy or not.
- If it is trustworthy then the web-browser sends a positive message to the web-server.
- The web-server will then send back some form of acknowledgement to allow the SSL encrypted session to begin.
- The encrypted data is then shared securely between the web-browser and the web-server.
- Online banking and all online financial transactions.
- Online shopping.
- When sending confidential documents out to a restricted list of users.
- Sending and receiving emails.
- Using Cloud storage facilities.
- Voice over Internet Protocols (VoIP) when carrying out video chatting.
- When making use of Social networking sites and in instant messaging.
Revision: Statements and Key Computing Terms
| Term | Definition |
|---|---|
| Encryption | The process of making data meaningless using encryption keys; without the correct decryption key the data cannot be decoded (unscrambled). |
| Plaintext | The original text/message before it is put through an encryption algorithm. |
| Ciphertext | Encrypted data that is the result of putting a plaintext message through an encryption algorithm. |
| Encryption algorithm | A complex piece of software that takes plaintext and generates an encrypted string known as ciphertext. |
| Symmetric encryption | A type of encryption in which the same encryption key is used both to encrypt and decrypt a message. |
| Asymmetric encryption | A type of encryption that uses public keys and private keys to ensure data is secure. |
| Public key | A type of encryption key that is known to all users. |
| Private key | A type of encryption key which is known only to the single computer/user. |
| Secure Socket Layer (SSL) | A security protocol used when sending data over a network (such as the Internet). |
| SSL certificate | A form of digital certificate which is used to authenticate a website; providing the SSL certificate can be authenticated, any communication or data exchange between browser and website is secure. |