Guest User

Untitled

a guest
Jan 17th, 2019
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.68 KB | None | 0 0
  1. #include "stdafx.h"
  2. #include <cstdlib>
  3. #include <iostream>
  4. #include <fstream>
  5. #include <string>
  6.  
  7. using namespace std;
  8. string buf;
  9.  
  10. void XOR(char patch[], char patch2[], char key[])
  11. {
  12.  
  13. ifstream plik(patch);
  14. ofstream zapis(patch2);
  15.  
  16. char ch;
  17. int i=0;
  18.  
  19. while(plik.good())
  20. {  
  21. ch = plik.get();
  22. zapis << (ch^key[i%strlen(key)]);                
  23. i++;          
  24. }
  25.  
  26. zapis.close();
  27. plik.close();
  28. }
  29.  
  30.  
  31.  
  32.  
  33.  
  34.  
  35. int main(int argc, char *argv[])
  36.  
  37. {
  38. XOR("wyjscie.txt", "wyjscie2.txt", "XYZTO7");
  39.  
  40. system("PAUSE");
  41. return EXIT_SUCCESS;
  42. }
Add Comment
Please, Sign In to add comment