#handshake #security #silkroad

skrillax-security

Security implementation for Silkroad Online packet streams

1 unstable release

0.1.0 Apr 28, 2024

#7 in #silkroad

38 downloads per month
Used in 3 crates (2 directly)

MIT license

46KB
670 lines

skrillax-security

Crates.io Docs.rs

skrillax-security is part of the skrillax-network family of crates for handling the network part of communication between a Silkroad Online client and/or server. This crate specifically deals with the security aspects of a Silkroad Online connection. In particular, the encryption used, the handshake as well as other security measures like checksum generation.

Documentation

For documentation, please see the docs.rs page.

License

Like the rest of the skrillax-network crates, this crate is licensed under the MIT license.


lib.rs:

This module underpins the security aspects of the network communication between a Silkroad Online client and server. It provides the building blocks to establish a common encryption secret ([SilkroadEncryption]) through a handshake (handshake::ActiveHandshake, handshake::PassiveHandshake), which als provide CRC and count security checks. This provided without any I/O, such that you could feasibly add it to whatever setup you have, or you can use the skrillax-stream crate that provides an async version on top of tokio (albeit with a bit more than just the handshake).

The main way you want to be interfacing with this crate is through the handshake structs of which there are two: handshake::ActiveHandshake & handshake::PassiveHandshake. As the name suggests, the handshake is composed of an active and a passive part, usually being the server and the client respectively. The server is considered the active part of the handshake, because it will start the handshake procedure by sending the passive part (i.e. the client) initialization data. After which a few more messages will be exchanged until both parties have both setup their security bytes ([MessageCounter] & [Checksum]) as well as the shared encryption ([SilkroadEncryption]). Please refer to the documentation of the individual handshake element for more information about the procedure of a handshake.

Each of the three elements ([MessageCounter], [Checksum], and [SilkroadEncryption]) can be used independently of each other if so desired.

Dependencies

~1.1–1.9MB
~38K SLoC