How Signal Works - Signal CTO Ehren Kret Breaks it Down

How Signal Works - Signal CTO Ehren Kret Breaks it Down

Introduction to Signal Protocol

In this section, the CTO of Signal, Aaron Kret, introduces the Signal Protocol and provides an overview of the topics that will be covered in his talk.

Building Blocks of the Signal Protocol

  • The protocol is based on Diffie-Hellman key exchange.
  • Key derivation functions are used to strengthen passwords and stretch random values.
  • HMAC-based key derivation function (HKDF) is used in Signal.

Properties of an Encryption Protocol

  • Forward secrecy ensures that intercepted ciphertext cannot be decrypted even if a device is compromised.
  • Post-compromise security prevents future messages from being read by an attacker who gains access to a device.
  • The double ratchet protocol in Signal achieves both forward secrecy and post-compromise security.

Diffie-Hellman Key Exchange

This section explains how Diffie-Hellman key exchange works and its role in the Signal Protocol.

Graphical Explanation of Diffie-Hellman

  • Common base material is agreed upon publicly.
  • Each person picks a random number and combines it with the common material.
  • The resulting mixed values are exchanged publicly but cannot be reversed to obtain the original numbers.
  • By mixing their own secret ingredient, two parties can derive a shared secret unknown to interceptors.

Key Derivation Functions (KDF)

This section discusses key derivation functions used in the Signal Protocol, specifically HKDF.

Cryptographic Hash Function

  • A one-way transformation of bytes into other values.
  • Can strengthen passwords or stretch random values for various purposes.

HKDF in Signal

  • HKDF uses HMAC-SHA256 as its baseline function.
  • It can produce any requested length of output, up to about 8 kilobytes.
  • Inputs to HKDF include secret key material and an info string.

KDF Chains

This section explains the concept of KDF chains in the Signal Protocol.

Chaining Key Derivation Functions

  • KDF chains string together multiple key derivation functions.
  • Each iteration produces a unique output key that can be replicated.
  • The process can be repeated indefinitely to generate new keys.

Properties of Encryption Algorithm

This section discusses the properties desired in an encryption algorithm, including forward secrecy and post-compromise security.

Forward Secrecy

  • Intercepted ciphertext should not be decryptable if a device is compromised.
  • Signal achieves this by using distinct keys for each message and deleting them after decryption.

Post-compromise Security

  • Ensures that even if a device is compromised, future messages remain secure.
  • New entropy is mixed into the key material regularly through the Diffie-Hellman ratchet.

Symmetric Key Ratchet

This section explains the concept of a symmetric key ratchet and how it is used in message encryption.

Chain Key and Output Key

  • The chain key is the starting point, and each step along the way produces an output key.
  • Each message sent is encrypted with a new output key derived from the chain key.
  • Both parties have the same chain key, allowing them to perform the same function.

Diffie-Hellman Ratchet

  • In addition to the symmetric ratchet, there is a diffie-hellman ratchet.
  • A root key is generated using a diffie-hellman agreement.
  • Private keys for both parties and a public key from the other party are involved in this process.

Deriving Chain Keys

  • The public key received from the other party is mixed with the previously sent private key to derive the receiving chain's top.
  • Another diffie-hellman agreement generates the root of the sending chain.
  • Messages are encrypted using message keys derived from these chains.

Establishing a Session

This section describes how Alice establishes a session with Bob using encryption.

Fetching Bob's Public Key

  • Alice needs Bob's public key to initiate communication.
  • Alice requests Bob's public key from a server before starting the message sending process.

Creating Sending and Receiving Chains

  • Once Alice has Bob's public key, she creates a sending chain and starts sending messages.
  • Bob uses Alice's public key to set up his receiving chain for replying.

Fully Established Session

  • After exchanging messages, Alice and Bob have established a session.
  • Private and public keys are generated at each step of conversation switching directions.
  • Symmetric chains are used for sending and receiving messages.

Worked Example

This section provides a worked example of the diffie-hellman ratchet and the structure of the session state.

Message Exchange

  • Alice initializes the session by fetching Bob's pre-key.
  • Root key is generated and deleted after going through the kdf function.
  • Message keys are derived for encrypting messages sent by Alice (A1, A2, A3, A4).
  • Bob replies with message B2.

State Structure

  • The session state continues to iterate as Alice and Bob exchange messages.
  • Private and public keys are generated alternately at each step.
  • Symmetric keychains in the middle are used for encryption/decryption.

Challenges and Out-of-order Messages

This section discusses challenges that can arise with out-of-order messages and how to handle them.

Out-of-order Messages

  • If messages are received out of order, it can create problems.
  • Old keys should be deleted when receiving messages out of order.

The transcript is already in English.

[t=0:11:41s] Signal Protocol Overview

This section provides an overview of the Signal Protocol and its key features.

Signal Protocol Features

  • The Signal Protocol allows for secure communication by encrypting messages using keys.
  • Messages can be decrypted using the corresponding keys.
  • The protocol retains a limited number of keys in the signal library to balance storage requirements.
  • Retaining too many keys may result in undecryptable messages if some are dropped.

Group Communication in Signal

  • In group communication, each sender has a symmetric chain key.
  • Senders bootstrap their chain key by sending their Cinder key to the group.
  • When someone leaves the group, the chain key is changed to prevent decryption by those with old keys.
  • Regular rotation of the chain key occurs based on time or message count.

[t=0:13:37s] Challenges in Identity System Migration

This section discusses the challenges faced when migrating to an alternative identity system while maintaining user experience and privacy.

