Method | Description | |
---|---|---|
Client ( |
Creates a new instance of the EndpointCrypto class used for client-side cryptography. Encryption uses the local IV, decryption uses the remote IV. Server's local IV has flipped version, Client's local IV has regular version. |
|
Decrypt ( byte packet ) : void |
Decrypts the given packet in-place. The array will be modified directly. |
|
EncryptAndPack ( byte packetData ) : byte[] |
Encrypts a packet, constructs a header for it and packs them into a new array. The array given as the packetData parameter is transformed in-place. |
|
Server ( |
Creates a new instance of the EndpointCrypto class used for server-side cryptography. Encryption uses the local IV, decryption uses the remote IV. Server's local IV has flipped version, Client's local IV has regular version. |
|
TryGetLength ( byte header, int &length ) : bool |
Attempts to extract the length of a packet from its header. When overriding this method in a derived class, do not call the base implementation. |
|
TryUnpackAndDecrypt ( byte rawData, byte &decryptedData ) : bool |
Attempts to unpack the packet data from the given array and decrypt it. This method will return |
Method | Description | |
---|---|---|
ConstructHeader ( int length ) : byte[] |
Constructs a packet header and encodes the given length in it. When overriding this method in a derived class, do not call the base implementation. |
|
EndpointCrypto ( |
Initializes a new instance of the EndpointCrypto class.
|
public static Client ( |
||
factory | The |
|
clientIv | byte | The IV for the client. |
serverIv | byte | The IV for the server. |
return |
public Decrypt ( byte packet ) : void | ||
packet | byte | The data to decrypt. |
return | void |
public EncryptAndPack ( byte packetData ) : byte[] | ||
packetData | byte | The packet data to encrypt and pack. |
return | byte[] |
public static Server ( |
||
factory | The |
|
clientIv | byte | The IV for the client. |
serverIv | byte | The IV for the server. |
return |
public TryGetLength ( byte header, int &length ) : bool | ||
header | byte | The header byte array to process. |
length | int | A variable to hold the result. |
return | bool |
public TryUnpackAndDecrypt ( byte rawData, byte &decryptedData ) : bool | ||
rawData | byte | The raw packet data. |
decryptedData | byte | A reference to hold the decrypted data. |
return | bool |