MultiversX Tracker is Live!

Encrypting on chain data - best practice ?

Etherum Reddit

More / Etherum Reddit 239 Views

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

submitted by /u/UsedEstimate
[link] [comments]
Get BONUS $200 for FREE!

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