First of all : Sorry for my bad English
Once that done i proudly present you my XOR Encrypt - Decrypt Tool .
Its only a small Programm but it can be very usefull for Crypted Packets etc.
Now we go to the Main Theme (Back to Topic )
XOR Encrypt - Decrypt Tool
Screens:
Encrypt:
Decrypt:
Source(with some lines of Code no one needs :P ):
Code:
#include <iostream> #include <string> // XOR - Encrypter / Decrypter using namespace std; void decrypt(); void encrypt(); int main() { while(true){ int wahl = 4; // 4 weil es bei keine eingabe das default der switch funktion aufruft cout << "--------------------------------------------------------------\n"; cout << "XOR - DeCrypter - EnCrypter by Conrew" << endl; cout << "Would you like to DeCrypt(1) or EnCrypt(2) ? "<< endl; cout << "To close this enter 3" << endl; cout << "--------------------------------------------------------------\n"; cin >> wahl; switch(wahl) { case 1: //Operation wenn man Entschlüsseln will decrypt(); break; case 2: //Operation wenn man Verschlüsseln will encrypt(); break; case 3: //Operation wenn man das Programm schließen will cout << "Shutting down the Programm." << endl; return 0; break; default: cout << "Invalid Answer or Error! Shutting down the Programm." << endl; return 0; } } } void encrypt() { string en_data = ""; //Verschlüsselte Daten string de_data = ""; //Unverschlüsselte Daten char xorkey; cout << "Please enter Data to Encrypt(XOR) : " << endl; cin >> de_data; cout << "Please enter the Key to Crypt (XOR-Key) : " << endl; cin >> xorkey; cout << "--------------------------------------------------------------\n"; cout << "Data Size to Encrypt: " << de_data.size() << endl; cout << "--------------------------------------------------------------\n"; en_data = de_data; //Dient dem überblick for(int i; i < de_data.size() ; i++){ cout << "Proceeded Data: " << de_data[i] << endl; en_data[i] = de_data[i] ^ xorkey; } cout << "--------------------------------------------------------------\n"; cout << "Encrpyted Data: \n" << en_data << "\n\n\n" << endl; } void decrypt() { string en_data = ""; //Verschlüsselte Daten string de_data = ""; //Unverschlüsselte Daten char xorkey; cout << "Please enter Data to Decrypt(XOR) : " << endl; cin >> en_data; cout << "Please enter the Key to Crypt (XOR-Key) : " << endl; cin >> xorkey; cout << "--------------------------------------------------------------\n"; cout << "Data Size to Decrypt: " << en_data.size() << endl; cout << "--------------------------------------------------------------\n"; de_data = en_data; //Dient dem Überblick for(int i; i < en_data.size() ; i++){ cout << "Proceeded Data: " << en_data[i] << endl; de_data[i] = en_data[i] ^ xorkey; } cout << "--------------------------------------------------------------\n"; cout << "Decrpyted Data: \n" << de_data << "\n\n\n" <<endl; }
I hope you like it See you , your Conrew PS: A Thanks would be nice