0x01 C01PacketEncryptionResponse
Responds to the server's encryption request with the shared secret (RSA-encrypted with the server's public key) and verify token.
Published 2026-06-18 · Updated 2026-10-14
Fields
| Field | Type | Description |
|---|---|---|
| sharedSecret | byte[] | Encrypted shared secret (AES key encrypted with server's RSA public key) |
| verifyToken | byte[] | Encrypted verify token (random challenge encrypted with server's RSA public key) |
Wire Encoding
| Field | Type | Notes |
|---|---|---|
| Shared Secret Length | VarInt | Length of encrypted secret |
| Shared Secret | byte[] | Encrypted with server's RSA public key |
| Verify Token Length | VarInt | Length of encrypted token |
| Verify Token | byte[] | Encrypted with server's RSA public key |
MCP References
NetHandlerLoginServer.processEncryptionResponse()Handler Interface
INetHandlerLoginServerVanilla Source
| 1 | |
| 2 | |
| 3 | |
| 4 | |
| 5 | |
| 6 | |
| 7 | |
| 8 | |
| 9 | |
| 10 | |
| 11 | |
| 12 | |
| 13 | |
| 14 | |
| 15 | |
| 16 | |
| 17 | |
| 18 | |
| 19 | |
| 20 | |
| 21 | |
| 22 | |
| 23 | |
| 24 | |
| 25 | |
| 26 | |
| 27 | |
| 28 | |
| 29 | |
| 30 | |
| 31 | |
| 32 | |
| 33 | |
| 34 | |
| 35 | |
| 36 | |
| 37 | |
| 38 | |
| 39 | |
| 40 | |
| 41 | |
| 42 | |
| 43 | |
| 44 | |
| 45 | |
| 46 | |
| 47 | |
| 48 | |
| 49 | |
| 50 | |
| 51 | |
| 52 | |
| 53 | |
| 54 | |
| 55 | |
| 56 | |
| 57 | |
| 58 | |
| 59 | |
| 60 | |
| 61 | |
| 62 | |
Deobfuscated MCP 1.8.9 source of C01PacketEncryptionResponse, fetched directly from Marcelektro/MavenMCP-1.8.9 (net/minecraft/network/login/client/C01PacketEncryptionResponse.java) at build time and verified present.
Deep Dive
Role in the protocol
C01PacketEncryptionResponse is the second LOGIN-state packet and the last plaintext packet on the connection. The client generates a random AES secret, RSA-encrypts it together with the verify token from S01PacketEncryptionRequest using the server's public key, and sends both byte arrays. The server decrypts with its private key, checks the nonce, and enables symmetric AES encryption on the channel from that point on. In 1.8.9 this is where the session service join happens: the server hashes server id, public key and secret, and calls hasJoinedServer to resolve the profile UUID.
Vanilla handling
NetHandlerLoginServer.processEncryptionResponse validates the state is KEY, decrypts the verify token with the private key, and throws IllegalStateException('Invalid nonce!') unless it matches the stored field_147330_e. It then stores the secret key, enables encryption on the NetworkManager, and spawns a 'User Authenticator' thread that computes the server-id hash and calls getMinecraftSessionService().hasJoinedServer. A null profile closes with 'Failed to verify username!'; a success moves to READY_TO_ACCEPT and sends S02PacketLoginSuccess.
Why clients touch it
Two clients reference this packet, for opposite reasons. Rise 6.1.30 and 6.2.4 BlinkComponent list it in the pre-play exemption set, again as a buffering exemption: blink must not hold it because the server sits in KEY state until encryption is enabled. LiquidSense Dev reimplements the send itself: MixinNetHandlerLoginClient intercepts S01PacketEncryptionRequest and calls ClientUtils.sendEncryption, which builds C01PacketEncryptionResponse and sends it with a callback that enables encryption on the NetworkManager. No module in the corpus cancels, mutates or replays the packet, and there is no field worth spoofing: the nonce is server-issued and RSA-protected, so a tampered secret simply fails the nonce check or produces garbage decryption server-side. The 8 classic clients treat encryption as untouchable infrastructure; their disablers and ping spoofers all operate in the PLAY state where the stream is already encrypted.
Exploit surface
The genuine abuse vector lives on the other side of the exchange: a malicious server can present its own RSA key in S01PacketEncryptionRequest and the client will happily encrypt the session to it, enabling MITM for session hijacking. That is a phishing problem, not a packet-level one, and no module in the corpus touches either side. The only client-side interaction is defensive: blink must not buffer this packet, because holding it would leave the server waiting in KEY state until the login timeout.
Server-Side Handling
processEncryptionResponse: Validate.validState(KEY), decrypt verify token with the private key and compare against the stored nonce (throw on mismatch), store the AES secret, enable encryption on the channel, then authenticate asynchronously via hasJoinedServer with the server-id hash. Failures close the connection with 'Failed to verify username!'.
Protocol Analysis
LOGIN state, id 0x01. Two VarInt-length-prefixed byte arrays: the RSA-encrypted AES secret and the RSA-encrypted verify token, both PKCS1-padded by CryptManager. Must follow S01PacketEncryptionRequest; sending it without a pending KEY state throws. Immediately after this packet the entire stream switches to AES/CFB8, so every later packet is opaque on the wire.
Anti-Cheat Landscape
Not an anti-cheat surface at all: no gameplay data, no timing hooks, and the exchange is protected by the server's own nonce. Proxy setups (BungeeCord with forced hosts) use the secret to key their own encryption layer, but nothing in the 8 clients interacts with that. The practical flagging surface is zero, which is why only BlinkComponent's defensive exemption appears in the corpus.
implementation Implementation Cases
The RSA handshake closer: client sends encrypted AES secret plus verify token, server nonce-checks and enables symmetric encryption. Corpus hits are Rise 6.x BlinkComponent's exemption and LiquidSense Dev's mixin-driven reimplementation of the send; no module cancels or spoofs it because there is nothing to gain and everything to lose.
Exempt C01PacketEncryptionResponse from blink buffering so the encryption exchange always completes and the connection actually becomes encrypted.
The PacketSendEvent listener's hard-coded pre-play exemption list includes C01PacketEncryptionResponse; the packet returns untouched and is never parked in the blink queue, so the login continues to the READY_TO_ACCEPT state normally.
// ===== FILE: Rise 6.2.4, Client-release2/Client/src/main/java/com/alan/clients/component/impl/player/BlinkComponent.java =====
package com.alan.clients.component.impl.player;
import com.alan.clients.component.Component;
import com.alan.clients.event.Listener;
import com.alan.clients.event.Priorities;
import com.alan.clients.event.annotations.EventLink;
import com.alan.clients.event.impl.other.ServerJoinEvent;
import com.alan.clients.event.impl.other.WorldChangeEvent;
import com.alan.clients.event.impl.packet.PacketSendEvent;
import com.alan.clients.util.packet.PacketUtil;
import net.minecraft.network.Packet;
import net.minecraft.network.handshake.client.C00Handshake;
import net.minecraft.network.login.client.C00PacketLoginStart;
import net.minecraft.network.login.client.C01PacketEncryptionResponse;
import net.minecraft.network.play.client.C03PacketPlayer;
import net.minecraft.network.status.client.C00PacketServerQuery;
import net.minecraft.network.status.client.C01PacketPing;
import rip.vantage.commons.util.time.StopWatch;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.concurrent.ConcurrentLinkedQueue;
public final class BlinkComponent extends Component {
public static final ConcurrentLinkedQueue<Packet<?>> packets = new ConcurrentLinkedQueue<>();
public static boolean blinking, dispatch;
public static ArrayList<Class<?>> exemptedPackets = new ArrayList<>();
public static StopWatch exemptionWatch = new StopWatch();
public static void setExempt(Class<?>... packets) {
exemptedPackets = new ArrayList<>(Arrays.asList(packets));
exemptionWatch.reset();
}
@EventLink(value = Priorities.VERY_LOW)
public final Listener<PacketSendEvent> onPacketSend = event -> {
if (mc.thePlayer == null) {
packets.clear();
exemptedPackets.clear();
return;
}
if (mc.thePlayer.isDead || mc.isSingleplayer() || !mc.getNetHandler().doneLoadingTerrain) {
packets.forEach(PacketUtil::sendNoEvent);
packets.clear();
blinking = false;
exemptedPackets.clear();
return;
}
final Packet<?> packet = event.getPacket();
if (packet instanceof C00Handshake || packet instanceof C00PacketLoginStart ||
packet instanceof C00PacketServerQuery || packet instanceof C01PacketPing ||
packet instanceof C01PacketEncryptionResponse) {
return;
}
if (blinking && !dispatch) {
if (exemptionWatch.finished(100)) {
exemptionWatch.reset();
exemptedPackets.clear();
}
// PingSpoofComponent.spoofing = false;
if (!event.isCancelled() && exemptedPackets.stream().noneMatch(packetClass ->
packetClass == packet.getClass())) {
packets.add(packet);
event.setCancelled();
}
} else if (packet instanceof C03PacketPlayer) {
packets.forEach(PacketUtil::sendNoEvent);
packets.clear();
dispatch = false;
}
};
public static void dispatch() {
dispatch = true;
}
@EventLink(value = Priorities.VERY_LOW)
public final Listener<WorldChangeEvent> onWorldChange = event -> {
packets.clear();
BlinkComponent.blinking = false;
};
@EventLink(value = Priorities.VERY_LOW)
public final Listener<ServerJoinEvent> onServerJoin = event -> {
packets.clear();
BlinkComponent.blinking = false;
};
}
// NOTE (AI): This is the most safety-critical entry in the exemption list: buffering the encryption response would leave the server blocked in KEY state waiting for the nonce, and the client would never enable its own AES side. The exemption guarantees the crypto handshake is never delayed, not even by 100ms exemption windows elsewhere in the component.Centralize the encryption handshake send so the login mixin can enable AES on the channel without duplicating the vanilla NetHandlerLoginClient logic.
sendEncryption(networkManager, secretKey, publicKey, encryptionRequest) builds the C01PacketEncryptionResponse from the already-generated AES secret, the server's RSA public key and the request's verify token, sends it through networkManager.sendPacket and enables encryption on the same manager inside the completion callback. The static helper is called from MixinNetHandlerLoginClient's intercept of S01PacketEncryptionRequest.
// ===== FILE: LiquidSense Dev, net/ccbluex/liquidbounce/utils/ClientUtils.java =====
/*
* LiquidBounce Hacked Client
* A free open source mixin-based injection hacked client for Minecraft using Minecraft Forge.
* https://github.com/CCBlueX/LiquidBounce/
*/
package net.ccbluex.liquidbounce.utils;
import com.google.gson.JsonObject;
import net.minecraft.client.settings.GameSettings;
import net.minecraft.network.NetworkManager;
import net.minecraft.network.login.client.C01PacketEncryptionResponse;
import net.minecraft.network.login.server.S01PacketEncryptionRequest;
import net.minecraft.util.IChatComponent;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import javax.crypto.SecretKey;
import java.lang.reflect.Field;
import java.security.PublicKey;
@SideOnly(Side.CLIENT)
public final class ClientUtils extends MinecraftInstance {
private static final Logger logger = LogManager.getLogger("LiquidBounce");
private static Field fastRenderField;
static {
try {
fastRenderField = GameSettings.class.getDeclaredField("ofFastRender");
if(!fastRenderField.isAccessible())
fastRenderField.setAccessible(true);
}catch(final NoSuchFieldException ignored) {
}
}
public static Logger getLogger() {
return logger;
}
public static void disableFastRender() {
try {
if(fastRenderField != null) {
if(!fastRenderField.isAccessible())
fastRenderField.setAccessible(true);
fastRenderField.setBoolean(mc.gameSettings, false);
}
}catch(final IllegalAccessException ignored) {
}
}
public static void sendEncryption(final NetworkManager networkManager, final SecretKey secretKey, final PublicKey publicKey, final S01PacketEncryptionRequest encryptionRequest) {
networkManager.sendPacket(new C01PacketEncryptionResponse(secretKey, publicKey, encryptionRequest.getVerifyToken()), p_operationComplete_1_ -> networkManager.enableEncryption(secretKey));
}
public static void displayChatMessage(final String message) {
if (mc.thePlayer == null) {
getLogger().info("(MCChat)" + message);
return;
}
final JsonObject jsonObject = new JsonObject();
jsonObject.addProperty("text", message);
mc.thePlayer.addChatMessage(IChatComponent.Serializer.jsonToComponent(jsonObject.toString()));
}
}
// NOTE (AI): LiquidBounce's ClientUtils is a grab-bag utility; the C01 hit is the static sendEncryption helper at the end, which mirrors the vanilla NetHandlerLoginClient flow (secret key generation already happened, then C01 with a GenericFutureListener that enables encryption). The lambda form of the callback and the reflection-based fastRender toggle above it are unrelated; the mixin caller is MixinNetHandlerLoginClient, which routes the request through this helper instead of vanilla's inline send.
anticheat Anti-Cheat Checks
The encryption response closes the RSA handshake and is the last plaintext packet on the connection, so anticheats never flag it. Corpus hits are registrations: Negativity lists ENCRYPTION_BEGIN_IN and ENCRYPTION_BEGIN_OUT in its PacketType enum, Artemis maps PacketLoginClientEncryptionBegin in its PacketRepository, and intave's ServerboundConfirmEncryption belongs to Intave's own cloud-control channel with its own cipher pipeline, not to the Minecraft login exchange. After this packet the stream is AES-encrypted and every later anticheat sees ciphertext.
Related Packets
Wiki Cross-Reference
LOGIN serverbound 0x01; two VarInt-length byte arrays: RSA-encrypted AES secret plus encrypted verify token.
Server decrypts with its private key, checks the nonce, then enables AES/CFB8 so later traffic is opaque.
Valid only in KEY state after S01; a bad nonce or failed auth closes the connection instead of joining.
MCP 1.8.9 C01PacketEncryptionResponse implements Packet
1.8.9 callers: NetHandlerLoginClient.handleEncryptionRequest sends new C01PacketEncryptionResponse (line 86): https://github.com/Marcelektro/MavenMCP-1.8.9/blob/master/src/main/java/net/minecraft/client/network/NetHandlerLoginClient.java
Cross-checked against minecraft.wiki (CC BY-SA 3.0) for 1.8.9 accuracy.