Let's say that one wanted to store a mapping of social security numbers (SSN) to some data on chain.
Lets imagine that the data related to the SSN is a simple yes/no, true false.
`mapping(bytes32 => bool) ssnMapping`
You also want it so that this data cannot be viewed/interpreted by anyone using a blockchain explorer or eth client.
I had thought that I could just use the private key of the contract deployer to encrypt the data, but of course that means that anyone can use the public key to just decrypt all the data they find on the chain.
Conversely if I use the public key to encrypt the data then sure, that means that the data is only decryptable by the private key holder - however it does potentially leave clues for potential snoopers:
Example:
- smart contract wants to securely store mapping of SSN 1234 to a value of false on the blockchain
- smart contract uses public key to encrypt 1234 and then store this in ssnMapping with value of false.
- lets imagine smart contract becomes successful and well known
- Now lets say a hacker is interested in data that this contract has for SSN 1234. Hacker uses the known public key (of the contract owner/deployer) to encrypt 1234 and simply uses this to interogate the data on chain
maybe I am misunderstanding. I am a bit of an eth noob
[link] [comments]
You can get bonuses upto $100 FREE BONUS when you:
π° Install these recommended apps:
π² SocialGood - 100% Crypto Back on Everyday Shopping
π² xPortal - The DeFi For The Next Billion
π² CryptoTab Browser - Lightweight, fast, and ready to mine!
π° Register on these recommended exchanges:
π‘ Binanceπ‘ Bitfinexπ‘ Bitmartπ‘ Bittrexπ‘ Bitget
π‘ CoinExπ‘ Crypto.comπ‘ Gate.ioπ‘ Huobiπ‘ Kucoin.
Comments