I have some sensitive data I'd like to keep in my contract in privacy. I'd like to make a simple version of Zero-Knowledge Proofs and have an idea in mind. Let's say I have a customer who filled out 6 fields in my dapp:
- First Name as attr1
- Last Name as attr2
- Birthdate as attr3
- Phone number as attr4
- Passport number as attr5
I am makinghash1=SHA2(attr1+attr2+attr3+attr4)
hash2=SHA2(attr1+attr2+attr3+attr5)
and store it in a map where hashes=[hash1,hash2]
A third party could hash its dapp input using my scheme,query my contract and check if my dapp had this client. If true it can get metadata about found client, e.g. a credit score.
My questions are:
- what do you think about this simple ZKP scheme? do you have any other ideas how to realize it?
- how easy will it be for an attacker to make a lookup table with all hash1 or hash2 variants (most important question)
- should I keep hash1/hash2 scheme in secret?
Trying every firstname+lastname+birthday+phone would be almost impossible even for a supercomputer.
Even knowing firstname and lastname, there are millions of possible phone numbers (lets say e7 {ten to the power of seven) but 365 days for every year (lets say 100 years), that means 365.000.000.000 for a single result. Well, this can be done with modern computers in short time.
Now think about how many possible names (in different languages) there are, and lastnames.
So, It's almost impossible even for supercomputers.
– KanekiDev Oct 17 '16 at 09:38