End-to-end encryption chat app

dear all,

i know we have asymmetric cryptography extension for end-to-end app encryption, but how can we do it ya if based on the concept of chat app from @vknow360 How to use chatview with firebase?
any example i can refer with?
thank you very much :folded_hands:

i have this blocks in my chat app and added asymmetric crypto extension:

then it can write into FB RTDB as below:

two different phones with installed chat apps, where receiver side not able to decrypt:


or is it my blocks arrangement wrong?
need guidance on this from you all :folded_hands: :folded_hands: :folded_hands:

Hi Mike,

In the blocks image, which part handles decrypting the message you showed in the picture?

got two parts, supposed in decrypting the message from FB RTDB but surely i have put it at the wrong place

A first check to do is to verify whether you are also correctly passing the value of the privateKey.

hi @RaYzZz
yes, the private key is correctly set

Have you tried using the raw Asymmetric Cryptography function by manually passing the values? To see if it works normally

you mean passing privateKey manually like shown below?


yet the message in chat still showing this.

I wanted to understand if the issue is in the data you’re passing to the function.
Try inserting both values manually string and publicKey, and make sure the message gets added to the chat.

But I’m starting to wonder…
How are you using the public and private keys? Do you fully understand how they work?
Each user generates a public and a private key.
The two users who want to exchange a message need to swap their public keys:

  • user1 sends their public key to user2
  • and user2 sends theirs to user1

This way, each one encrypts the message with the other’s public key and decrypts it with their own private key.

I hope I didn’t cause any confusion, let me know.

thank you for your guidance, and yes i previously was not in right mind :sweat_smile:

think i will try store the generated public key into FB RTDB, so that can fetch each others’ key for later message encryption :crossed_fingers:

1 Like

looking for the solution

Hi joe,

I think he was ecrypting with the wrong key.

yeah i think so thanks Rays. :grinning_face:

1 Like