About
GeCipher256 class provides means to encrypt and decrypt data.
- Warning
- This class only uses a simple and insecure scrambling. Use advanced algorithms like AES if security is really needed.
-
For encryption using the MAXON API ALIASES see Stream Conversions Manual.
Char plainText[] =
"O brave new world / That has such people in't!";
const Int32 length =
sizeof(plainText);
const Char key[32] = {
'7',
'c',
'3',
'0',
'e',
'0',
'0',
'b',
'b',
'6',
'2',
'7',
'1',
'4',
'9',
'5' };
const Int32 keyLength =
sizeof(key);
if (!cipher.
Open(key, keyLength,
false))
return maxon::UnexpectedError(
MAXON_SOURCE_LOCATION,
"The function exited unexpectedly on initializing GeCipher256"_s);
Char plainTextEncoded[
sizeof(plainText) + 1];
CopyMem(plainText, plainTextEncoded, length);
plainTextEncoded[sizeof(plainText)] = 0;
Create
A GeCipher256 instance can be created by simply defining it (e.g. as a local variable). No special allocation is needed.
Use
Encryption / Decryption
Further Reading