> ## Documentation Index
> Fetch the complete documentation index at: https://docs.socketchat.org/llms.txt
> Use this file to discover all available pages before exploring further.

# Encryption

> How Socketchat locks messages, in plain words: MLS, OpenMLS and post-quantum protection.

Socketchat builds its encryption from published standards and reviewed libraries. It has no home-made cryptography.

## MLS: one standard for group chats

MLS (Messaging Layer Security) is the internet standard for encrypted group chat, published by the Internet Engineering Task Force (IETF) as RFC 9420 in 2023. Socketchat uses it through OpenMLS, an open-source Rust implementation of MLS.

In plain words:

* **Everyone in a room shares a set of keys** that only members hold. A sender locks a message once, and the server copies the sealed message to every member.
* **Keys change when the room changes.** Each time someone joins or leaves, MLS moves the room to new keys. Someone who leaves cannot read what comes after, and someone who joins cannot read what came before.
* **Keys refresh over time.** Each app also refreshes its own keys in a room when they are more than a week old, so an old key stops opening new messages.
* **Changes are signed.** Every change to who is in a room carries the signature of the member who made it. Apps check those signatures, so the server cannot add someone on its own.

## Protection against future quantum computers

A large enough quantum computer could one day break the key exchange most encryption uses today, and someone could record messages now to open them later. Socketchat's default MLS suite (the set of algorithms a room uses) pairs ML-KEM-768, the United States standard for post-quantum key exchange, with X25519, today's common key exchange. Using both means it is never weaker than X25519 alone.

This post-quantum suite comes from an IETF draft that is not final yet. Socketchat keeps the choice of suite in one place, so rooms can move to the final version once it is published.

## The connection to the server

Apps reach the server over TLS 1.3, the same standard that protects websites. The server makes its own certificate at setup, and invite links carry that certificate's fingerprint. Your app checks the fingerprint every time it connects, so it can tell your server from an impostor without any certificate authority. Messages travel inside this connection already sealed by MLS.

## Files

Each file gets a fresh random key and travels in small locked pieces. The key, the file's name and a fingerprint of its contents go inside an encrypted MLS message. The receiving app checks the fingerprint before it saves the file, so a changed file is never saved.

## Invites and verification

An invite link carries a fingerprint of the inviter's identity key, the long-term key that proves who they are. When your friend joins, their app checks the invite against that fingerprint, so it can tell that the link came from you. Safety numbers let any two people check each other directly; see [Verify someone](/use/rooms-and-invites#verify-someone).

## On your computer

Socketchat keeps its data in one database file encrypted with SQLCipher, a widely used encrypted form of SQLite. The key comes from your passphrase through Argon2id, a standard method that makes guessing passphrases slow. See [Your passphrase](/security/passphrase).

[SECURITY.md](https://github.com/sachio222/socketchat_v4/blob/main/SECURITY.md) lists the exact algorithms and library versions.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.