Oto kod :
#pragma once
#include <Windows.h>
#include <iostream>
#include <string>
using namespace std;
//XOR: Encrypt data before sending :D
//
string XORData(string toEncryptDecrypt) {
char key[3] = { 'A', 'B', 'C' }; //Any chars will work
string output = toEncryptDecrypt;
for (int i = 0; i < toEncryptDecrypt.size(); i++)
output[i] = toEncryptDecrypt[i] ^ key[i % (sizeof(key) / sizeof(char))];
return output;
}
char* StringToCharPtr(string data) //funkcja nie działa ;/
{
const char *x = data.c_str();
char * xCharPtr = const_cast<char*>(x);
return xCharPtr;
}
Nie wiem z jakiego powodu w xCharPtr siedzą krzaki gdy w wersji std::string'owej siedzą zaszyfrowane dane ;