i have user specific data in a table on my smart contract that i don't want others to see. Can i encrypt that data with a public key of the user? If possible then how to encrypt that data with the public key ?Then how will the user decrypt that data with their private key?

  • Do you want to retrieve the public key directly from the smart contract? Then, what encryption would you like to use? Try to look at this link: github.com/EOSIO/eosjs-ecc/issues/19 – damianodamiano Sep 15 at 12:34
  • if you do't want other to see your table and table is not a abi action define your table private , and if table is abi action than you can put the required authority to yourself.Encryption is a better option but it may cost you more ram (as encription require computation ) – Nirdesh Kumar Choudhary 2 days ago
  • //@abi table tb i64 struct table { uint64_t id; uin8_t num; unit64_t primary_key() const { return id ;}}; . I want to hide the num variable so that others cant get this using cleos get table command line .Also this piece of code is in private sction of my contract line .So any way to prevent others from getting the value of num variable? – kstnew yesterday
  • //@abi table tb i64 struct table { uint64_t id; uin8_t num; unit64_t primary_key() const { return id ;}}; . I want to hide the num variable so that others cant get this using cleos get table command line .Also this piece of code is in private part of my contract class .So any way to prevent others from getting the value of num variable? – kstnew yesterday

Your Answer

 

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Browse other questions tagged or ask your own question.