fork(1) download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. std::string encryptDecrypt(const std::string& toEncrypt)
  5. {
  6. char key[9] = { '£', '£', '3', '4', '5', '6', '7', '8', '9' };
  7. std::string output = toEncrypt;
  8. for (int i = 0; i < toEncrypt.size(); i++)
  9. output[i] = toEncrypt[i] ^ key[i % (sizeof(key) / sizeof(char))];
  10.  
  11. return output;
  12. }
  13.  
  14. int main() {
  15. std::cout << encryptDecrypt("test") << std::endl;
  16. return 0;
  17. }
Success #stdin #stdout 0s 3428KB
stdin
Standard input is empty
stdout
��@@