Hannu A. Aronsson
Department of Computer Science
Helsinki University of Technology
haa@cs.hut.fi
1. Introduction
Zero-knowledge protocols allow identification, key exchange and other
basic cryptographic operations to be implemented without leaking any
secret information during the conversation and with smaller
computational requirements than using comparable public key
protocols. Thus Zero-knowledge protocols seem very attractive
especially in smart card and embedded applications.
There is quite a lot written about zero-knowledge protocols in theory, but not so much practical down-to-earth material is available even though zero-knowledge techniques have been used in many applications.
Some of the practical aspects of zero-knowledge protocols and related issues are discussed, in the mind-set of minimalistic practical environments. The hardware technology used in these environments is described, and resulting real-world practical problems are related to zero-knowledge protocols.
A very lightweight zero knowledge protocol is outlined and its possible uses and cryptographic strengths and weaknesses are analyzed.
2. Zero-knowledge Protocol Basics
Zero-knowledge protocols, as their name says, are cryptographic
protocols which do not reveal the information or secret itself during
the protocol, or to any eavesdropper. They have some very interesting
properties, e.g. as the secret itself (e.g. your identity) is not
transferred to the verifying party, they cannot try to masquerade as
you to any third party.
Although Zero-knowledge protocols look a bit unusual, most usual cryptographic problems can be solved by using them, as well as with public key cryptography. For some applications, like key exchange (for later normal cheap and fast symmetric encryption on the communications link) or proving mutual identities, zero-knowledge protocols can in many occasions be a very good and suitable solution.
2.1 The parties in a Zero-knowledge protocol
The following people appear in zero-knowledge protocols:
2.2 Zero-knowledge terminology
The secret means some piece of information, be it a password,
the private key of a public key cryptosystem, a solution to some
mathematical problem or a set of credentials. With Zero-knowledge
protocols, the prover can convince the verifier that she is in
possession of the knowledge, the secret, without revealing the secret
itself, unlike e.g. normal username-password queries.
Accreditation means the building of confidence in each iteration of the protocol. If in one step of a zero-knowledge protocol, the chance of an impostor being able to provide the answer is 1 in 2, the chances of her passing an entire conversation are 2^-(number of accreditation rounds).
Often the prover will offer a problem (i.e. particular numeric values for a generic hard-to-solve mathematical problem, e.g. factoring extremely large numbers, which are products of large primes) to the verifier, which will ask for one of the 2 or more possible solutions. If the prover knows the real solution to the hard mathematical problem, she is able to provide any of the solutions asked for. If she doesn't know the real solution, she can not provide all of the possible solutions, and if the verifier asks for one of the other solutions, she is unable to provide it, and will be found out.
Cut-and-choose protocols work in the way, that one failure means the failure of the whole protocol (i.e. that the prover is not legitimate), but you can keep working on the protocol as long as you want, if the prover is legitimate. After you reach the level of confidence you need without being cut off, the protocol is successful.
2.3 Features of Zero-knowledge Protocols
Zero-knowledge protocols can be described as cryptographic protocols
having the following special features:
2.4 Modes of Operation
The zero-knowledge protocols can be used in three main modes.
Interactive, where Peggy and Victor interactively go through the protocol, building up the certainty piece by piece.
Parallel, where Peggy creates a number of problems and Victor asks for a number of solutions at a time. This can be used to bring down the number of interactive messages with a slow-response-time connection.
Off line, where Peggy creates a number of problems, and then uses a cryptographically strong one-way hash function on the data and the set of problems to play the role of Victor, to select a random solution wanted for each problem. She then appends these solutions to the message. This mode can be used for digital signatures .
2.5 Computational Requirements
Many sources claim that Zero-Knowledge protocols have lighter
computational requirements than e.g. public key protocols. The usual
claim is that Zero-Knowledge protocols can achieve the same results
than public key protocols with one to two orders of magnitude less
(1/10 1/100) computing power.
A typical implementation might require 20 30 modular multiplications (with full-length bit strings) that can be optimized to 10 20 with precalculation. This is much faster than RSA.
The memory requirements seem to be about equal - to have very high security with Zero-knowledge protocols, you will need very long keys and numbers, so in memory terms, the requirements may not be very different.
Zero-Knowledge mechanisms let you split the protocol into an iterative process of lighter transactions, instead of one heavy transaction.
It seems possible to create a protocol with (many) very light iterative rounds, minimizing the computation and memory requirements of the protocol at any one time. More on this as we go along.

