Main Page | Modules | File List | File Members

# Data encryption functions

Data encryption functions. More...

## Functions
GShandle | InitializeCipher (GSCRYPTO_CIPHER_ALGO eAlgo, const GSubyte *ucKey, GSuint uiKeyLength)
| Initialize the encryption module.
GSvoid | UninitializeCipher (GShandle hCipher)
| Uninitialize the encryption module.
GSbool | ResetKey (GShandle hCipher, const GSubyte *ucKey, GSuint uiKeyLength)
| Reset the encryption key.
GSbool | Encrypt (GShandle hCipher, const GSvoid *pInputBuffer, GSuint uiInBufferLength, GSvoid *pOutputBuffer, GSuint *puiOutBufferLength)
| Encrypt a data buffer.
GSbool | Decrypt (GShandle hCipher, const GSvoid *pInputBuffer, GSuint uiInBufferLength, GSvoid *pOutputBuffer, GSuint *puiOutBufferLength)
| Decrypt a data buffer.

## Detailed Description

These functions are used to the encrypt data using symmetric encryption algorithms.

## Function Documentation

GSbool Decrypt | ( | GShandle | hCipher,
|  | const GSvoid * | pInputBuffer,
|  | GSuint | uiInBufferLength,
|  | GSvoid * | pOutputBuffer,
|  | GSuint * | puiOutBufferLength
| ) |

  | Description: This function decrypt a data buffer, and gives back the result in the output buffer, if you pass NULL as the output buffer, the function will return GS_FALSE and will give the predicted output buffer length. Returns: Status of the function call Return values:
  GS_TRUE | the operation suceeded.
  GS_FALSE | the operation failed.
  Parameters:
  hCipher | Handle on the cipher algorithm
  pInputBuffer | Input buffer to be decrypted
  uiInBufferLength | Input buffer length in bytes
  pOutputBuffer | Output buffer (decrypted data)
  puiOutBufferLength | Output buffer length in bytes

GSbool Encrypt | ( | GShandle | hCipher,
|  | const GSvoid * | pInputBuffer,
|  | GSuint | uiInBufferLength,
|  | GSvoid * | pOutputBuffer,
|  | GSuint * | puiOutBufferLength
| ) |

  | Description: This function encrypt a data buffer, and gives back the result in the output buffer, if you pass NULL as the output buffer, the function will return GS_FALSE and will give the predicted output buffer length. Returns: Status of the function call Return values:
  GS_TRUE | the operation suceeded.
  GS_FALSE | the operation failed.
  Parameters:
  hCipher | Handle on the cipher algorithm
  pInputBuffer | Input buffer to be encrypted
  uiInBufferLength | Input buffer length in bytes
  pOutputBuffer | Output buffer (encrypted data)
  puiOutBufferLength | Output buffer length in bytes

GShandle InitializeCipher | ( | GSCRYPTO_CIPHER_ALGO | eAlgo,
|  | const GSubyte * | ucKey,
|  | GSuint | uiKeyLength
| ) |

  | Description: Initialize the encryption module Returns: Status of the function call Return values:
  Identification | of the cipher algorithm created
  0 | if the operation failed
  Parameters:
  eAlgo | Encryption algorithm to be used
  ucKey | The key to be use for encryption and decryption
  uiKeyLength | Lentgh of the key

GSbool ResetKey | ( | GShandle | hCipher,
|  | const GSubyte * | ucKey,
|  | GSuint | uiKeyLength
| ) |

  | Description: Reset the encryption key without having to reinitialize the module Returns: Status of the function call Return values:
  GS_TRUE | the operation suceeded.
  GS_FALSE | the operation failed.
  Parameters:
  hCipher | Handle on the cipher algorithm
  ucKey | The key to be use for encryption and decryption
  uiKeyLength | Lentgh of the key

GSvoid UninitializeCipher | ( | GShandle | hCipher | ) |

  | Description: Uninitialize the encryption module Returns: void Parameters:
  hCipher | handle on the cipher algorithm

Ubi.com GameService SDK - ©UbiSoft Entertainment 2002
GameService development team