26 #include "../stdext/types.h"
29 #include <boost/uuid/uuid.hpp>
33 typedef struct rsa_st
RSA;
42 std::string
base64Encode(
const std::string& decoded_string);
43 std::string
base64Decode(
const std::string& encoded_string);
44 std::string
xorCrypt(
const std::string& buffer,
const std::string& key);
45 std::string
encrypt(
const std::string& decrypted_string) {
return _encrypt(decrypted_string,
true); }
46 std::string
decrypt(
const std::string& encrypted_string) {
return _decrypt(encrypted_string,
true); }
52 void rsaSetPrivateKey(
const std::string &p,
const std::string &q,
const std::string &d);
58 std::string _encrypt(
const std::string& decrypted_string,
bool useMachineUUID);
59 std::string _decrypt(
const std::string& encrypted_string,
bool useMachineUUID);
60 std::string getCryptKey(
bool useMachineUUID);
61 boost::uuids::uuid m_machineUUID;
63 mpz_t m_p, m_q, m_n, m_e, m_d;