SENG1050 Chap.11 Encryption, Data Integrity and Certificates
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.
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
- 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.
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.
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.
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.