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