I am trying to build a system that would allow information sharing in a kind of zero-knowledge way. Here is the set up:
- Let's say there is a trusted third party that has Alice's sensitive info M (e.g. date of birth). This 3rd party encrypts M, so C = E(M, a) where a is a secret key. After that, the 3rd party makes C public (e.g.publishes on their website). Also, the 3rd party shares a with Alice.
- Alice would like to give her DOB to Bob, but in such a way that Bob would not be able to give her DOB to anyone else.
This can be achieved using an interactive zero-knowledge system that would work like so:
Assume E is an encryption function and U is a decryption function, such that:
- C = E(M, a), where a is a secret key
- X = E(C, b), where b is another secret key
- M = U(C, a) and C = U(X, b) - basically, the keys can be used to decrypt the values they encrypted
- M = U(X, ab), where ab is some way of combining both keys together so that separating ab into a and b is impractical
With this setup, Alice can generate a random key b1 and compute X = E(C, b1). She can then give X to Bob, who in turn would ask Alice to reveal one of the following:
- b1 - this would allow Bob to verify that X was derived from C because C = U(X, b1)
- ab1 - this would give Bob Alice's DOB because M = U(X, ab1)
They repeat this process but now with new secret keys b2, b3 ... bn until Bob is satisfied with the level of confidence. At the end, Bob will know Alice's DOB, but he wouldn't be able to prove to anyone that this is in fact her DOB.
My Questions are:
- Is there a better way to share info between Alice and Bob in such a way that Bob can be sure he has Alice's correct DOB, but he wouldn't be able to prove it to anyone else?
- If this is the best way, what is the right encryption/decryption function to use so that you can combine 2 keys together in the way described above?