|
-
August 29th, 2004, 02:43 AM
#1
Anyone see any vulnerabilities with this algorithm?
// f_skaencrypt.h
// by AxessTerminated
/*
approximately two minutes of CPU time for encrypt/decrypt of a
101,891KB file on a ~299Mhz PII.
*/
#include <fstream.h>
void encrypt(char *filein, char *fileout, long key, long key2); //encryption routine
void decrypt(char *filein, char *fileout, long key, long key2); //decryption routine
char ch;
char ch2;
void encrypt(char *filein, char *fileout, long key, long key2)
{
ifstream in(filein, ios::binary);
ofstream out(fileout, ios::trunc | ios::binary);
srand(key);
key = rand() * key2 + 3;
srand(key2);
key2 = rand();
while(!in.eof())
{
in.get(ch);
ch += key;
ch += key2 * key;
in.get(ch);
ch2 -= key;
ch2 -= key2 * key;
out.put(ch2);
out.put(ch);
}
in.close();
out.close();
exit(0);
}
void decrypt(char *filein, char *fileout, long key, long key2)
{
ifstream in(filein, ios::binary);
ofstream out(fileout, ios::trunc | ios::binary);
srand(key);
key = rand() * key2 + 3;
srand(key2);
key2 = rand();
while(!in.eof())
{
in.get(ch2);
ch2 -= key2 * key;
ch2 -= key;
in.get(ch);
ch += key2 * key;
ch += key;
out.put(ch);
out.put(ch2);
}
in.close();
out.close();
exit(0);
}
Anyone see how an encrypted file could possibly be cracked? I'm also working on a VC++ version that has 3 keys, and also will allow you to use a file as a key.
Geek isn't just a four-letter word; it's a six-figure income.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
|