University of Newcastle · FACULTY OF COMPUTER SCIENCE

SENG1050 Chap.11 Encryption, Data Integrity and Certificates

- one subject, every graph, every model, every mark
8 Chapters5-page Bible
Our own words - no uploaded lecturer files
Updated for this semester
Chapter 11 of 12 · SENG1050

Encryption, Data Integrity and Certificates

This chapter follows the Week 11 lecture on protecting data. It defines encryption and the four security goals of authentication, integrity, non-repudiation and confidentiality, and shows why Caesar and substitution ciphers fail.

It covers transposition, XOR and symmetric ciphers with their key-sharing problem, asymmetric key pairs and the RSA recipe, hashing and digital signatures, and finally certificates, the public key infrastructure, TLS and PGP. The worked examples use original text and small numbers so the methods can be checked by hand, and every key in them is labelled with its owner.

In this chapter

What this chapter covers

  • 01

    Four goals of cryptography

  • 02

    Caesar and substitution ciphers

  • 03

    Transposition ciphers

  • 04

    XOR and symmetric keys

  • 05

    Public and private key pairs

  • 06

    The RSA recipe

  • 07

    Hashes and digital signatures

  • 08

    Certificates, TLS and PGP

Worked example · free

Choose the right key for confidentiality and for signing

Q [4 marks]. Bob wants to send Alice a contract that only she can read, and Alice wants to prove to Bob that a reply came from her. For each goal, say whose key encrypts and whose key decrypts. The mark allocation here is AskSia's own and is not a University marking scheme.
Confidentiality with a key pair: Bob encrypts using Alice's published public key, and only Alice's own private key turns the ciphertext back into the readable mConfidentiality with a key pair: Bob encrypts using Alice's published public key, and only Alice's own private key turns the ciphertext back into the readable message. Bob writesciphertextAlice reads Alice's public keyAlice's private key
Confidentiality with a key pair: Bob encrypts using Alice's published public key, and only Alice's own private key turns the ciphertext back into the readable message.
  • 1For confidentiality, Bob encrypts with Alice's public key, which anyone may hold.
  • 1Only Alice's private key can decrypt it, so only Alice can read the contract.
  • 1For authentication, Alice signs by encrypting the digest of her reply with her own private key.
  • 1Bob decrypts the signature with Alice's public key and compares it with his own digest; a match shows the reply came from Alice and was not altered.
Confidentiality: encrypt with Alice's public key, decrypt with Alice's private key. Signing: Alice uses her private key on the digest, and Bob verifies with Alice's public key, which shows origin and integrity.
Sia tip — Name the owner of every key you mention: write Alice's public key, never just the public key, so each step is unambiguous.
Glossary

Key terms

Cipher
A cipher is the algorithm used to turn plaintext into ciphertext and back.
Non-repudiation
Non-repudiation is the assurance that a sender cannot later deny having sent a message.
Symmetric encryption
Symmetric encryption uses one shared secret key both to encrypt and to decrypt.
Public key
A public key is the published half of a key pair, used to encrypt and to verify signatures.
Message digest
A message digest is the short fingerprint a hash function computes from a message.
Certificate authority
A certificate authority is a trusted third party that signs certificates binding a public key to an identity.
Session key
A session key is a random symmetric key that PGP and TLS use for the bulk of the data.
Public key infrastructure
Public key infrastructure is the chain of certificate authorities whose signatures let users trust public keys.
FAQ

Encryption, Data Integrity and Certificates FAQ

Why is a mono-alphabetic substitution cipher weak despite its huge key space?

Each letter always maps to the same symbol, so the ciphertext keeps the letter frequencies and patterns of the language. An attacker sorts the symbols by frequency and matches them to common letters such as e and t, without trying the keys one by one.

Why do TLS and PGP use both kinds of encryption?

Asymmetric encryption solves the problem of sharing a key but is slow, while symmetric encryption is fast but needs a shared key. So the asymmetric keys carry only a random symmetric key, and that key then encrypts the actual data quickly.

What does a certificate contain?

A certificate holds the owner's distinguished name and public key, the issuer's name, a validity period, a serial number and the issuer's digital signature. Checking that signature with the issuer's public key, or through a chain of trusted issuers, shows the public key really belongs to its owner.

Why must RSA use large prime numbers?

With small primes the key space is tiny and, as the lab example shows, the private exponent can turn out equal to the public one. Large primes make the modulus hard to factor, which is what keeps the private key secret even though the public key is published.

What is a counterfeit-key attack?

An attacker replaces someone's public key in a directory with their own. Messages encrypted with it can then be read by the attacker, re-encrypted with the genuine key and forwarded, so neither party notices. Certificates signed by a trusted authority are the defence.

Study strategy

Exam move

Draw the key-flow diagrams for confidentiality and for signing until you can label every key with its owner. Work one Caesar, one transposition and one XOR example by hand with your own text. Learn the RSA recipe as a numbered list and run it once with small primes, noting why real keys need large primes. Finish by explaining the counterfeit-key attack and how certificates stop it.

Finally, practise explaining in three sentences why TLS sends a symmetric key inside asymmetric encryption.

Working through Encryption, Data Integrity and Certificates in SENG1050? Sia is AskSia’s AI Computer Science tutor — ask any SENG1050 Encryption, Data Integrity and Certificates question and get a clear, step-by-step explanation grounded in how SENG1050 is taught and assessed. Read this chapter free, then take your hardest questions to Sia.

A+Everything unlocked
Unlocks this Bible + all 14 of your University of Newcastle subjects - and 1,000+ Bibles across every Australian university.
Sia - your SENG1050 tutor, unlimited, worked the way the exam marks it
The full 5-page Bible + practice bank with worked solutions
Chrome extension - sync your LMS so Sia knows your deadlines
Bilingual EN / Chinese on every Bible and every Sia answer
$0.99 Trial
30-day money-back · cancel in one tap · how it works