Table of Contents

Class DataEncrypter

Namespace
Moffat.EndlessOnline.SDK.Data
Assembly
Moffat.EndlessOnline.SDK.dll

A helper class for encrypting and decrypting EO data.

public static class DataEncrypter
Inheritance
DataEncrypter
Inherited Members

Methods

Deinterleave(byte[])

Deinterleaves a sequence of bytes. This is the reverse of Interleave(byte[]).

public static byte[] Deinterleave(byte[] data)

Parameters

data byte[]

The data to deinterleave

Returns

byte[]

The deinterleaved data

Remarks

Used when decrypting packets and data files.

Example: {0, 1, 2, 3, 4, 5} → {0, 2, 4, 5, 3, 1}

FlipMSB(byte[])

Flips the most significant bit of each byte in a sequence of bytes. Values 0 and 128 are not flipped.

public static byte[] FlipMSB(byte[] data)

Parameters

data byte[]

The data to flip most significant bits on

Returns

byte[]

The modified data

Remarks

Used when encrypting and decrypting packets.

Example: {0, 1, 127, 128, 129, 254, 255} → {0, 129, 255, 128, 1, 126, 127}

Interleave(byte[])

Interleaves a sequence of bytes. When encrypting EO data, bytes are "woven" into each other.

public static byte[] Interleave(byte[] data)

Parameters

data byte[]

The data to interleave

Returns

byte[]

The interleaved data

Remarks

Used when encrypting packets and data files.

Example: {0, 1, 2, 3, 4, 5} → {0, 5, 1, 4, 2, 3}

SwapMultiples(byte[], int)

Swaps the order of contiguous bytes in a sequence of bytes that are divisible by a given multiple value.

public static byte[] SwapMultiples(byte[] data, int multi)

Parameters

data byte[]

The data to swap bytes in

multi int

The multiple value

Returns

byte[]

The modified data

Remarks

Used when encrypting and decrypting packets and data files.

Example: for multi=3, {10, 21, 27} → {10, 27, 21}