-
Notifications
You must be signed in to change notification settings - Fork 0
Encryption
Gautier Lefebvre edited this page Feb 13, 2018
·
2 revisions
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.
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".