Our team has developed a Hybrid app which is based on IndexedDB
to support cross platforms. This app now has a chat feature and we want to store chats for offline readability. But as a rule of thumb, we can store Meta data of chats in plain text but not the actual chat message text contents. So, we decided to encrypt them.
Problem: Now the problem comes when user wants to search for a message which contains any specific word, it can be any language or text.
We tried to research what Whatsapp
implement for this functionality and came across multiple articles like https://www.group-ib.com/blog/whatsapp-forensic-artifacts/ and few others but it shows for native apps, sqlite
databases (msgstore.db, wa.db etc) in root folder are not encrypted not even a single field. While there are some databases which are encrypted like msgstore.db.cryptxx
but they are mostly backups.
Questions
Should we assume that Whatsapp only encrypts messages while sending and receiving not storing?
Does whatsapp store messages in plain text in
IndexedDB
for web? We couldn't find any except meta data.If Whatsapp encrypts every message whether
sqlite
or IndexedDB for web, then how does it perform searching for messages?What options do we have? How should we store messages in IndexedDB which can be encrypted and yet searchable?
There is a question related to this but neither it has the proper answer nor it is asked about IndexedDB which can be easily viewed by end users.