In the example it is described how a user has to encrypt a file client-side.
- generate plain file key
- encrypt bytes/file (AES 256 GCM)
- encrypt file key (with public key of keypair)
I don't think a user should worry about how to encrypt a file client-side.
I think it is safer to replace these three functions by one function (see e.g. box function of nacl/libsodium or Hybrid encryption of tink)
encrypt_file(file, plublic key):
return enc_file, enc_file_key, (file_key)
Probably the function must also return the plaintext file_key to be able to distribute it to the other users.
In the example it is described how a user has to encrypt a file client-side.
I don't think a user should worry about how to encrypt a file client-side.
I think it is safer to replace these three functions by one function (see e.g. box function of nacl/libsodium or Hybrid encryption of tink)
Probably the function must also return the plaintext file_key to be able to distribute it to the other users.