origin-sdk
This crate handles the low-level networking, cryptography, and request/response mapping of the LSX protocol, providing an asynchronous API for connecting, authenticating, and interacting with the Origin (EA Desktop) backend.
Usage
use ;
async
LSX models
All request types are defined in src/protocol and are organized by domain:
achievements.rsauth.rsbroadcast.rschat.rs- etc.
Each request implements the RequestResponse trait, which is generated by the request_response! macro.
This ensures requests are automatically mapped to their corresponding ResponseBody variant:
request_response!
// This call will be automatically deserialized into a `GetProfileResponse`
let profile = client.send_request.await?;
Cryptography
The LSX protocol uses a custom AES-128-ECB scheme with deterministic key derivation. The session key is derived through a challenge handshake with the server.
Key Notes
- AES-128-ECB + PKCS#7 padding is used for encryption and decryption
- Session keys are generated from integer seeds and are expanded into 16-byte arrays
- Pseudo-random number generator is used to produce bytes from the seed
Challenge Flow
- The server sends a
Challengeevent with a random hex string key - The client encrypts this ASCII challenge string using AES-128-ECB with the default key
- The encrypted data is hex-encoded into a string
- The first two bytes of the hex string as ASCII bytes are combined into a u16 seed
seed = | byte - The derived seed is used to generate a new AES key and it becomes the session key for all subsequent encryption/decryption operations
- The client sends a
ChallengeResponserequest back to the server, which includes:- The original challenge key
- The encrypted + hex-encoded response key
- SDK metadata (protocol version, SDK version, etc.)
- The server sends a
ChallengeAcceptedresponse, both sides now share the same AES key
Acknowledgements
Warranty Voiderfor releasing LSX-Dumper and publishing information about the protocol on various forumsBergmann89for releasing xsd-parser, which helped with LSX model generation
Disclaimer
This project is a third-party reimplementation of the Origin SDK, based on reverse-engineering and observations of Origin SDK versions 9.12.1.7 and 10.6.1.8, intended for educational and research purposes only.
It is not affiliated with, endorsed by, or supported by Electronic Arts.