Scenario:
Every peer sends a private number to the blockchain and the smart contract should add these numbers and publicly share the result. Each node can only see its number.
In a hyperledger numbers are encrypted so users can't view the numbers. But, the smart contract has access to decryption keys which is a must in order to add the numbers. Knowing that the smart contract is replicated to all peers and it is stored locally. So, users have access to smart contracts which by its turn has access to decryption keys. Thus, users can obtain the decryption keys by tampering the machine. If this is the case then it is not completely secure. Am I right?
Question 2: Are private keys stored at all nodes?
Question 3: Can a code be run only be the endorser to limit the number of nodes having the private keys?