Skip to content
Gautier Lefebvre edited this page Feb 13, 2018 · 2 revisions

Encryption

There is a basic encryption module in the framework. As this is a sensitive matter, I would recommend using a true cryptography library (like crypto++) for any real encryption.

XOR

The framework contains a XOR encryptor (and decryptor). It is a symetric encryption algorithm which is extremely simple and extremely fast.

To encrypt/decrypt data, you can do this:

char buffer[] = "text to encrypt";
char key[] = "myKey";

fwk::Encryption::XOR::xorify(buffer, strlen(buffer), key, strlen(key));
// buffer is now encrypted.


fwk::Encryption::XOR::xorify(buffer, strlen(buffer), key, strlen(key));
// buffer is now back to "text to encrypt".
Clone this wiki locally