What are examples of things that use digital signatures as a building block?
Let's attempt at an authentication protocol based on digital signatures, similar to what
ssh must do (in part,
ssh also does other things like ensuring confidentiality of communications):
- A generates a public key and a private key, publishes the public part.
- B associates A's public key to an entry in a list of authorized users on server C.
Now how can A access C while guaranteeing the exclusion of unauthorized users?
- A signs a message that says "I am A", and sends to C.
- C checks if the message is of the form "I am X", where X is an authorized user, and if it is validly signed by the public key associated with that user. If both of these things are true, access is granted.
Oops, this doesn't work! If an eavesdropper gets a copy of the signed "I am A" message (and it's signature), then the eavesdropper can replay it even though they are not A and they do not have the private key that would allow them to sign a different message.
- C generates a random number R, and sends it to A.
- A signs a messages that says "I am A, and the random number was R".
- C checks the signature validity, and if the message repeated the chosen R for the same authorized user, access is granted.
Now an eavesdropper cannot passively capture traffic and replay it later to get access; attacks must take place in real time. Some improvement has been made! This scheme still has a lot of flaws though - it's not secure against active attacks. Moreover, an active attacker can try to connect to a different server that A is authorized on, and substitute the R value when A tries to connect to C, thus getting back a signed message that allows the attacker to connect to a potentially higher-sensitivity server. Double oops!
So hopefully you can see that digital signatures by themselves do not completely solve any real-world problem, but protocols that solve real-world problems can be built on top of digital signatures and other primitives.