I really just need an encrypted support ticket system essentially. The user who writes the ticket doesn't need to be able to view it afterward but a handful of staff need to be able to decrypt the data and view it. My backend is Firebase (using Firebase Authentication as well) and the users will be submitting information via the mobile app and the staff will be viewing the information on a web app. Ideally, the encryption/decryption would be done on the client-side.

  • 1
    Public-Key Cryptography.
    – kelalaka
    Jan 15, 2021 at 9:03
  • 1
    It's not clear to me what you are trying to accomplish. A normal straight forward implementation with normal account restrictions will do everything you want. Access over an encrypted TLS link provides transport security. I don't see what Client side decryption buys you. Client side encryption suggests that the database content is not to be viewable by DB admins, is this the driver? Jan 15, 2021 at 16:49
  • @user10216038 I don't want DB admins to be able to see any of the data and ideally, no one looking at the DB would be able to decrypt it.
    – Benjamin
    Jan 15, 2021 at 18:21
  • 1
    OK then as @kelalaka said. Encrypt with the public keys of all recipients who need to read it. They in turn can decrypt with their individual private keys. Jan 15, 2021 at 21:42

1 Answer 1


It sounds like systems design for email encryption would give you the security properties you're looking for. The two big email encryption systems are PGP and S/MIME. The details differ a bit between them, but in both systems you create a public key and private key pair; usually you associate the public key with an email address, but you don't necessarily need to; they are just formats for encrypting files and don't need to be used with email.

Given that both PGP and S/MIME are so common, I'm sure you can easily find open source implementations that you can integrate into your Android and Web clients. I have no idea if that is something supported by Firebase, or if you'll need to build a custom add-on, that part of your question is a bit out of scope for this site.

The idea would be to create an encryption keypair and distribute the public key to all the clients (for example, maybe you embed the public key in the mobile app) and the client encrypts the content for that public key using PGP or S/MIME file format, and send the encrypted data to the server. Store them on the server encrypted. Employees who are authorized to view the tickets can be given a copy of the private key.

Counter-arguments against this suggestion:

There is some devil-in-the-details to think about here, like you need to be careful not store the decryption private key on the same server as the encrypted data or else an attacker could steal both at the same time and defeat the whole purpose. You also want to think about how to revoke access to an administrator if you need to, which will be a bit hard to do with this design.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.