Skip to content
forked from njh0602/cryptor

simple interface, header-only, super easy to use cryptor, no dependency, xor encryption, base64 encode

License

Notifications You must be signed in to change notification settings

shuai132/cryptor

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 

Repository files navigation

cryptor

use xor encryption/decryption + base64 encode/decode

test

g++ -std=c++11 test.cpp -o test
./test

fast sample:

#include <iostream>
using namespace std;

#include "cryptor.hpp"

int main()
{
    auto enc = cryptor::encrypt("hello world");
    auto dec = cryptor::decrypt(enc);
    cout << "enc: " << enc << endl;
    cout << "dec: " << dec << endl;
}

output:

enc: DAAKDRpMAzAZCR0=
dec: hello world

use custom key sample:

#include <iostream>
using namespace std;

#include "cryptor.hpp"

int main()
{
    cryptor::set_key("it is my custom key!");
    auto enc = cryptor::encrypt("hello world");
    auto dec = cryptor::decrypt(enc);
    cout << "key: " << cryptor::get_key() << endl;
    cout << "enc: " << enc << endl;
    cout << "dec: " << dec << endl;
}

output:

key: it is my custom key!
enc: ARFMBRwAGhZSDxE=
dec: hello world

About

simple interface, header-only, super easy to use cryptor, no dependency, xor encryption, base64 encode

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C++ 100.0%