25-Comp-B10 Distributed Systems · May 2015
Nivaar worked solution (AI-drafted; not reviewed by a licensed engineer)
Question text not reproduced: the examination questions are © Engineers and Geoscientists BC. Open the official past paper (linked at the top of this page) to read the question, then follow the worked solution below.
(a) PGP setup steps for privacy and authenticity. Before Alice and Bob can exchange email with both confidentiality and authenticity guarantees, the following must be in place: (1) Key-pair generation. Each user generates their own public/private key pair (traditionally RSA or a similar asymmetric scheme) and keeps the private key secret, protected locally by a passphrase. (2) Public-key distribution. Each user makes their public key available to the other — via a public key server, attaching it to an email, or direct exchange. (3) Authenticity verification of the received key (the critical, often-skipped step). Because a key obtained over an untrusted channel is vulnerable to a man-in-the-middle substitution, each user must verify the other's public key genuinely belongs to them before trusting it — PGP's usual mechanism is the web of trust: other users who have already verified a key (e.g. by comparing its fingerprint in person) sign it with their own private key, and Bob trusts Alice's key if it carries enough such signatures from people Bob already trusts, or Alice and Bob verify each other's key fingerprint directly out-of-band. Only once this is done can messages that follow be trusted to actually be exchanged with the intended party rather than an imposter.
With both keys generated, distributed and verified, an actual message is protected as follows, achieving both properties the question asks for: privacy is provided by the sender generating a random one-time session key, encrypting the message body with that session key using fast symmetric encryption, then encrypting the (short) session key itself with the recipient's public key and attaching it — only the recipient's private key can recover the session key and hence the message; authenticity is provided by the sender computing a hash (digest) of the message and signing that digest with their own private key before sending it, so the recipient can verify (using the sender's already-trusted public key) that the message truly came from the claimed sender and was not altered in transit. PGP performs both operations together on outgoing mail (sign-then-encrypt), so a single exchanged message carries both guarantees simultaneously.
(b) Estimating DES and IDEA brute-force cracking time.
Given. A 56-bit DES key and a 128-bit IDEA key; a brute-force trial costs 15 instructions per key value (this figure is taken to already include the work of encrypting the 8-byte test plaintext with the candidate key, as no separate per-block instruction count is given); attacker computers of 3000 MIPS and (after extrapolation) 300,000 MIPS.
| Quantity | Value |
|---|---|
| DES key length | 56 bits |
| IDEA key length | 128 bits |
| Instructions per key trial | 15 |
| Attacker computer speed (case 1) | 3000 MIPS |
| Attacker computer speed (case 2) | 300,000 MIPS |
Find. The estimated wall-clock time to brute-force a 56-bit DES key and a 128-bit IDEA key, at 3000 MIPS and at 300,000 MIPS.
Approach. Take the expected number of keys a brute-force search must try before finding the right one as half the key space, $2^{n-1}$ for an $n$-bit key (the attacker is expected to find the key on average halfway through an exhaustive, non-repeating search); multiply by 15 instructions per trial to get total instructions, then divide by the computer's instruction rate.
| Key / attacker | 3000 MIPS | 300,000 MIPS |
|---|---|---|
| 56-bit DES | ≈ 5.71 years | ≈ 20.85 days |
| 128-bit IDEA | ≈ 2.70×1022 years | ≈ 2.70×1020 years |
The hundred-fold speed-up moves 56-bit DES from a multi-year effort to a matter of weeks — well within reach of a well-resourced attacker or consortium, which is exactly the historical argument for retiring DES in favour of longer keys (Triple-DES, then AES). By contrast, no realistic increase in computing power makes 128-bit IDEA brute-forceable: even a further hundred-fold speed-up beyond 300,000 MIPS would still leave a cracking time many orders of magnitude longer than the age of the universe, because doubling the key length squares the size of the search space rather than merely doubling it.