EspeoBlockchain / gardener-server

Node.js server for Gardener open source oracle project
MIT License
29 stars 6 forks source link

Use SGX Sealing to encrypt random values generated by Enclave #63

Open kss-espeo opened 4 years ago

kss-espeo commented 4 years ago

Currently, a process of generating random value in Enclave is vulnerable to man-in-the-middle attack - should attacker take control of a machine that hosts gardener-server, he could replace generated value with one of his choice.

To remedy that, we should use SGX Sealing mechanism to hardcode user's public key (assymetric cryptography, does not necessarily have anything to do with blockchain keys - even though it could) . This public key would be used to encrypt generated data in enclave and send it to the user - decrypting value with his private key would be user's responsibility.

Potential security risk: attacker could take control of user's public key, intercept gardener-server machine and generate encrypted value. This means that IF such attack is feasible, then instead of just hardcoding user's public key, we could go for Diffie-Hellman Key Exchange.

Finishing this task is the last milestone for SGX implementation in the context of RNG for gambling, since having it guarantees that the only Third Trusted Party in entire RNG process is Intel - user does not even have to trust a party that hosts gardener-server.