sh*****@hotmail.com (Richard) wrote in message news:<3b**************************@posting.google. com>...
I'm looking to do my own basic encryption. I've been tyring to do a
concept such as:
I pass this function the string, key and number of rounds I want to do
the encryption. because im round shifting the bits the decryption
doesn't work.. :P
Am I going about this all wrong or does anybody know an easier way
(besides getting an open source algo class such as Crypto++)
I'm super new to fooling with the bits/encryption
for(;num of rounds;)
{
char ^ Key;
Round bit shift;
}
I just made a similar program, as vehicle to use to (try) to learn
cpp). The code is zipped up at:
http://home.bellsouth.net/p/PWP-brightwave
To compile it, include all the CPP files into a project then build it.
int main() is in j_crypt.cpp. Or...you can drop a file on the exe
file if you don't want to compile it yourself. This code will *not*
modify/overwrite any files...it always gives them a new name.
Anyway...this is what I came up with. slicerclass is a PRNG that can
be used stand-alone, once initialized, the member function get_rand()
returns a "random" unsigned long int.
My prog may be a little more complicated than what you have in mind. I
made use of a custom file-format that carries the original filename
(encrypted) and a hash-value for the original file (also encrypted),
so that authentication can be performed.
I do not present this as model code, or as an example of learned
cryptography. It happens to be where I stand in late 2003 on the
learning curve. What this crypto will do is...take any file (even one
filled with null bytes) and generate a stream of data
indistinguishable from "random" that contains the file info. Having a
copy of both the plain and cypher-text won't help an attacker get the
password. Successfully unencrypted files are authenticated. There is
an inbuilt mechanism designed to make a dictionary attack difficult.
cheers.