Guest User

Untitled

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