Photon Server API Documentation v5.0RC1

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

An ICryptoProvider implementation using the Rijndael symmetric encryption algorithm. More...

Inheritance diagram for Photon.SocketServer.Security.RijndaelCryptoProvider:
Photon.SocketServer.Security.ICryptoProvider

Public Member Functions

 RijndaelCryptoProvider (byte[] secretKey)
 Initializes a new instance of the RijndaelCryptoProvider class. More...
 
 RijndaelCryptoProvider (byte[] secretKey, PaddingMode paddingMode)
 Initializes a new instance of the RijndaelCryptoProvider class. More...
 
byte[] Decrypt (byte[] data)
 Decrypts the data . More...
 
byte[] Decrypt (byte[] data, int offset, int count)
 Decrypts the data . More...
 
int DecryptInplace (byte[] data, int offset, int count)
 Decrypts the data . More...
 
byte[] Encrypt (byte[] data)
 Encrypts the data . More...
 
byte[] Encrypt (byte[] data, int offset, int count)
 Encrypts the data . More...
 
int EncryptInplace (byte[] data, int offset, int count)
 

Properties

bool IsInitialized [get]
 Gets a value indicating whether IsInitialized. More...
 
PaddingMode Padding [get]
 Gets the padding mode used in the symmetric algorithm. The default is PaddingMode.PKCS7 More...
 
- Properties inherited from Photon.SocketServer.Security.ICryptoProvider
bool IsInitialized [get]
 Gets a value indicating whether IsInitialized. More...
 

Detailed Description

An ICryptoProvider implementation using the Rijndael symmetric encryption algorithm.

Constructor & Destructor Documentation

◆ RijndaelCryptoProvider() [1/2]

Photon.SocketServer.Security.RijndaelCryptoProvider.RijndaelCryptoProvider ( byte[]  secretKey)
inline

Initializes a new instance of the RijndaelCryptoProvider class.

Parameters
secretKeyThe secret key for the symmetric algorithm. This algorithm supports key lengths of 128, 192, or 256 bits (16, 24 or 32 bytes).
Exceptions
CryptographicExceptionThe key size is invalid. This algorithm supports key lengths of 128, 192, or 256 bits (16, 24 or 32 bytes).

The secret key is used both for encryption and for decryption. For a symmetric algorithm to be successful, the secret key must be known only to the sender and the receiver.

◆ RijndaelCryptoProvider() [2/2]

Photon.SocketServer.Security.RijndaelCryptoProvider.RijndaelCryptoProvider ( byte[]  secretKey,
PaddingMode  paddingMode 
)
inline

Initializes a new instance of the RijndaelCryptoProvider class.

Parameters
secretKeyThe secret key for the symmetric algorithm. This algorithm supports key lengths of 128, 192, or 256 bits.
paddingModeThe padding mode.
Exceptions
CryptographicExceptionThe key size is invalid. This algorithm supports key lengths of 128, 192, or 256 bits (16, 24 or 32 bytes).

The secret key is used both for encryption and for decryption. For a symmetric algorithm to be successful, the secret key must be known only to the sender and the receiver.

Member Function Documentation

◆ Decrypt() [1/2]

byte [] Photon.SocketServer.Security.RijndaelCryptoProvider.Decrypt ( byte[]  data)
inline

Decrypts the data .

Parameters
dataThe data.
Returns
The decrypted data.

Implements Photon.SocketServer.Security.ICryptoProvider.

◆ Decrypt() [2/2]

byte [] Photon.SocketServer.Security.RijndaelCryptoProvider.Decrypt ( byte[]  data,
int  offset,
int  count 
)
inline

Decrypts the data .

Parameters
dataThe data.
offsetThe offset.
countThe count.
Returns
The decrypted data.

Implements Photon.SocketServer.Security.ICryptoProvider.

◆ DecryptInplace()

int Photon.SocketServer.Security.RijndaelCryptoProvider.DecryptInplace ( byte[]  data,
int  offset,
int  count 
)
inline

Decrypts the data .

Parameters
dataThe data.
offsetThe offset.
countThe count.
Returns
The decrypted data.

Implements Photon.SocketServer.Security.ICryptoProvider.

◆ Encrypt() [1/2]

byte [] Photon.SocketServer.Security.RijndaelCryptoProvider.Encrypt ( byte[]  data)
inline

Encrypts the data .

Parameters
dataThe data to encrypt.
Returns
The encrypted data.

Implements Photon.SocketServer.Security.ICryptoProvider.

◆ Encrypt() [2/2]

byte [] Photon.SocketServer.Security.RijndaelCryptoProvider.Encrypt ( byte[]  data,
int  offset,
int  count 
)
inline

Encrypts the data .

Parameters
dataThe data.
offsetThe offset.
countThe count.
Returns
The encrypted data.

Implements Photon.SocketServer.Security.ICryptoProvider.

◆ EncryptInplace()

int Photon.SocketServer.Security.RijndaelCryptoProvider.EncryptInplace ( byte[]  data,
int  offset,
int  count 
)
inline

Property Documentation

◆ IsInitialized

bool Photon.SocketServer.Security.RijndaelCryptoProvider.IsInitialized
get

Gets a value indicating whether IsInitialized.

◆ Padding

PaddingMode Photon.SocketServer.Security.RijndaelCryptoProvider.Padding
get

Gets the padding mode used in the symmetric algorithm. The default is PaddingMode.PKCS7

The padding.