# Digital signatures as a building block?

I was reading Bruce Schneier's book Applied Cryptography, and he makes a comment about Digital Signatures, that they can be used as a building block for more advanced protocols.

What are examples of things that use digital signatures as a building block?

• Payment, voting and authentication – eckes Mar 29 '17 at 21:27

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?

First try:

• 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.

Second try:

• 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.

Key distribution protocols, PKIs, document authentication, general authentication and/or identification protocols, times tamping protocols...