Skip to content

Encryption

gatchi edited this page Jun 3, 2017 · 6 revisions

Blue Burst uses a modified Blowfish encryption scheme for incoming and outgoing packets.

Use

Ship

Encryption is pseudo-started when a client connects. Whenever a ship detects a new client, it sends a sort of welcome packet called Packet03, which contains the ship and client keys in plaintext. The keys are generated with a random number generator from the mtwist library (mt_lrand). This is the first step.

In order to decrypt and encrypt future packets, the ship (and the client) then must construct two special tables using the keys and a cipher. This is done via the function pso_crypt_table_init_bb.

Now that setup is done, it uses the functions encrypt_copy and decrypt_copy (and within those, pso_crypt_encrypt_bb and pso_crypt_decrypty_bb to handle packets whenever they come in or need to be sent out. ShipProcessPacket and BlockProcessPacket are used for handling received & freshly decrypted client packets.

Clone this wiki locally