Hello folks,

I've been trying to get something in C to work all day without luck. It's becoming extremely frusterating to say the least. I've created a small test case that you can find here:

http://www.rafb.net/efnet_cpp/paste/results/Cl869338.html

I have a file called test.txt that contains the following:

"This is a test text file....\n\nthanks"

I compile the program like this: gcc -o crypt crypt.c -lcrypto and run

./crypto e test.txt test.enc

This encrypts the file. I then run

./crypto d test.enc test.dec

Which should encrypt the file... and it does to a point. The last few characters of the file are either not decrypted or decrypted incorrectly.

Here are urls to the sample output:

http://valhalla.dydns.com/test.txt           - original file
http://valhalla.dydns.com/test.enc           - enrypted file
http://valhalla.dydns.com/test.dec           - incorrectly decrypted file


Someone suggested that my file read loop is incorrect - but I really don't know what I am doing wrong. Hopefully someone can help me out here?


Thanks,

Adam Olsen

____________________
BYU Unix Users Group http://uug.byu.edu/ ___________________________________________________________________
List Info: http://uug.byu.edu/cgi-bin/mailman/listinfo/uug-list

Reply via email to