simple file encryption library

akaash19's Avatar, Join Date: Feb 2010
Newbie Member
Hello Friends,
I need simple file encryption library to encrypt files with symmetric key and decrypt them.
I went through open ssl and its too confusing.I just need simple library to perform just file encrypt and decrypt.
I am new in C, just done programming in java/php before.

Thanks all
Akaash
Gene Poole's Avatar, Join Date: Nov 2009
Contributor
For simplicity of code and understanding, I'd go with a simple stream cipher like RC4. What are your requirements? How secure does it need to be? Is it to be platform independent (Windows has had a cryptoAPI for some time now which makes things much easier)?
akaash19's Avatar, Join Date: Feb 2010
Newbie Member
THanks for the reply,
security is not primary concern.First i need a library.
I need to use encryption code in linux environment.
Regards
sumit
Gene Poole's Avatar, Join Date: Nov 2009
Contributor
Well, RC4 is very simple to code in C. It's a stream cipher so once it is initialized, just grab a byte one at a time and XOR it with your plaintext.

There's a complete example here:

http://en.wikipedia.org/wiki/Rc4