VMess protocol: how it works, AEAD, alterId and the vmess:// link

VMess is the original protocol of V2Ray, there since 2015: it logs the user in with a UUID mixed with the current time and encrypts the traffic itself, with AES-128-GCM or ChaCha20-Poly1305. Since 2020 its login header is protected with AEAD (alterId 0), and the server rejects a client whose clock is more than 120 seconds off. A vmess:// link is JSON encoded in base64, in the format of the v2rayN client.

Updated

On this page

Facts

What it is

Proxy protocol with its own encryption

Since, by

2015, V2Ray (Project V)

Transport

TCP, WebSocket, gRPC, HTTPUpgrade, mKCP; XHTTP in Xray

Encryption

AES-128-GCM or ChaCha20-Poly1305, AEAD login header

To the network it looks like

Random bytes; with TLS, an HTTPS connection

Usual port

Any; 443 when wrapped in TLS

Comes as

vmess:// with base64 JSON (v2rayN format)

License

V2Ray: MIT; Xray-core: MPL-2.0

Latest release

v2ray-core v5.53.0, August 2, 2026

In Veli

Windows, macOS, Linux, Android · link

Own server from the app

No

Versions and history

  1. 2015

    V2Ray's own protocol

    VMess came with V2Ray from the start: the spec file vmess.md is already in the project's first tag, v0.1, of September 2015.

  2. May 2020

    An active probing flaw

    V2Ray issue 2523 showed that a censor could replay a captured VMess header with small changes and recognize the server by when it hung up. v4.23.4 blurred that signal; a full fix needed a new header.

  3. Sep 2020

    VMessAEAD

    From v2ray-core v4.28.1 a client with alterId 0 logs in with the AEAD header; servers accept both kinds.

  4. Nov 2021

    Fully encrypted traffic blocked in China

    From November 6, 2021 the Great Firewall blocked servers of protocols that look like random bytes from the first packet, Shadowsocks and VMess among them.

  5. Jan 2022

    The MD5 login switched off

    V2Ray servers stopped accepting the old MD5 login (alterId above 0) by default on January 1, 2022.

  6. Jun 2023

    Xray drops the old code

    Xray v1.8.3 removed VMess MD5 altogether; its v1.5.1 notes in December 2021 had already asked users to delete alterId.

How VMess works

Everything starts from the UUID: the client and the server derive keys from it. The first 16 bytes of a connection are the auth ID: the current Unix time (8 bytes), 4 random bytes and a CRC32 of those 12, all encrypted with AES-128 under a key derived from the UUID. The server tries the key of each user it knows; the right one gives a valid checksum and a believable time.

Next comes the request header, sealed with AES-128-GCM: the version, the key and IV for the data, the cipher the client chose, the command (TCP or UDP), the destination port and address, and padding. Then the data goes in encrypted chunks, and the server's answer is encrypted the same way. VMess also pads data chunks with 0–63 random bytes.

So VMess doesn't need TLS to keep the contents secret, which is what it was built for. The price: with TLS on top, as it usually runs, the data is encrypted twice, and the login depends on the clock.

The clock check and alterId

Xray and sing-box reject an auth ID whose time is more than 120 seconds from the server's clock, and remember every ID for 120 seconds so a recorded one can't be replayed. V2Ray's documentation asks for the device time in UTC to be within 90 seconds. Time zones don't matter: what counts is the real time. A device with a wrong clock gets no error, just a dropped connection; Xray logs it on the server as “invalid timestamp, perhaps unsynchronized time”.

alterId, aid in links, is a leftover of the first login, which hashed the UUID and time with MD5. 0 means the AEAD login. A number above 0 asks for the MD5 login, which V2Ray servers refuse by default since 2022 and Xray no longer has; sing-box still takes alter_id 1 for old servers.

The security field: which cipher

