Closed robertjchen closed 8 months ago
Thanks and wuhuu! 🚀🎉
Are we still thinking about adding signing and verifying functionality with Dillithium?
Great q, I think we'll still need it down the line 🤔 We'll see how things pan out in planning now that the priorities are clear
cc: Margelo
Please implement a custom encryption library to be used as part of the new End to End Encryption feature in the App.
Namely, it will provide symmetric (AES) and asymmetric (RSA4096 + Kyber1024) encryption functions to be used by the App as well as in the backend.
Please refer to the planning doc for additional context!
Considerations
wasm
binary for direct use in the Web client.Proposed Interface
// synchronous mockup, but final solution may be asynchronous as well 👍
KEMGenKeys()
- return a JSON object in the format of:For the following functions, the
pubKeys
andprivKeys
arguments should be provided in JSON format:KEMEncrypt(pubKeys, dataString)
- encrypts a given stringRSA4096_Encrypt(Kyber1024_Encrypt(dataString))
given the pubKey set (input string should be padded behind the scenes if necessary, etc.). ThepubKeyHash
should be a hash of the two public keys combined. The result is the raw encrypted string in base64 format (note that this is directly encrypted by RSA4096 + Kyber1024, not AES!)KEMDecrypt(privKeys, dataString)
- decrypts a given string given the privKey set (input string should be padded behind the scenes if necessary, etc.)KEMSign(privKeys, dataString)
- signs a given string given the privKey set (see doc for additional implementation notes)KEMVerify(pubKeys, dataString)
- verifies the signature of a given data string given the pubKey setAESDecrypt(iv, key, data)
// simple symmetric encryption w/ AES-GCMAESEncrypt(iv, key, data)
// simple symmetric encryption w/ AES-GCM