0

I have to implement end-to-end encryption with firebase push notifications on React and React Native Apps.

What I have in mind

  1. Encrypt messages from the backend and sent them to firebase
  2. On the front end, we will decrypt the message with the shared private key that we got on login from the backend or a predefined key on the app itself

My Question is. Since push notifications run in the background.

  1. How do we get a private key for decryption when a notification cames
  2. How do we decrypt the message using library (crypto-js) on push notification

I know this is not a way to do this. Please suggest a better option. This is for HIPPA compliance

Sukesh
  • 167
  • 3
  • 14
  • Persist the key on the local database, and decrypt it on a short-lived push notification service to show the result. – tanmoy Jun 28 '22 at 19:08
  • Hi, @MuhtasimUlfatTanmoy What do you mean by a local database – Sukesh Jun 29 '22 at 03:39
  • 1
    I can be any [Client side storage](https://developer.mozilla.org/en-US/docs/Learn/JavaScript/Client-side_web_APIs/Client-side_storage). For example, SQLite for android, iOS. – tanmoy Jun 29 '22 at 04:05

0 Answers0