I am writing browser javascript that has a pre-shared key with nonce, and creates a binary websocket connection. How can I apply block encryption-authentication such as AES-GCM to the messages?
Is it possible to tell the browser to skip the PKI handshake on wss://
, or do I have to actually import a javascript cipher package? (If the latter, what is the performance like?)
(If the solution involves providing a certificate explicitly in the client WebSocket
object, then we also need to be sure that it works with multiple users that don't trust one another. In other words, we'd need a way for the client to tell the server which certificate to use. I am not aware of such a mechanism in SSL, so I'm guessing that PKI needs to be bypassed entirely.)