Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- string XOR_Encryption(string toBeEncrypted, string sKey)
- {
- string sEncrypted(toBeEncrypted);
- unsigned int iKey=sKey.length();
- int iIn=toBeEncrypted.length();
- int x=0;
- for(int i = 0; i < iIn; i++)
- {
- sEncrypted[i] = toBeEncrypted[i] ^ sKey[x];
- if(++x == iKey){ x = 0; }
- }
- return sEncrypted;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement