#include #include using namespace std; static const char hexArr[] = "0123456789ABCDEF"; string encrypt(string &str){ string crypt; unsigned char tmp; srand(str.size()); for (unsigned int i=0; i> 4]; crypt += hexArr[tmp & 0x0f]; } return crypt; } string decrypt(string &str){ string crypt; unsigned char tmp, val=0; if (str.size() % 2) return crypt; srand(str.size()/2); for (unsigned int i=0; i