The client picks the cipher for the data, scy in a link and security in a config; the server follows the client and needs no setting.

  • auto

    What it doesThe default: AES-128-GCM on AMD64, ARM64 and s390x, ChaCha20-Poly1305 on other architectures

    WhereV2Ray, Xray, sing-box

  • aes-128-gcm

    What it doesAES-128-GCM; fast where the processor has AES instructions

    WhereV2Ray, Xray, sing-box

  • chacha20-poly1305

    What it doesChaCha20-Poly1305; for processors without AES instructions

    WhereV2Ray, Xray, sing-box

  • none

    What it doesNo encryption of the data

    WhereV2Ray, sing-box; current Xray reads it as auto

  • zero

    What it doesNo encryption and no message authentication: a raw stream

    WhereV2Ray 4.35.0+, sing-box; current Xray reads it as auto

A vmess:// link decoded

After vmess:// comes base64, not an address. The format is version 2 of the v2rayN client's share link, and most other clients read it. The address is from a range reserved for documentation, and the UUID is made up.

Example
vmess://eyJ2IjoiMiIsInBzIjoiRnJhbmtmdXJ0IiwiYWRkIjoiMjAzLjAuMTEzLjIyIiwicG9ydCI6IjQ0MyIsImlkIjoiM2QxYzdhNTItOGU0Zi00YjBhLTljNmQtMmY3ZTFhNWI4YzkwIiwiYWlkIjoiMCIsInNjeSI6ImF1dG8iLCJuZXQiOiJ3cyIsInR5cGUiOiJub25lIiwiaG9zdCI6ImNkbi5leGFtcGxlLmNvbSIsInBhdGgiOiIvd3MiLCJ0bHMiOiJ0bHMiLCJzbmkiOiJjZG4uZXhhbXBsZS5jb20iLCJmcCI6ImNocm9tZSJ9

Any base64 decoder turns it back into JSON; on Linux or macOS, base64 -d does it. This is what the link above holds:

config.json
{
  "v": "2",
  "ps": "Frankfurt",
  "add": "203.0.113.22",
  "port": "443",
  "id": "3d1c7a52-8e4f-4b0a-9c6d-2f7e1a5b8c90",
  "aid": "0",
  "scy": "auto",
  "net": "ws",
  "type": "none",
  "host": "cdn.example.com",
  "path": "/ws",
  "tls": "tls",
  "sni": "cdn.example.com",
  "fp": "chrome"
}
  • v — the format version, "2".
  • ps — the profile name a client shows in its list.
  • add and port — the server's IP or domain and its port, both as text.
  • id — the UUID, your key on the server.
  • aid — alterId: "0" for the AEAD login; anything else asks for the retired MD5 one.
  • scy — the cipher from the table above; without it, auto.
  • net — the transport: tcp, ws, grpc, kcp and others.
  • type — the header disguise of tcp and kcp (none, http, srtp, utp, wechat-video); none for WebSocket.
  • host and path — the HTTP host and the WebSocket path; for gRPC, path carries the service name.
  • tls, sni, fp — "tls" turns TLS on, then the server name and the browser fingerprint; the format also has alpn, insecure, pcs and vcn.

What a censor sees

Bare VMess looks like random bytes from the first packet on. In May 2020 V2Ray issue 2523 showed a sharper problem with the old header: a prober could replay the first 54 bytes of a captured connection with small changes and, counting how many bytes the server read before it hung up, recognize a VMess server in 16 tries with almost no mistakes. That is what the AEAD header of September 2020 fixed.

Random-looking traffic. Wu and colleagues (USENIX Security 2023) describe how, from November 6, 2021, the Great Firewall blocks fully encrypted traffic: a first packet that looks random and matches no known protocol, to IP ranges of popular data centers, with about a quarter of such connections checked. VMess and Shadowsocks were among the affected tools. Traffic that starts like TLS or HTTP is exempt, which is one reason VMess moved inside TLS or WebSocket.

VMess inside TLS. Xue and colleagues (USENIX Security 2024) looked for TLS handshakes nested inside proxy connections at Merit, an ISP with over a million users, for 30 days in 2023. Their detector flagged 74.5% of VMess over TLS flows and 68.8% of VMess over WebSocket over TLS. VMess's own 0–63 byte padding barely helped: without it the rates were 84.1% and 85.9%. Multiplexing many streams in one connection cut detection to 12–37%.

Reports that VMess “has been identified” usually mean one of these. What isn't published is any way to decrypt VMess or recover the UUID from traffic: the known attacks recognize the server, they don't read the contents.

Why new servers use VLESS

VLESS was proposed in 2020 precisely because VMess over bare TCP was no longer trusted. Inside TLS it keeps one layer of encryption instead of two and doesn't care about the clock. The new pieces of the family were built for VLESS: XTLS Vision, which hides the TLS-inside-TLS pattern, and VLESS Encryption with a post-quantum handshake. Xray's docs pair REALITY with the Vision flow, a VLESS setting, and the vmess:// format has no fields for Reality at all. VMess stays where a service or an old panel hands it out, usually over WebSocket with TLS, and with alterId 0 such a link works fine.

Strengths and weaknesses

Strengths

  • Encrypts by itself: the contents stay secret even without TLS
  • Read by nearly every V2Ray, Xray, sing-box and mihomo client, old ones too
  • Runs over WebSocket or gRPC with TLS, so it can sit behind a CDN
  • The AEAD header of 2020 closed the replay probing of the old one

Weaknesses

  • Depends on the clock: more than 120 seconds off and the server drops you
  • Bare VMess looks random, a pattern the GFW has blocked since November 2021
  • With TLS the data is encrypted twice, and links have no Reality fields
  • No XTLS Vision or VLESS Encryption: they exist only for VLESS
  • Old alterId values in links still point to a login servers refuse

Where it works

Programs and servers from our comparison tables that list this protocol.

Clients

  • Happ
  • Hiddify
  • v2RayTun
  • INCY
  • Karing
  • v2rayNG
  • v2rayN
  • NekoBox for Android
  • NekoRay
  • Throne
  • V2Box
  • AmneziaVPN
  • Clash Verge Rev
  • Clash Party
  • FlClash
  • Shadowrocket
  • Stash
  • mihomo
  • sing-box
  • PassWall
  • PassWall 2
  • OpenClash

Servers and panels

  • 3X-UI
  • Marzban
  • S-UI
  • Hiddify Manager

Compare these programs

Sources

How we write and check

In Veli

VMess links in Veli

Veli opens vmess:// links and subscriptions with them on Windows, macOS, Linux and Android: Profiles → Add, paste the link or the subscription address and press “Continue”. There's no need to decode the base64: the app reads the fields by itself. On a computer it offers to install the sing-box or Xray module the first time. VMess is a proxy protocol, so the “Apps and sites” rules work on it by site and by app.

If a VMess profile connects but nothing loads, check the device clock first and turn on automatic time. Veli doesn't install VMess on your own server: “Your own server” in the app sets up VLESS Reality.

Questions

Is VMess secure?

With alterId 0 it uses an AEAD login and AEAD ciphers, AES-128-GCM or ChaCha20-Poly1305, and no published attack reads its contents. The known problems were the retired MD5 header, which allowed probing, and how VMess traffic looks on the wire.

Has VMess been identified by the GFW?

Bare VMess falls under the rule for fully encrypted traffic the GFW has applied since November 2021. Inside TLS it looks like HTTPS, but a 2024 study still recognized about 70% of such flows by the nested TLS handshakes.

Why does VMess stop working when the clock is wrong?

The login carries the current time, and Xray and sing-box refuse a time more than 120 seconds from the server's. Turn on automatic time; the time zone doesn't matter.

What does alterId 0 mean?

That the client uses the AEAD login, the only one current servers accept by default. A number above 0 asks for the old MD5 login; ask the service for a fresh link.

What is the difference between VMess and VLESS?

VMess encrypts by itself and checks the clock; VLESS doesn't, and relies on TLS, Reality or VLESS Encryption. VLESS also has XTLS Vision, which VMess lacks.

How do I read a vmess:// link?

Decode the part after vmess:// from base64 and you get JSON: add and port are the server, id the UUID, net the transport and tls whether TLS is on.