Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "stdafx.h"
- #include <cstdlib>
- #include <iostream>
- #include <fstream>
- #include <string>
- using namespace std;
- string buf;
- void XOR(char patch[], char patch2[], char key[])
- {
- ifstream plik(patch);
- ofstream zapis(patch2);
- char ch;
- int i=0;
- while(plik.good())
- {
- ch = plik.get();
- zapis << (ch^key[i%strlen(key)]);
- i++;
- }
- zapis.close();
- plik.close();
- }
- int main(int argc, char *argv[])
- {
- XOR("wyjscie.txt", "wyjscie2.txt", "XYZTO7");
- system("PAUSE");
- return EXIT_SUCCESS;
- }
Add Comment
Please, Sign In to add comment