[Bonus question, points 5]
Suppose that Angela and Bill live in two different islands and can
communicate only by exchanging packages. Each of them also has various
chains and locks and a key for each lock. A lock can be opened only by its own
key, and there is only one copy of the key.
The mailman can deliver packages from Angela to Bob and viceversa, but
is dishonest and can open and steal or replace the content of any
package which is not chained and locked.
- How can Angela send something to Bill, assuming that the mailman do
not owns any chain/lock/key?
- How can the mailman steal the content of the package sent by Angela, if he owns a
chain with lock and key?
Angela send a package chained and locked. She keeps the key of the lock, say KA.
When Bill receives the package, he adds another chain and lock and keeps the key of
this new lock, say KB. Bill then sends the package back to Angela.
When Angela receives the package, she removes her chain by unlocking the corresponding lock
with KA. Then she sends the package back to Bill. Finally, Bill can open the package by using
KB to unchain it.
- When Angela first sends the package, the mailman can add his own chain and lock with key KM.
Then return the package to Anne, pretending that it comes from Bill. Angela will then remove her own chain and
send the package to Bill again, via the mailman. The mailman can now remove his own chain with KM
and open the pachage.