Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- cFuncs.h
- // Credits to Hacker Fail for making the program and change the func
- // Credits to Code64 for the func
- #include <string.h>
- #include <windows.h>
- #include <iostream>
- #include <tchar.h>
- #include <fstream>
- #include <string>
- char* Encrypt(const char *plaintext)
- {
- int len = strlen(plaintext);
- char *cyphertext = new char[len + 1];
- for(int i = 0; i < len; i++)
- cyphertext[i] = plaintext[i] + 4;
- cyphertext[len] = 0;
- return cyphertext;
- }
- cMain.cpp
- // Credits to Hacker Fail for making the program and change the func
- // Credits to Code64 for the func
- #include "cFuncs.h"
- using namespace std;
- class Comando
- {
- public :
- char pa[999];
- int e;
- void Crip();
- };
- void Comando::Crip()
- {
- ofstream out;
- out.open("Encrypted words.txt");
- out << "Words encrypted :\n";
- Comando use;
- while(true)
- {
- cout << "\nEnter the word to be encrypted :\n\n";
- cin >> use.pa;
- cout << "\n\nThe word encrypted : " << Encrypt(use.pa) << "\n\n";
- out << use.pa << " = " << Encrypt(use.pa) << "\n";
- Sleep(500);
- cout << "Do you want to use the program again?\n"
- << "1 -> Yes\n"
- << "2 -> No\n\n";
- cin >> use.e;
- if ( use.e == 1 )
- {
- cout << "\n\nThanks you for using the program again!\n\n";
- } else if ( use.e == 2 )
- {
- cout << "\n\nThanks for using the program!\n\n";
- Sleep(500);
- exit(0);
- } else if ( use.e != 1 && use.e != 2 )
- {
- cout << "\n\nEnter a valid option... The program will close...\n";
- Sleep(500);
- exit (0);
- }
- }
- out.close();
- }
- int main()
- {
- Comando use;
- ofstream out;
- out.open("Encrypt.h");
- out << "//Func made by Code64"
- << "\n//Program made by HackerFail\n\n\n\n\n"
- << "char* Decrypt(const char *plaintext)"
- << "\n{"
- << "\n int len = strlen(plaintext);"
- << "\n char *cyphertext = new char[len + 1];"
- << "\n for(int i = 0; i < len; i++)"
- << "\n cyphertext[i] = plaintext[i] - 4;"
- << "\n cyphertext[len] = 0;"
- << "\n return cyphertext;"
- << "\n}";
- out.close();
- system ("title Encrypt made by HackerFail"); // title of the program
- system("color 72"); // color of the program
- cout << "Program started : ";
- system("TIME /t");
- cout << "\n\nDont use the space!!\n\n";
- use.Crip();
- system("pause");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement