---
title: Key
description: "Login 0x01, client → server."
---

`login` · `0x01` · **serverbound** (client → server)

Encryption response. The client sends the `sharedSecret` and `verifyToken`, both encrypted with the server's public key from the clientbound `Hello`. The server decrypts them, checks the token, enables AES encryption on the connection, and in online mode verifies the session with Mojang.

Sent by the client, read by the server. Listen for it with `client.on("Key", (data) => …)` on the receiving side.

## Fields

| Field | Type | Notes |
|---|---|---|
| `sharedSecret` | Byte[] |  |
| `verifyToken` | Byte[] |  |

## Send it

```ts
await client.sendPacket("Key", {
  sharedSecret: /* Byte[] */,
  verifyToken: /* Byte[] */,
});
```

Field aliases listed under Notes are accepted as alternative keys when writing.

Source: [`src/Core/Versions/776/Packets/login/serverbound/Key.ts`](https://github.com/GDLev/mc-protocol/blob/master/src/Core/Versions/776/Packets/login/serverbound/Key.ts)
