Cambridge IGCSE Computer Science Notes

Chapter 2 · Data transmission

2.3 Symmetric and asymmetric encryption

Encryption protects transmitted information by changing readable data into a form that should make no sense to an unauthorised person. This topic explains why encryption is needed, the meanings of plaintext and ciphertext, and how symmetric and asymmetric encryption use keys differently.

Encryption purposePlaintext & ciphertextSymmetric keysPublic & private keys

What you need to understand

By the end of Topic 2.3 you should be able to explain why encryption is used when data is transmitted over public networks; distinguish plaintext from ciphertext; describe symmetric encryption and its key-distribution problem; and describe how a matching public/private key pair is used in asymmetric encryption.

2.3.1

The purpose of encryption

Data sent over a public network, whether wired or wireless, can potentially be intercepted. The textbook calls a person who secretly intercepts transmitted data an eavesdropper. Encryption is used to reduce the danger of intercepted data being understood or used.

Encryption does not stop interception. Its purpose is to alter the data so that an unauthorised person who obtains it cannot make sense of it without the required key and decryption process.

This is especially important for sensitive or confidential information, such as bank or credit-card details, medical information and legal documents.

Plaintext and ciphertext

Plaintext

The original readable data before it has been encrypted.

Encryption algorithm

The process that transforms the plaintext using an encryption key.

Ciphertext

The encrypted form of the data after the encryption algorithm has been applied.

Decryption

The reverse process that uses the required key to recover the original plaintext.

Course-book Figure 2.18 showing plaintext being encrypted to ciphertext, transmitted over the internet and decrypted back to plaintext
Course-book Figure 2.18: plaintext is transformed into ciphertext before transmission and decrypted back to plaintext at the destination.
Exam distinction: encrypted data can still be copied or intercepted. Encryption protects its meaning; it does not guarantee that the transmission itself cannot be captured.
Check the purpose and key terminology.
2.3.2

Symmetric and asymmetric encryption

Symmetric encryption

Symmetric encryption uses the same key to encrypt and decrypt a message. Both the sender and the intended receiver therefore need access to that secret key.

Simple textbook example

The book demonstrates the idea using a 10-digit denary key. Each key digit tells the system how many places to shift the next letter across the alphabet. The receiver reverses those shifts to recover the original message.

This is a teaching example of the principle. The textbook then notes that modern systems can use very large binary keys, giving an enormous number of possible combinations.

Course-book Figure 2.19 showing plaintext COMPUTER SCIENCE IS EXCITING transformed to ciphertext using a repeating ten-digit encryption key
Course-book Figure 2.19: a simplified symmetric-encryption example using the same key pattern to transform the message.

The textbook gives 256-bit binary keys as an example of a much stronger modern key size, with 2256 possible combinations (approximately 1.2 × 1077).

Main weakness of symmetric encryption: key distribution. Because sender and receiver require the same secret key, that key has to be shared somehow. If the key is sent in an email, text message or another insecure way, it could itself be intercepted.

Asymmetric encryption

Asymmetric encryption was developed to address the security problem of sharing one secret key. Instead of one shared key, each user has a matching pair:

Public key

Can be made available to other people. It is used by a sender to encrypt data intended for the owner of the matching private key.

Private key

Is kept secret by its owner. It is used to decrypt data encrypted with the matching public key.

Matching pair: the public and private keys are mathematically linked, but the textbook emphasises that one cannot simply be derived from the other. The private key must remain secret.

How the Tom-and-Jane example works

  1. Jane generates a matching pair of keys on her computer: one public key and one private key.
  2. Jane sends her public key to Tom. It does not need to be kept secret.
  3. Tom uses Jane's public key to encrypt the confidential document. The document is now ciphertext.
  4. Tom sends the ciphertext to Jane.
  5. Jane uses her matching private key to decrypt the document and recover the plaintext. Her public key cannot be used to decrypt that message.
Course-book Figure 2.20 showing Jane sending her public key to Tom
Course-book Figure 2.20: Jane distributes her public key while keeping her private key.
Course-book Figure 2.21 showing Tom sending Jane a document encrypted with Jane's public key
Course-book Figure 2.21: Tom encrypts the document using Jane's public key and sends the ciphertext to Jane.

Receiving encrypted data from many people

Jane can share the same public key with many people. Each person can use Jane's public key to encrypt a message for Jane, while Jane alone keeps the matching private key needed to decrypt those messages.

Course-book Figure 2.22 showing Jane sharing her public key with Tom, Susan, Mike and Megan while retaining her private key
Course-book Figure 2.22: Jane can distribute her public key widely while keeping the matching private key secret.

What if communication must work both ways?

Jane's key pair lets other people send encrypted information to Jane. For Jane to send encrypted information back to Tom, Tom must generate his own public/private key pair and give Jane his public key. Jane then encrypts the message using Tom's public key, and Tom decrypts it using his private key.

If several people all need secure two-way communication with one another, each person needs their own matching key pair, keeps their private key secret and shares their public key with the other users.

FeatureSymmetric encryptionAsymmetric encryption
Keys usedOne shared secret key is used for encryption and decryption.A matching public/private key pair is used.
Key sharingThe secret key must somehow be given to the other party.The public key can be shared; the private key remains secret.
Main issue highlighted in the textbookKeeping the shared key secret during distribution.Users need their own key pairs and public keys must be exchanged for two-way communication.
Key rule to remember: to send confidential data to a person in the textbook's asymmetric example, encrypt it using that person's public key. The recipient decrypts it using their own matching private key.
Check symmetric and asymmetric encryption.

Topic 2.3 revision checklist

Explain why encryption is used when data crosses a public network.
Explain why encryption does not prevent interception.
Distinguish plaintext from ciphertext.
Describe how an encryption/decryption algorithm uses a key.
Explain symmetric encryption and why key distribution is a security problem.
State the roles of public and private keys in asymmetric encryption.
Describe how a sender encrypts a message for a recipient using the recipient's public key.
Explain why the recipient uses the matching private key to decrypt it.
Explain what extra key exchange is needed for secure two-way communication.
Ready for a mixed Topic 2.3 check?
← Topic 2.2 Methods of error detectionComputer Science contentsTopic 3.1 Computer architecture →