Skip to content

Instant Messaging

Normal encrypted text is a big block that starts with -----BEGIN PGP MESSAGE-----. It is obvious at a glance, it is long, and chat apps often break it by adding line breaks or turning parts of it into links.

Instant messaging solves that. It turns your encrypted message into a single line of letters and numbers. The line pastes cleanly into any chat app, and it does not show what it is.

  1. Type your message in a Text Editor tab. It must be a normal text tab, not an email tab.

  2. Choose who can read it:

    • To encrypt for a person, tick their key in the Key Toolbox.
    • To lock the message with a password instead, leave every key unticked. GpgFrontend asks you for a password.
  3. Click Operations in the menu bar, then IM Encrypt. The shortcut is Ctrl+M.

Your text is replaced by one long line. Copy it and paste it into your chat app.

If you also want the other person to know the message really came from you, choose IM Encrypt & Sign instead. The shortcut is Ctrl+Shift+M. This one always needs at least one ticked key, because a password cannot sign.

When an item is greyed out, the current tab is not a normal text tab, or GpgFrontend cannot encrypt right now (for example, IM Encrypt & Sign with no key ticked).

After encrypting, the Status Panel shows the usual encryption result, plus an Instant Messaging card with these lines:

  • Encoding: how the line is written.
  • Container Format: the version of the message format.
  • Message Book: whether you use your own shared phrase or the built-in default.
  • Book Fingerprint: a short code for your phrase, if you set one. Without a phrase, the card shows Set a Phrase instead, with the place to set it.
  • OpenPGP Payload, Token Length and Wire Overhead: sizes, which you can usually ignore.
  1. Paste the line into a Text Editor tab.

  2. Click Decrypt, exactly as you would for any other message.

GpgFrontend recognises an instant message by itself. There is no separate button for reading one. If the sender signed it, use Decrypt & Verify to check the signature too.

If GpgFrontend sees an instant message but cannot unpack it, it shows “The message could not be decoded.” The most common cause is that you and the sender do not use the same secret phrase. See below.

Out of the box, your messages do not stand out to most people. But anyone who knows GpgFrontend can recognise them for what they are.

To stop that, you and the person you write to can share a secret phrase. Once you both have the same one, your messages look like plain random text to everyone else.

  1. Open Settings. Under Features, choose Instant Messaging.

  2. In the Message Book Phrase box, click Generate. A long phrase appears.

  3. Click Copy and send the phrase to your friend privately. Do not send it over the chat app you are trying to protect.

  4. Your friend opens the same page, copies your phrase, and clicks Paste.

  5. You both look at the Book Fingerprint box. It shows a short code made from your phrase. Read the codes out to each other. If they match, you are set.

The fingerprint is safe to say out loud or send anywhere. The phrase is not.

The Message Book Phrase box has these buttons:

  • Generate: make a new random phrase.
  • Show / Hide: show or hide the phrase.
  • Copy: copy the phrase.
  • Paste: replace the phrase with the one you copied.
  • Clear: remove the phrase and go back to the built-in default.

If you set a phrase in v2.2.2, you do not need to set it again. GpgFrontend moves it over by itself.

Nothing breaks. Your message is still properly encrypted, and only the person you sent it to can read it.

The only thing you lose is the disguise. Without a shared phrase, GpgFrontend uses a built-in one that every copy of the program has. So anyone who knows the program can tell your message is an encrypted GpgFrontend message.

When you use IM Encrypt without a phrase, GpgFrontend tells you so in a window called No Message Book Phrase Set. You can choose:

  • Open Settings…: go to the settings page and set a phrase. Then run IM Encrypt again.
  • Continue with Default: encrypt anyway, this time.
  • Continue, Don’t Ask Again: encrypt anyway, and stop asking.

Instant messages are meant for short notes. If yours is too long, GpgFrontend tells you and leaves your text unchanged.

Either shorten the text, or send it the normal way with Encrypt. There is no length limit on a normal encrypted message.

Instant messaging comes from the InstantMessaging module. If that module is turned off, IM Encrypt, IM Encrypt & Sign and the Instant Messaging settings page all disappear, and Decrypt no longer recognises instant messages. To turn it back on, see Module Controller.

  • The shared phrase hides what kind of message you are sending. It is not what keeps the message secret. Your OpenPGP keys or your password do that, with or without a phrase.
  • The phrase is stored in GpgFrontend’s encrypted storage, never in the plain settings file.
  • GpgFrontend keeps one phrase at a time, and it is used for everyone you write to. If you want a different phrase for each person, you have to change the phrase in settings when you switch conversations.