Code:
char filename[256];
char data[50000];
int count = 0;
char key[52] = "&^%5/{?>:]!@A1c%~<,.;yX+_|`':8$^M6h #6Hmd 5/-+?,;:'";
...
void createcrypt()
{
clrscr();
t("Enter the name of the file you wish to create.\nInclude the extension [EG. .doc, .txt]\n");
cin.getline(filename, 256, '\n');
t("\n\nEnter your data. End it wish a \"*\" ( without quotes ) followed by [ENTER].\n");
cin.getline(data, 50000, '*');
clrscr();
t("Preparing to encrypt your data.\n");
t("Creating empty file : ");
t(filename);
done();
fout.open(filename, ios::binary | ios::out);
fout << (char)(data^key[count++]);
if(count == strlen(key))
{
count = 0;
}
fout.close();
}
Void t is simply like COUT, but using typewriter effect.