{"record":{"id":"ce1059ddcf2e30d0","repo":"Pumpkin-MC/Pumpkin","slug":"failed-to-decrypt-shared-secret","errorCode":null,"errorMessage":"failed to decrypt shared secret","messagePattern":"failed to decrypt shared secret","errorType":"exception","errorClass":"EncryptionError","httpStatus":null,"severity":"error","filePath":"crates/pumpkin/src/net/mod.rs","lineNumber":424,"sourceCode":"        );\n        return Some(match entry.expires {\n            Some(expires) => text.add_child(TextComponent::translate_cross(\n                translation::java::MULTIPLAYER_DISCONNECT_BANNED_IP_EXPIRATION,\n                translation::java::MULTIPLAYER_DISCONNECT_BANNED_IP_EXPIRATION,\n                [TextComponent::text(\n                    expires.format(FORMAT_DESCRIPTION).unwrap_or_default(),\n                )],\n            )),\n            None => text,\n        });\n    }\n\n    None\n}\n\n#[derive(Error, Debug)]\npub enum EncryptionError {\n    #[error(\"failed to decrypt shared secret\")]\n    FailedDecrypt,\n    #[error(\"shared secret has the wrong length\")]\n    SharedWrongLength,\n    #[error(\"encryption is already enabled\")]\n    AlreadyEncrypted,\n    #[error(\"no encryption request is pending\")]\n    NoPendingVerifyToken,\n    #[error(\"verify token does not match\")]\n    VerifyTokenMismatch,\n}\n\nfn is_valid_player_name(name: &str) -> bool {\n    if name.len() > 16 {\n        return false;\n    }\n    !name.chars().any(|c| c.is_control() || c == ' ')\n}\n","sourceCodeStart":406,"sourceCodeEnd":442,"githubUrl":"https://github.com/Pumpkin-MC/Pumpkin/blob/8d4639e25a57c15e47448ec327c780d41bbf2356/crates/pumpkin/src/net/mod.rs#L406-L442","documentation":"EncryptionError variant thrown during the Java login encryption handshake when the client's encrypted shared secret cannot be decrypted with the server's private key. The client key pair or handshake response is wrong.","triggerScenarios":"Thrown at crates/pumpkin/src/net/mod.rs:424 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Abort the connection with a bad-encryption kick","Log the failure at debug level","Verify the client used the public key from the encryption request"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"8d4639e25a57c15e47448ec327c780d41bbf2356","analyzedAt":"2026-09-09T15:32:22.916Z","contentChangedAt":"2026-09-09T15:32:22.916Z","schemaVersion":2},"datasetVersion":"2026-09-17T15:17:12.973Z"}