I have a case where I have multiple clients (non SGX, assumed safe) and server(SGX based), talking over a network. I wanted to provision a shared (per client) key which is used to encrypt and decrypt data.
The server admin is assumed to be an adversary. I do not want to use remote attestation as it will require every client to register for the IAS service and other sorts of things. Also, the server TLS connection terminates inside the enclave (used mbed-SGX). The client authentication is happening through username and password.
Now, I have few option, I can think of:
Each client generates shared secret key (SK).
Now, is it safe to just directly send each client shared secret key over the network, which is then sealed and stored to disk for later use?
Should I derive a client shared secret from user password inside enclave and then send it over to the client?
Should I derive a client shared secret (SK) from user password one time(at registration probably) inside enclave and then encrypt it with server private key - a different key hard coded into enclave code: (SP-) - send it over to the client which is then decrypted with server public key (SP+)?
- Each of the client application has server public key (SP+) and the server application has each client’s public key (CP+).
- Each of the client application generates the symmetric key (SK) and a challenge (n).
- The client concatenates SK and ‘n’ (SK||n) encrypts with the SP+. The client application now signs the encrypted SK||n and challenge with the client private key (CP-). It is sent to the server application enclave.
- On receiving the signed encrypted symmetric key, the server application enclave checks the authenticity using CP+ and then decrypts with its own private key (SP-).
Could someone just tell me which of these options are safe? If 2 or more option is safe, which one could be easiest to implement.