Challenges in Identity System Migration

  • Moving to an alternative identity system while maintaining a single conceptual identity is challenging.
  • The goal is to allow lookup without linking identities unless explicitly permitted by users.
  • Ensuring privacy preservation while establishing connections between usernames and phone numbers is difficult.

[t=0:14:40s] Security in Group Communication

This section addresses post-compromised security concerns in group communication within Signal.

Post-compromised Security Measures

  • To address post-compromised security, regular rotation of the chain key occurs when someone leaves the group or based on time/message count limits.
  • Maximum length of time and message count limits are set for using the same chain key before rotation.

[t=0:15:10s] Symmetric Ratchet Usage in DM and Groups

This section explains the usage of symmetric ratchet in direct messages (DM) and group communication.

Symmetric Ratchet Usage

  • In DMs, every message uses the symmetric ratchet, and the DH ratchet step occurs when the other party replies.
  • In groups, the symmetric ratchet is used with less frequency compared to DMs.

[t=0:15:29s] Session Initiation and Message Delivery

This section discusses session initiation and anonymous message delivery in Signal.

Session Initiation and Pre-Key Fetching

  • When starting a conversation, one needs to fetch the pre-key from the server.
  • Authentication is not required for fetching pre-keys as there is no need for the server to know who is initiating the session.

Anonymous Message Delivery

  • Messages pass through Signal's server but are delivered anonymously.
  • An unidentified delivery channel allows anonymous users to send messages without revealing their identity.
  • Password-based systems enable message delivery without identifying the sender.

[t=0:17:02s] Pre-Key Management

This section covers pre-key management in Signal.

Pre-Key Usage

  • Most pre-keys are one-time use keys.
  • A fallback mechanism exists if all pre-keys are exhausted, but security properties may be compromised with fallback keys.

These notes provide a comprehensive summary of key points discussed in the transcript. The structure follows a clear organization based on sections and subheadings. Bullet points are used to highlight important information, and timestamps are included where available to facilitate studying of the transcript.

Spam Filtering and Client Behavior

In this section, the speaker discusses the frequency of client checks for spam messages and how many messages are typically uploaded at a time. They also mention the number of people dedicated to addressing the spam problem.

Frequency of Client Checks and Message Uploads

  • Clients check for new messages frequently.
  • Current clients upload around 100 messages at a time.
  • When the number of remaining messages drops to about a quarter, new ones are uploaded.

Number of People Dedicated to Addressing Spam

  • The team has about two full-time members dedicated to handling spam.
  • Due to the substantial incentive for spammers, it requires significant effort to combat spam.
  • The registration system helps identify suspicious behavior, such as starting numerous conversations immediately after registering.
  • Users can report spam within the application, which helps in identifying problematic accounts.

Identifying Suspicious Phone Numbers

This section focuses on how Signal identifies suspicious phone numbers used by spammers and their efforts to blend in with normal users.

Identifying Suspicious Phone Numbers

  • Signal's registration system requires phone numbers, which are usually expensive to acquire.
  • Spammers stand out when they start multiple conversations immediately after registering with unknown individuals.
  • Patterns like using Hong Kong phone numbers on Canada Telecom can indicate suspicious activity.

Blending In with Normal Users

  • Some spammers make an effort to blend in with normal users, making them harder to track down.
  • Signal has reporting features that allow users to report spamming numbers.
  • If enough reports come in for a given user, it indicates potential wrongdoing.

Open Source Nature of Signal

This section discusses the open-source nature of Signal and its impact on combating spam.

Open Source Components

  • Almost everything in Signal is open source, except for the spam filter.
  • The spam filter remains closed source to prevent spammers from exploiting its vulnerabilities.
  • Both the applications and servers are open source.

Encryption of Media Attachments

This section explains how media attachments are encrypted and shared within Signal messages.

Encryption of Media Attachments

  • Messages in Signal contain more than just text; they use a protocol buffer format.
  • Media files, such as images, are encrypted with a random key before being uploaded to Signal's media servers.
  • The message includes the URL and random key used for encryption, allowing recipients to decrypt and view the attachment.

Handling Simultaneous Session Initiations

This section addresses the issue of simultaneous session initiations and how Signal handles it.

Simultaneous Session Initiations

  • Simultaneous session initiations can occur when two people have different half-open sessions.
  • Signal's library stores up to five simultaneous sessions but prioritizes the one where a message was received most recently.
  • The hope is that communication will eventually occur on the same session, resolving any conflicts.

One-Time Pre-Key Removal Attacks

This section discusses potential attacks involving the removal of one-time pre-keys from the server.

One-Time Pre-Key Removal Attacks

  • There haven't been specific instances of attacks targeting the removal of one-time pre-keys from the server.
  • Distinguishing between such attacks and legitimate high-volume users can be challenging.
  • Reusing pre-keys during session establishment doesn't significantly compromise security since it gets repaired once both parties reply.

Denial of Service Overview

In this section, the speaker discusses a denial of service attempt and mentions a specific incident that occurred in January 2021.

Denial of Service Incident (January 2021)

  • The speaker mentions that they haven't seen a recent denial of service attempt.
  • The closest thing to a denial of service was when Elon Musk tweeted about using Signal, which resulted in a sudden influx of 20 XR user base within an hour.
  • The speaker concludes the discussion by thanking everyone.

This section provides information about a specific denial of service incident that occurred in January 2021.

Turn any video into a summary like this

YouTube links, meetings, lectures. With transcripts, search, and chat.

Video description

If you want to learn more about FUTO and what we're doing to help put the power of computers back into the hands of the people, go to our website: https://futo.org/ Signal Website: https://signal.org/ This was filmed by @TheKinoCorner at the FUTO Self-Hosted Summit on March 17, 2023.