Photon Server API Documentation v5.0RC1

Public Member Functions | List of all members
Photon.SocketServer.Security.Decryptor Class Reference

Implements decryption More...

Inheritance diagram for Photon.SocketServer.Security.Decryptor:
Photon.SocketServer.Security.CryptoBase

Public Member Functions

byte[] DecryptBufferWithIV (byte[] data, int offset, int len)
 Decrypts buffer containing IV More...
 
bool CheckHMAC (byte[] data)
 Checkes wheter data have corect HMAC or not More...
 
bool CheckHMAC (byte[] data, int offset, int len)
 Checkes wheter data have corect HMAC or not More...
 
bool CheckHMACThreadSafe (byte[] data)
 Checkes wheter data have corect HMAC or not More...
 
bool CheckHMACThreadSafe (byte[] data, int offset, int len)
 Checkes wheter data have corect HMAC or not More...
 
- Public Member Functions inherited from Photon.SocketServer.Security.CryptoBase
void Init (byte[] encryptionSecret, byte[] hmacSecret)
 Initialize More...
 
void Dispose ()
 

Additional Inherited Members

- Static Public Attributes inherited from Photon.SocketServer.Security.CryptoBase
const int BLOCK_SIZE = 16
 Defines block size for encryption/decryption algorithm More...
 
const int IV_SIZE = BLOCK_SIZE
 Defines IV size for encryption/decryption algorithm More...
 
const int HMAC_SIZE = 32
 Defines HMAC size for packet authentication algorithm More...
 
- Protected Attributes inherited from Photon.SocketServer.Security.CryptoBase
Aes encryptor
 Encryption/decryption algorithm implementation More...
 
HMACSHA256 hmacsha256
 Packet authentication algorithm impelmenation More...
 

Detailed Description

Implements decryption

Member Function Documentation

◆ CheckHMAC() [1/2]

bool Photon.SocketServer.Security.Decryptor.CheckHMAC ( byte[]  data)
inline

Checkes wheter data have corect HMAC or not

Parameters
databuffer with data and HMAC
Returns
true if check pass, false otherwise

Not thread safe

◆ CheckHMAC() [2/2]

bool Photon.SocketServer.Security.Decryptor.CheckHMAC ( byte[]  data,
int  offset,
int  len 
)
inline

Checkes wheter data have corect HMAC or not

Parameters
databuffer with data and HMAC
offsetoffset in a buffer
lenlength of data
Returns
true if check pass, false otherwise

Not thread safe

◆ CheckHMACThreadSafe() [1/2]

bool Photon.SocketServer.Security.Decryptor.CheckHMACThreadSafe ( byte[]  data)
inline

Checkes wheter data have corect HMAC or not

Parameters
databuffer with data and HMAC
Returns
true if check pass, false otherwise

thread safe

◆ CheckHMACThreadSafe() [2/2]

bool Photon.SocketServer.Security.Decryptor.CheckHMACThreadSafe ( byte[]  data,
int  offset,
int  len 
)
inline

Checkes wheter data have corect HMAC or not

Parameters
databuffer with data and HMAC
offsetoffset in a buffer
lenlength of data
Returns
true if check pass, false otherwise

thread safe

◆ DecryptBufferWithIV()

byte [] Photon.SocketServer.Security.Decryptor.DecryptBufferWithIV ( byte[]  data,
int  offset,
int  len 
)
inline

Decrypts buffer containing IV

Parameters
dataencrypted data prepened by IV
offsetoffset in the buffer
lenlen of data to decrypt
Returns

Thread safe