They work as follows:
This example also demonstrates another feature of zero-knowledge protocols: Now Victor is convinced that Peggy knows the secret password, but he cannot convince anyone else himself, as he doesn't know the secret!
Let's say that Victor would videotape the operation. But that recording can't be used to convince anyone else, as it looks just the same as a faked videotape, where a mischievous verifier and the prover agreed in advance which passage the prover should come out each time.
So, Victor can't even convince others, just himself, about Peggy knowing the secret. Absolutely no information flowed to Victor in the protocol.
Victor shows Peggy a scrambled Rubik's cube and asks for a proof of her skill to solve it. Peggy shows Victor a new, scrambled Rubik's cube. Victor can then choose to ask either
Knowing both parts of the solution means that you can solve the cube, i.e. you know the secret. This is why Peggy must always present a differently scrambled cube in each round, because if Victor gets both answers to a single problem, he gains the knowledge of how to solve the cube in that case.
3. Zero-Knowledge Protocol Theory
This paper, in it's practical approach doesn't cover the theoretical
background in a lot of detail. Readers interested in the exact heavy
theory behind zero-knowledge issues are directed to the comprehensive
references, e.g. Schneier's book Applied Cryptography
[3].
The textbook protocols work with relatively theoretical mathematics, and looking from a practical perspective it's not always so clear how they can be applied in real life applications.
Like other cryptographic protocols, zero-knowledge protocols base themselves on the usual crypto math, e.g. modulo calculation, discrete mathematics, extremely large numbers (hundreds or thousands of bits), etc.
3.1 Cryptographic Strength
The cryptographic strength of zero-knowledge protocols is based on a
few hard-to-solve problems, e.g:
Other, but only theoretically interesting, impractical problems are used in the theoretical protocols.
3.2 Contingency plans for protocol failure?
The same problems are used as the security base of public key
protocols, so if an easy solution to any of these problems is found,
large groups of cryptographic protocols become obsolete overnight
(over a microsecond, you'd better think).
Surprisingly, I haven't seen a designed-in feature in any cryptosystem to handle the case of the cryptographic bottom of the system falling out, e.g. a planned course of action in the system for that case.
A lot of your data may need secure retention for many years. Some people say that NSA is 10 years ahead of others in cryptography and cryptanalysis; think about what everybody may be able to do in 10 years?
We don't know if these problems will be broken ever. To play safe with the ever-increasing computation power, you should at least choose keys that are long enough in your time perspective.
In this paper, though, we look at the practical application of quite short keys (minimizing memory requirements) and try to supplement the weak security of that approach with time limits and other practical techniques.
3.3 Which Problems can be Used in Zero-knowledge Protocols?
This point is mainly theoretical, but gives a scope on what can be
used as the problem (to be proved in each round) in these
protocols.
If one-way functions exist, any problem in NP has a zero-knowledge proof. The existence of one-way functions is the weakest assumption for strong encryption's existence [2].
The digital signature protocols rely on the quality and randomness of one-way hash functions.
4. The Zero-Knowledge Protocols Themselves
In this chapter, we look at existing and proposed zero-knowledge
protocols and the typical ways these protocols work, and what kind of
basic building blocks are used to build these protocols. Many of the
basic ideas can be used for several different kinds of protocols.
4.1 Proof of Knowledge
If Peggy has non-negligible chance of making Victor accept, then Peggy
can also compute the secret, from which knowledge is being proved.
The Ali Baba's Cave -example is an non-computer example of a zero-knowledge proof of knowledge. One problem that is often used in zero-knowledge proof-of-knowledge protocols is the knowledge of a discrete logarithm of some large number.
4.2 Proof of Identity, Identification
The protocol must ensure, that nobody can masquerade as Peggy or
Victor for any other third party. Also, we want to avoid
man-in-the-middle attacks, as described in the Chess Grand master
Problem:
She could set-up a two-room game, inviting the top two players to play with her. She would place each one in a separate room, and then play exactly the move the other chess master did to the other and vice versa. Both masters would think they're playing against Alice, even if they're really playing against each other. She would at least appear to be a strong player if not winning. She doesn't even have to know the rules of the game, chess.
This man-in-the-middle attack can be used against some of the Zero-knowledge proof of identity protocols. One counterattack to the man-in-the-middle attack is imposing time limits for the replies, in the hope that there is not enough time for the man in the middle to relay the communications.
The so-called Mafia fraud does the same, intercepting electronic payment messages to cheat a person proving his identity when paying at a cheap restaurant into "proving" his identity elsewhere to buy e.g. expensive jewels for the criminals.
There is also the potential problem of multiple identities , if the system does not guarantee that each person has only one identity. Alice could create several identities, and commit crimes using some identity only once, which could never be traced back to her.
Also, it might be possible to rent or sell identities, i.e. Alice could sell her private key to someone else, who could then masquerade as her. This works, because what is being actually proved is that you know some piece of information (a bunch of bits), not really who you are. This is also a more generic problem.
4.3 Feige-Fiat-Shamir Proof of Identity
This is the best-known zero-knowledge proof of identity
protocol . The history of this protocol has a fun sidetrack, when
NSA (in USA) tried to stop the authors (non-americans who did the work
outside USA) from publishing their work.
A simplified version of this protocol works as follows (we present the full protocol here to give a taste of what most of these protocols look like. The rest will be handled in a more overviewing fashion):
Victor can't try to masquerade as Peggy to another verifier, as the bit Victor randomly sent to Peggy earlier has only a 50% chance of being the same as the second verifier will ask for.
In this protocol, Peggy should never reuse an r. If she did, Victor could send her the other random bit, and collect a set of both responses. Then, if he had enough of these, he could try to impersonate Peggy to an outsider.
This protocol can be implemented in a parallel fashion, making the public and private keys be a set of quadratic residues mod n, etc. Then you can do as many rounds in parallel as you have keys in the set, speeding up the protocol (but with larger memory requirements) and needing fewer messages.
4.4 Guillou-Quisquater Proof of Identity
This protocol is more suited to smart card applications, as it tries
to keep the size of each accreditation (i.e., each round) to a
minimum. But it does require about 3 times the computational power of
the Fiat-Shamir protocol.
This protocol requires that the prover have the following: A bit string of credentials J (card ID, validity, bank account number, ...) used as the public key, and application-specific pieces of public information, an exponent v and a modulus n , which is the product of two secret primes. The private key B is calculated so that JB^v = 1 (mod n). The protocol goes as follows:
4.6 Key Exchange
A protocol can be devised where RSA public key -based
identification is combined with zero-knowledge properties and key
exchange (for a session key). Victor can encrypt a random number with
Peggy's public key, and if Peggy can decrypt it with her private key,
she is identified. A one-way hash function is used to hide the
returned decryption so that Victor can't use Peggy to decrypt any
message he wants. Victor can only check that the output of the hash
function matches what Peggy sent him. A session key can be placed in
the random number in some bits that are never sent in clear over the
channel [2].
4.7 Digital Signatures
Most of the zero-knowledge protocols can be turned into a digital
signature protocol, if Victor is replaced by a cryptographically
secure one-way hash function.
Peggy can create a number of problems, use the one-way hash function as a virtual Victor (which will randomly request one or the other solution to each problem, if the hash function is cryptographically good) and provide those answers.
As input to the one-way hash function, the message and the problems presented to Victor are used. This way, neither the message or the problems can be changed without making the signature void. The output of a good crypto-grade one-way hash function is completely random and unpredictable, so Peggy can't try to tweak the inputs to the hash until she gets suitable values permitting forgery.
The receivers can calculate the hash function themselves, check that the correct solutions were provided and that the solutions were valid. If so, then the signature can be considered valid.
With the Guillou-Quisquater signature scheme you can do multiple signatures easier than having everyone sign the document separately: The basic idea is that both signers compute their own J and B values, which are used together to build the signature.
Using this to build a zero-knowledge protocol, the prover's secret is the Hamiltonian cycle of a graph.
The prover gives the verifier a permuted version of the original graph, and the verifier can ask for either
This protocol is theoretical because of the requirement for the graph to be extremely large, and the large memory and message size requirements it has.
5. Zero-knowledge Protocols in Practice
In this part, we consider the practical aspects of zero-knowledge
protocols. The presented textbook protocols are still relatively heavy
to calculate.
Applying these protocols to the real world can be challenging, especially given the constraints of embedded computing. The promise of lighter calculations than public key protocols makes studying this very interesting and potentially very useful.
Let's look at these topics in more detail.
5.1 Real Computational and Memory Requirements
The textbook protocols still require calculations on long keys (in the
order of hundreds or over a thousand bits) in their textbook
usage.
So the computational requirements are still pretty heavy for small-scale applications. The theoretical protocols are clearly too heavy for many minimalistic embedded solutions. Anyway, the promise of a lighter-weight protocol for many common needs, is worth looking into.
If the application permits using conventional symmetric algorithms (e.g. DES), those are still greatly lighter to calculate. There are other security problems in using symmetrical cryptography in e.g. smart cards, which are discussed in more detail below.
If you can only replace one big and very expensive but definitive public key transaction with a series of big and expensive rounds of zero-knowledge transactions, it might not be worth the trouble.
Here is a summary of the requirements of different cryptographic protocol families and their calculation and memory requirements:
| Protocol Family | Message Size | Protocol Iterations | Amount of Calculation | Memory Requirements |
|---|---|---|---|---|
| Zero-knowledge | large | many | large | large |
| Public-key | large | one | very large | large |
| Symmetric | small | one | small | small |
There is no clear choice for all applications. Especially in small environments, the available computing power and memory is often a limiting factor in the selection of cryptographic techniques.
5.2 Useful Applications
Smart-card applications are often mentioned as good places to use
zero-knowledge protocols, because they are lighter to compute than the
usual public key protocols.
You would think that it would be good if your electronic cash card, your medical information card, intelligent key and lock systems, etc had real security to protect the information on them, the access to them, and your identity.
Many embedded and most smart card systems could use some degree of real security.
Because of the lack of computing power and good algorithms, most satellite reception decryption cards only use very simple cryptographic techniques, such as feedback shift registers etc. Most of these systems have been broken and pirate cards (and pirated pirate cards) are quite widely distributed.
Some digital cash experiments rely on shared secrets or keys stored on the cards (e.g. a symmetric algorithm such as DES is used), which requires that the manufacture of the cards is tightly controlled and the system is still vulnerable to a serious reverse engineering attack.
5.3 Breaking Smart Cards, A Reality Check
The technology to read protected memory or reverse-engineer smart card
CPU's and memories is surprisingly good and it is often quite easy to
do.
Even some of the so-called security CPU's used in smart card applications can be read (both code i.e. algorithm, and data i.e. keys), sometimes with
If a single smart card technology is used widely enough, the incentive of breaking it can become very high. For example, if a European Union -wide electronic cash card would be introduced, the incentives for criminals and organized crime to break it would be very large indeed.
Even with the so-called secure smart card technologies, you can't expect total physical security for your code (algorithm) or any data (keys) on the card.
This is especially bad news for systems based on symmetric cryptography techniques, as the single key used both for encryption and decryption could be recovered from any of the many cards in circulation. This is why smart card applications need public key or zero-knowledge protocols and solutions.
This is also a problem for the Clipper chip proposal from NSA. If the Clipper would become mandatory and other crypto would be banned (as planned), the incentive for breaking it would also become extremely high, and somebody would surely pop the Clipper chip system open (however much it would cost) and find out the supposedly secret algorithm and any embedded keys for analysis.
5.4 Embedded Applications Need (Some) Security Too
Many embedded applications could use some level of real security. For
example, remotely controlled car door locks, garage doors, TV remotes,
remotely controlled model airplanes, could be made more secure by
using real cryptographic security techniques in them.
Most of the time these applications are also extremely cost limited: They use the cheapest, $1-$2 price scale embedded controllers, which don't have much memory or computing power.
We are not aiming to build a totally 100% secure system here. We should keep in mind the trade-off between cryptography, resources and the required level of security. In many embedded solutions it may be enough to provide a system safe enough, for the particular application, and given the attack scenarios.
For applications where you need total security (e.g., digital cash), the protocols you need are quite heavy and would require high-end embedded controllers or smart cards, and very complex public key or zero-knowledge protocols, which are outside the scope of this paper.
The computing power of these RISC pipelined controllers is around a maximum of 10 20 MIPS (instructions working on 8-bit data).
The working memory resources of chips in this family are from 24 to 256 bytes of RAM. Some models come with 64 bytes of EEPROM, which could be suitable for key and secret storage. The program memory capacity ranges from 512 instructions to 4096 instructions.
A typical widely-used model, the PIC 16C84, has a program memory of 1024 instructions, 36 bytes or scratchpad RAM, 64 bytes of EEPROM (nonvolatile) memory and a maximum performance of about 3 MIPS. This is our example target environment.
It's noteworthy to say here that the 16C84 chip has been found vulnerable. By using non-standard programming voltages, you can trick the chip into a mode that will allow you to clear the memory protection bit without clearing out all of the memory simultaneously (as would happen if it worked to its specification). As the 16C84 is a popular chip used in many applications, the vulnerability is rather serious, from the security viewpoint, as well as from the code copyright viewpoint.
Many other manufacturers also have comparable embedded controllers. These controllers sell a lot in the world. They are the kind of thing you can find in your computer mouse or microwave oven and other such little devices all around us.
6. A Minimalistic Zero-knowledge Protocol
6.1 Principles
In this paper we analyze a protocol with some degree of security and
hopefully minimalistic resource use. We are willing to sacrifice some
security for the simplicity of implementation and light resource
use.
In a cryptosystem, the level of security required is a balancing act between apparent threats. We only need to make the breaking of the system not worth the perpetrators time and resources. For "boring" embedded applications, this security level is not necessarily very high.
We shall analyze a protocol where
If the iteration round is light enough, we can possibly iterate many times to establish the credentials for the connection. If the embedded controllers used in the system are pretty fast, the resources required for an outsider to break the protocol by brute force would become be high enough to prevent attacks.
The approach of limiting allowable response time is also used in some existing protocols to avoid man-in-the-middle attacks (e.g. the Chess grand master problem or the Mafia fraud).
6.2 Implementation
As the chosen example target environment only has about 36 bytes of
RAM available for the inner working of the protocol, and some RAM
space must be reserved for other use, it seems that the key lengths
and numbers used in the protocols must be within 32 to 64 bits (4 to 8
bytes) in length.
A 64-bit system should be strong enough to thwart most brute force attacks (e.g. DES keys are 56 bits). A 32-bit system is already suspectible to attack, as current desktop computers can have gigabytes of memory space to use. 64-bit key-space should be pretty good.
Every phase of the protocol must complete within a given time limit, just enough for the legitimate secret holder to calculate the reply, and transmit it. It is hoped that this time restriction will make man-in-the-middle and brute force attacks unfeasible.
A superior computing power intruder might realistically have 3 to 5 orders of magnitude more computing power than the legitimate system. Even if the brute-force calculation is fast, you will need to be able to break the problem within the given time limit, always. Making sure a brute force attack is unfeasible, it should be enough to make a brute-force attack take 10 or so orders of magnitude more computing power, i.e. a few bits worth of magnitude.
Victor must provide some random input for Peggy's problem, so that an impostor is not able to precalculate some set of problems and both solutions using his superior computing and memory resources.
As Peggy's problem is changed by the number given to her by Victor, she can't pre-build a set of problems and solutions to them.
The time limits set in the protocol should make this attack unfeasible.
This attack is possible on other protocols too, but because this protocol uses a relatively weak single round, the possibility of this attack succeeding might make it a real danger to the security of this protocol.
One economical solution might be to look at the applications of this protocol: Non-critical embedded systems, each with their own secrets. It may not be economical for someone to break the system, if the possible benefits are very small.
Breaking a 64-bit secret is still relatively formidable effort by brute force, so in the environment where this protocol would be used, it should be enough.
Note that some of the numbers used in zero-knowledge need to have some special features (e.g., being prime), the brute force attack on this system may be much easier than the brute force attack on a conventional symmetric cryptosystem with 64-bits of real random key.
For example, if you know that breaking the secrets would take several days on a very powerful computer (you could even try it yourself in advance on your own system), you could, anyway, use these protocols in a one-day event for access control smart cards, with almost total confidence. When the adversary breaks the code, the particular secret(s) is (are) not in use any more.
6.4 Conclusions
The post-mortem calculation attack is a real risk with any weak or
weakened cryptosystem. If the keys or secrets are not changed often,
a malicious Victor or Peggy, or third-party eavesdropper may be able
to find the secret by doing a brute-force attack on the recorded
conversations. Especially in the case of minimalistic solutions, where
the key length has been minimized because of real-world hardware
limitations, it becomes a serious problem.
By balancing the security needs, applications and system capabilities it may still be possible to build systems with relatively good security, instead of no security as in most current systems.
It is evident from this study, that implementing real security does have quite large computational and memory requirements. So, in applications where good security is necessary, high-powered embedded controllers should be selected, so that they can work with the full-strength cryptographic protocols.
Another possible solution would be to use symmetric-key cryptography protocols (which have relatively small computational and memory requirements), with designed-in features for the eventual loss of key secrecy through reverse engineering.
Joining theoretically good cryptographic techniques and protocols with real world limitations of small systems is sometimes extremely hard. Most studies are based on the availability of enough computing power and memory.
When you try to apply these techniques in very small systems, you will have to make compromises. Knowing the strength of your protocols, keys and the hardware and being able to balance and apply the system to your actual needs will be even more important than in traditional cryptographic applications.