In 2021, we went to Web Summit in Lisbon and one of the outtakes we had was the confirmation of our belief: there is a high demand for secure corporate chat apps among medium-sized and large enterprises.
By that time, we had already built an encrypted messenger app for the Middle Eastern young professionals who needed to safeguard their chats with friends and colleagues from prying eyes including hackers, law enforcement, and intelligence services.
If you’re here to learn how to create a secure chat app, we’d like to share our experience and offer tips in this article. We’ll talk about what's under the hood of a Signal-like secure messenger including encryption algorithms, core functionality, and possible risks. For a secure app development price estimate, scroll to the end of the article.
What does it mean to have a secure instant messenger?
To answer this question, first, let’s make sure we are on the same page about how a chat application works and what encryption means.
Typically, a message you send to your friend goes through a server. Without encryption, this message will be transmitted as plain text and can therefore be read by anyone with access to it at any point along the way. With encryption, the message is transformed from plain text into ciphertext — encrypted with a key — for transfer and then transformed back (decrypted) on your friend’s device, with a paired key.
Most instant messaging apps today use end-to-end encryption, meaning the encryption keys are stored at the ends, i.e. on users’ devices, instead of on the server. This makes it so that no one except you and your friend can read the messages. Not even the service provider who owns the server has access to them.
Despite apparent reliability, end-to-end encryption has weak points as well. For example:
- Failure to recover the message history in case a user changes/loses their device, and there was no server used for storing the chat history.
- Susceptibility to man-in-the-middle (MITM) attacks when skilled MITM hackers can intercept conversations, hack public keys, and — being recognized by the system as rightful recipients — even deliver forged messages.
To battle MITM attacks, Signal developers have further upgraded their protocol’s end-to-end encryption with a Double Ratchet Algorithm. This algorithm creates session keys in addition to the public and private keys created when users install the app. Session keys are created for each message sent, and they self-destruct when the session is complete (i.e. when the message is received). Even if MITM attackers manage to obtain the key for one session, they won’t be able to decrypt all messages.
Meanwhile, the Double Ratchet Algorithm is not the only feature that sets the Signal app apart from other secure messaging applications.
Different approaches to end-to-end encryption
Is it just the content of your messages that you would like to keep secure? How about background information including email address, phone number, date of birth, avatar, IP address, or date of last use? Chances are, this metadata can reveal no less sensitive information about all participants in your chat than messages themselves.
However, not all secure messaging apps are concerned about their users’ metadata protection.
A comparison chart for the most popular peer-to-peer encrypted messaging apps
For example, WhatsApp uses the version of Signal’s encryption protocol that only encrypts the contents of messages. This means that WhatsApp — and, by extension, Facebook and anyone they decide to share the information with — can see who you’re talking to, when, and from where.
The two other messenger apps that do this are Telegram and Threema. However, in Telegram, end-to-end encryption is only applied in secret mode and not to all chats by default. General messages aren’t well-encrypted on Telegram. At least Telegram refuses to share such information with anyone, be they governments or advertisers.
Key features of an encrypted messaging app to include
Most people use at least one messenger, probably several, and the basic set of features for an encrypted messenger app like onboarding, sign-up/log-in, or user profile will hardly surprise you. So we’ll briefly go over them.
To make this block valuable for you, we’ll better describe features that made Signal the most secure messenger ever and, which might be even more important, highlight those features that can help you outdo the Signal mobile app.
Sign up/Log in
A messenger account is usually tied to a phone number or email address. Signal, for instance, asks you to enter your phone number to send you back a verification code via SMS. Threema, a Switzerland-based secure messaging app, allows users to register via randomly generated Threema ID — without a phone number or email address used for it — and chat anonymously.
Screen lock with PIN
After verification, Signal offers a user to pitch a PIN code, by default consisting of four digits that according to the user, could be extended by extra characters or changed to an alphanumeric password. Other ways to lock a messaging app screen are with biometric identifiers (Face ID, Touch ID).
To make an encrypted messaging app with extra protection, Signal requires users to enter the Signal PIN every time a user wants to re-register their account on another device. Consider implementing this feature in case someone steals your user's phone, or SIM, or somehow gets access to their email which was used for signing up. Besides using a pin code, you can implement two-step authentication via fingerprint, password, verification code, or link.
A profile stores a user’s personal information and links to important features like contacts, FAQs, and settings. For high safety, make it optional for users to provide their real first name, last name, and avatar. In their profiles, Signal allows users to use nicknames or even emojis.
Access to contacts
If you want to create a user-friendly secure messaging app, it’s important to request user permission to access their contacts instead of doing this automatically. Only if the permission is received, user contacts can be imported to the chat app. Here, it might be convenient for users if your app indicates those who already use the app and those who don’t with an option to invite the latter. In addition, sending invitations can also serve your app as an efficient marketing strategy.
Personal and group chats
For a state-of-the-art instant messenger, providing personal and group chats is a standard, and the Signal app is no exception. In personal chats, it allows users to send text and audio messages, images, audio/video files, contacts, location, stickers, and GIFs. As for group chats that can hold up to 1,000 members, Signal offers users to create and share group invitation links and manage group chats via admin controls.
Consider taking an example of Signal to give your users an option to:
- mute chats for up to a year (WhatsApp offers to mute chats forever)
- pin important chats (Signal allows pinning up to four chats simultaneously)
- archive chats
Signal, WhatsApp, and Telegram realize the latter functionality differently. In the first two chat apps, new-coming messages make archived chats active whereas in Telegram archived chats remain in archives. In addition, Telegram allows adding the greatest number of people to one chat — up to 200,000.
To successfully build an encrypted messaging app, it’s worthwhile to think about all these parameters beforehand since they might form the basis of your app's killer features.
Voice and video calls
Most popular instant messaging apps like WhatsApp, Telegram, and Signal support audio and video calls with screen sharing both in personal and group chats but have different limits on the number of participants in a group call.
WhatsApp allows having up to eight participants in a group call whereas Signal has recently expanded its limit up to 40 participants. With no limits for audio chats, Telegram allows up to 30 people to take part in video conferencing. The leader with the greatest number of participants in video group chats — up to 50 people — is Wire, an encrypted communication app made by Wire Swiss.
The goal of each messenger is creating a place where millions of users will simultaneously exchange tons of text messages, images, audio, and video files. The size of these files is different and equally different is the time required to transfer them.
Since your secure messaging app is a highly loaded system, streamlining the data cyphering, transferring, and deciphering process is your task #1. Below in this article, we’ll describe the technical solutions we've made to optimize the file transfer in our p2p encrypted messaging app for the Middle East region.
One-time viewable and self-destructing messages
Signal, as well as WhatsApp, provides users with a “view once” setting, meaning users can send images and videos that disappear once they have been viewed. To add extra protection to your app, consider implementing self-destructing messages. Signal enables users to set a timer — from 5 seconds to one week — to destroy received messages and media files in the chats.
Note to self
One more distinct feature of the Signal app is the “Note to self” section where users can send important text messages, links to audio and video content, and voice notes to themselves. It might come in handy for users to have an Evernote-like organizer built in your secure messaging app as well.
To protect people’s privacy, Signal provides users with a face-blurring feature. Using it, users can blur faces or other image parts they want to obscure when sharing over the Signal chat. Signal’s image editor can automatically identify and blur faces, meanwhile, other elements of an image can be blurred manually by users with the help of a blur brush.
This feature works for some Android devices. If a user goes to Signal settings and activates incognito keyboard mode, it'll make it impossible for the keyboard’s dictionary to remember the text the user types. There will be no autocomplete or suggestion, however, as well as grammar autocorrecting. If you want to protect your users’ input from being used by third-party advertisers, consider implementing an incognito keyboard feature.
What’s the easiest and fastest way to snoop in on someone’s contacts and correspondence inside the app? Of course, by taking screenshots. To prevent your users from being compromised in this way, allow them to disable screenshots for your chat app as Signal did.
In a messenger app, it’s essential to have a reliable system for instant notifications. In terms of security and privacy, however, it’s worthwhile to enable your users to customize whether they want to have notifications displayed on their lock screens and if yes — what information these notifications should reveal (e.g. name only or name+content+actions).
Media auto-download controls
Since a messenger app might transfer a lot of media from personal and group chats, you should help users avoid overwhelming their galleries by allowing them to disable media auto-downloads.
Backup and restore
As we’ve mentioned, by default, Signal doesn’t back up any of users’ contacts, text messages, audio, video files, and other documents. However, if a user wants to reinstall Signal on the same phone or entirely move to a new phone (provided that the user will switch from Android to Android or from iPhone to iPhone), there’s an option in the Signal app to enable chat backups and later restore them.
To keep data secure, Signal encrypts these backups with a passphrase and saves them to external storage like the user’s phone, computer, or storage device of any kind.
Most people have more than one device with communication apps installed. For users to be able to smoothly switch between devices as they see fit, you’ll need to provide a sync feature. Looking back to the Signal app, it’s a cross-platform encrypted instant messaging app that flawlessly works with Android and iOS platforms as well as desktop programs including Windows, macOS, and Linux.
Allow users to adjust the messenger for their convenience by going to settings where users can choose dark mode, language, screen security modes, and other above-described features.
You might think of how to create an encrypted messaging app that would be notable when all sorts of features seem to be already released by rivals. Here are some ideas for making your app stand out in the market:
- Break chats into multiple rooms according to your target audience’s needs. If you strive to create a secure messenger for business people, consider separating chat rooms for communication with personal contacts, customers, employees, third-party suppliers, etc.
- Offer secret/private chats. Whether you encrypt your users’ metadata or not, in today’s stormy reality, it might become your app’s selling point to have disappearing or lockable chats. For example, Telegram offers secret chats that automatically disappear if you log out of Telegram on your device. These chats aren’t stored on Telegram’s cloud servers and therefore can’t be backed up or synced even if you’re logged in on more than one device.
- Integrate a secure document management system. Having all business documents, images, and videos automatically stored in a centralized, secure, and compliant space within one app might come in handy for co-workers.
- Add signing documents with an electronic or digital signature. The e-signing feature tends to be appreciated by people in business since it helps their business go paperless — that is, save time and money.
- Provide advanced video conferencing feature. Popular messengers have restrictions on the number of video conference participants with a maximum of 50 attendees in one video call from the Wire app. What if you offer up to 100 attendees in video calls? It could be your killer feature, provided that you’ll deliver high-quality audio and video communication.
- Enhance the "Note to self" with Pinterest-like boards. Feeling overwhelmed with the amount of content in this section, chances are, your users will appreciate built-in boards where they can collect links to useful podcasts, articles, videos, quotes, and social media posts. Later, they will be able to share their curated content with friends and colleagues via your instant messenger.
Secure messaging app design best practices
If you want to build a secure messaging app that stands out from the crowd, you’ll also need to keep up with industry leaders when it comes to design. The Signal app is simple and isn’t famous for its intuitiveness, but it wins over users who care about their privacy more than about bells and whistles. WhatsApp and Telegram, on the other hand, look fancy and are exceptionally intuitive in addition to being secure (while their security might not be on the same level as Signal, it’s still impressive).
In our case, we used third-party mobile app analytics tools to identify the weakest spots of the user journey within our encrypted chat app and identify what app screens including buttons, icons, pop-ups, and tutorials we needed to refine.
Let's go through several tips from our UI/UX designers on how you can create a user-friendly interface in a mobile app for secure communication.
Themes and fonts
For a better user experience, it might be worthwhile to offer different chat color themes. Also, think of adding a dark mode to prevent your users from eye strain. For people with disabilities, allow users to tweak the font size, colors' contrast, and text-to-voice.
Stickers and GIFs
Every other messenger today integrates the popular GIF service Giphy into its interface to complement emoticons. Stickers became popular when Telegram started offering them for free (as opposed to Viber, for example, where only some stickers are free). You can put some effort into designing unique emojis and themed stickers that reflect your target users’ tone of voice, business jargon, and intended message reactions and thus set your app apart from rivals.
Of course, your secure instant messenger’s UI/UX design largely depends on your target audience. For example, Discord, a VoIP instant messaging app that was initially built for gamers, has quite a cartoonish appearance. However, if you want to target business people and companies, your app is likely to have a strict or minimalist design with users able to customize the app theme and wallpapers.
Encrypted messaging app tech stack
Now, you may wonder about how to code an encrypted messaging app and what technologies we’ll recommend you to use to make your instant messenger highly secure and totally crash-free.
The back end is where the magic happens in messengers. Backend specialists are responsible for your chat app’s security and reliability, as they’re the ones who know how to encrypt messages and handle ever-increasing concurrent requests and connections.
The usual programming language options for a messenger back end are Elixir or Erlang — Ruby on Rails isn’t a good choice for a big amount of data in the form of text messages, media, and audio/video calls. WhatsApp uses Erlang, while Elixir is employed by Discord.
At Mind Studios, we developed a messenger app with an Elixir-based back end. However, Elixir itself is based on Erlang with some Ruby mixed in, so an experienced Elixir developer can write code in Erlang as well.
For instant messaging apps where millions of messages are sent per minute, it’s vital to find a message delivery model with a suitable bandwidth of simultaneous interactions. For this purpose, we recommend using a publisher/subscriber model instead of using HTTP requests that work unacceptably slow.
When building a secure messaging app for the Middle East region, we used Redis as a pub/sub adapter since it allows us to process up to one million messages per second.
Audio/video chat APIs
For real-time audio and video chatting, one of the most demanding technologies is WebRTC (web real-time communication). WebRTC is an open-source project that works smoothly both for all modern web browsers and mobile applications. The main advantage of this framework is that WebRTC enables peer-to-peer file sharing and AV streaming without the need for server-side file hosting.
Though WebRTC is a great API for mobile app development itself, it’s also an originator for diverse open-source projects and frameworks aimed to power mobile applications at scale. One of them is Twilio, a cloud communication platform that we’ve preferred to rely on when embedding voice and video SDKs for iOS and Android apps.
The rundown of technologies our developers prefer to use when building an encrypted instant messaging app architecture:
How to secure a messaging app
There are several ways to implement end-to-end encryption chat. Usually, encrypted messages are stored on a messenger’s servers — cloud servers are more secure and thus recommended for this purpose — and decryption keys are only available from users’ devices to avoid a data breach in case the servers are hacked.
It’s also possible to desist from storing messages on your secure messaging servers completely and store them on users’ devices. But that means your users won’t be able to restore their message history in case the devices on which they’re logged in are lost or they delete the app. Syncing messages between devices will also be impossible.
To build a secure messaging app like Signal, you can actually use the encrypted messaging API from Signal itself. Signal’s open-source encryption protocol is the most popular among developers building messengers, as it’s constantly peer reviewed and audited. As of the time of writing, the following messengers use Signal’s secure messaging protocol to encrypt the contents of their messages:
- Facebook Messenger (secret chats only)
- Skype (Private Conversations only)
- Google Messages for Android (SMS)
Telegram uses its own 256-bit symmetric AES encryption-based algorithm called MTProto for secret chats. This algorithm is closed-source, though, for which Telegram has been widely criticized.
So how to make an encrypted chat app?
Let’s briefly go through the main stages of Signal's clone app development and the time needed for that in case you choose Mind Studios as a mobile app development partner.
Fundamental stage at which we’ll conduct thorough market research, analyze your competitors, and drill down into your target audience’s needs, fears, wants, and habits. In the end, we’ll come up with the final product vision and draft a product requirements specification.
Time required: 96+ hours
At this stage, we’ll start with drawing up initial concepts of your secure messaging app in the form of wireframes and black-and-white prototypes. After agreeing upon the app’s architecture, we’ll offer you at least two colored UI concepts that you’ll need to choose from. When the main app visual and functional elements win your approval (in some cases, the approval from beta testers), our designers will start to draw the entire UI/UX design for your mobile app MVP using the best practices for mobile UX design.
Time required: 168+ hours
The length of mobile app development could vary depending on the complexity of app features and the number of platforms for which you decide to build your app. Here, we’ll mention a rough estimate of the time that might be spent on developing a native iOS client-side mobile app similar to the Signal app architecture together with a backend part.
Time required: 1,480+ hours
Testing and refining
This stage is for troubleshooting and polishing your secure instant messaging app to gloss. Our quality assurance specialists will analyze feedback from initial users, provide multiple automated and manual tests to find bugs and fix them, and give recommendations on how to improve the app. Based on QA reports, designers and developers under the supervision of a project manager will refine your product until it meets set success criteria.
Time required: 480+ hours
Cost to make a secure messaging app
The cost to make an encrypted chat app as well as any other app depends heavily on the time required for the development. As far as the number of features goes, messengers don’t seem too complex; however, the back end alone for a well-encrypted messaging app can take about 520 hours to build.
Here’s our take on the time necessary for developing a secure messaging application similar to Signal:
|Business analysis and drafting a specification||96+||4,320|
|Prototyping and UI/UX design||168+||7,560|
|Developing an iOS client-side mobile app||960+||43,200|
|iOS app testing and Project Management||480+||21,600|
Android development takes slightly less time than iOS development, but testing takes longer due to the wider variety of devices.
With this rough time estimate, the cost to build a really safe chat application for iOS platform will start at $100,080 and will go up with extra features.
Challenges of secure messaging application development
Well, up to this point, we’ve described in detail how to develop a peer-to-peer encrypted messaging app so that everything should now seem simple and clear to you.
However, we’d like you to be prepared for the main challenges that could emerge during your app development and have a clear plan of what to do if:
Chat crashes every time a media file is sent
Such flaws can occur because, first, media files tend to be of a large size so their processing, transferring, and ciphering heavily loads the system; second, end-to-end encryption of these files implies a rejection of the encrypted chat server, meaning all processes will take place on the client-side.
Solution. To streamline the processes of data transmitting, coding, and decoding within your secure messenger, look closely at the algorithm that parallelizes encryption, decryption, and keystream creation.
App speed is far from perfect
In most cases, app speed also slows down due to the highly loaded client-side.
Solution. In this case, it’s vital to conduct load tests and find the most overloaded app spots and later restore order in the client’s internal database reorganizing its structure in particular.
Budget is being demolished by tons of forged verification messages
If you choose registration via a phone number as a method for users to sign up within your secure chat app, be ready to resist the attacks of numerous robot-bots once your app is brought to populous markets.
Solution. We recommend using a smart captcha (reCAPTCHA). Its plugin will help you block IP addresses from which come intrusive verification requests and thus protect your budget.
The Mind Studios experience
All the above-described challenges come from our experience working on a secure messaging app for the Middle East region. The solutions to those challenges were hard-won during our immersive brainstorming both within the team and with the client.
In 2019, the task to develop a p2p encrypted messaging app for Android and iOS platforms seemed fascinating to us from the beginning. Most of all because the government authorities of most countries in the Middle East region have banned foreign VoIP instant messaging apps like WhatsApp, Viber, Skype, Facebook Messenger, and the like since 2013.
Thanks to timely-conducted research, we identified the fierce competition among multiple secure chat apps trying to conquer this tricky market. With the help of our client and a thoroughly outlined target user profile, we came up with a key solution for the app’s unique selling point. As a result, our secure messaging app offered users to take care of their work-life balance becoming a one-of-a-kind solution.
At present, this really secure instant messaging app has got more than 17,000 downloads and transmitted more than 366,000 messages. Inspired by a sense of achievement in developing the secure chat app, we’re now working on enriching it with other useful yet distinct features no popular messenger provides, as well as developing effective marketing campaigns.
Soon, a complete case study about the steps we took to build this secure instant messenger will be published on our website. We also plan to share the insights about marketing this chat app — what strategies would work and what wouldn't. So if you’d like, subscribe to us to receive the news.
Secure messengers are exceptionally important, and the demand for them is high today and will be higher tomorrow. But so is the competition. Not every company can make an encrypted messaging app like Signal.
To create your own secure messaging app, you’ll need developers experienced in this niche. Besides, your custom app will need to be not only secure but user-friendly. Balancing these requirements is no trifling matter. But with the right team, it’s possible.
Feel free to schedule a 45-minute consultation with our business development specialist right now to discuss all your project peculiarities.