“I encrypted something and sent it to myself, but when I decrypt it, it’s gibberish.”
This is the most common question. To answer it, let me explain how the app, and one-time pads in general, work.
The Vernam Cipher combines a plaintext (your message) with a secret key to produce a cipher text (the encrypted message). To decrypt the message, the cipher text has to be combined with the same secret key to get the plaintext back:
Plaintext → (secret key A) → Cipher text → (secret key A) → Plaintext
The key (no pun intended) is that the same secret key must be used to encrypt and decrypt. It gets a little tricky in the app, because when you encrypt a message, the part of the key used to encrypt it is discarded. So you can’t encrypt a message with a key and then decrypt it with that same key: part of the key is gone, and it is no longer the same key.
You need two copies of the key
One copy is for encrypting messages and the other is for decrypting them. That’s why the app lets you create and share secret keys. Typically you’d create a key and share it with whoever you want to exchange encrypted messages with. I’d suggest they also create a key and share it with you, so you each have two keys: one you use to encrypt messages for them, and one they use to encrypt messages for you.
It is vital that the secret keys stay in sync. This is a limitation of one-time pads in general, not just the Vernam Cipher app.
Trying it on one device
- Create a key, then share it: long-press the key after it’s created and choose Import Vernam Cipher Key as the share action.
- Import the key. You’ll now have two identical keys in your list of secret keys.
- Write a message with one of them and send it to yourself.
- When you decrypt it, select the other copy of the key.
When you do this, the first key is modified when it’s used (the part used to encrypt the message is thrown away). When you decrypt with the second key, the same thing happens: the part used to decrypt is discarded. After both operations, the two keys are identical again.