DEV Community


Posted on

Simple and secure email sending

Sending and receiving secure emails is not that hard. There are plenty of tools for you to choose in this task. Mailvelope is one of them, and it is pretty easy to use. But first, let me explain to you a little bit about asymmetric encryption and why it is so useful for secure communications.

Asymmetric Encryption

Imagine that Alice wants to send Bob a secure message with Alice current position. But she knows that Bob tends to leave his computer unattended and without a password, with his email open, and she also knows that Bob's coworkers are a little curious. So Alice wants a method for keeping curious eyes out of the way.

Alice asks Bob for a way to send secure messages between the two of them, but Bob doesn't want to share a password with Alice, nor anyone. So Bob decides to send Alice a public key. This public key is used by Alice to encrypt the info she wants to share with Bob, but Alice, nor Bob, can decrypt the info with this same key. For decrypting the message, Bob has to use his private key (it is obvious that Bob should not share his private key with anyone). So Bob can share his public key with anyone he wants without anyone without worrying that someone could decrypt the info.

So, summarizing, Bob shares with Alice his public key, Alice then encrypt the message with Bob's public key, she sends the message over email (or any other communication channel), and Bob decrypts the message with his private key. This way Alice and Bob prevent Bob's coworkers to see the original message.


So, how can I do that in real life? Well, here is where Mailvelope takes place. Mailvelope is a browser plugin that let us encrypt and decrypt files and messages, manage our keys, and it provides an easy UI for integration with the major Mail providers. It uses GPG as an encryption method.

First of all, you need to install the extension in your browser. You can find it at this link

Then you have to create a key pair (your private key and the public key associated with it).

Mailvelope 1

After generating the key pair, the extension will upload your public key to the Mailvelope key servers and give you a link with your public key (also stored on your local computer, you can display it in the extension dashboard). Meanwhile, your private key will remain on your local computer. You shall not share your private key never.

In order to send a message to someone, you need his public key. You can ask for it directly or try to find it on a key server. Mailvelope will take from there, whenever you compose a message first click on the Mailvelope icon, then you only have to type the message and select the recipients. Mailvelope will encrypt the message for that recipients.

Mailvelope 2
Mailvelope 3
Mailvelope 4

That is it! Now you can send and receive secure messages with your email.

Top comments (0)