加密存储在Firebase数据库中的聊天消息 [英] Encrypt chat messages stored in Firebase Database

查看:81
本文介绍了加密存储在Firebase数据库中的聊天消息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发一个应用程序,其中聊天也是我正在使用Firebase实时数据库的功能.尽管存储在Firebase中的所有数据都是通过SSL进行的,但我希望即使是管理员也无法看到该消息.我曾想过通过使用公钥和私钥架构来实现端到端加密,但是将私钥存储在设备上并不好,因为在卸载手机甚至应用程序时都会创建一个新的私钥.在另一台设备上使用,并且以前的消息也不会被解密.

I am making an application in which chatting is also a feature for which I am using firebase realtime database. Though all the data stored in firebase is via SSL but I want that even the administration is not able to see that messages. I thought of implementing the end-to-end encryption by using the public and private key architecture, but storing the private key on device won't be good as a new private key will be created when the phone is uninstalled or even when the app is used in another device and also previous messages won't be decrypted.

我还想到了,如果新消息可以在生成时使用新的私钥进行加密,并将以前的聊天记录存储在Google驱动器或iCloud中作为备份,但是由于这并不完全是聊天应用程序,因此我认为这样可以成功不可能.

I also thought of, if the new messages could be encrypted with the new private key, when generated, and storing the previous chat history in google drive or iCloud as backup, but since this not entirely a chat application I think this won't be feasible.

http://www.geero.net/2017/05/how-to-encrypt-a-google-firebase-realtime-database/

我也阅读了这篇文章,但是关键还是在管理部门身上.

I also went through this article but again the keys will be with the administration.

我应该如何进行?

推荐答案

我建议您使用AES加密消息.而且,您不应将密钥存储在设备上.否则,用户可以使用Diffie-Hellman密钥交换算法进行密钥协商以生成共享密钥: https://en.wikipedia.org/wiki/Diffie%E2%80%93Hellman_key_exchange

I recomend you to encrypt your messages with AES. And you should not store the secret key on devices. Otherwise, users can make key agreement to generate shared secret key, using Diffie-Hellman key exchange algorithm: https://en.wikipedia.org/wiki/Diffie%E2%80%93Hellman_key_exchange

这篇关于加密存储在Firebase数据库中的聊天消息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