Making a new, simple, encryption library

Started by
6 comments, last by Michalson 18 years, 10 months ago
I recently began researching file encrypting/archieving for my game files and it is a scattered, poorly documented subject! i think someone shoudl make a new, easy, very very simple one. Like a GUI based program where you put in your own encryption methods and keys to make your own format, then use generic functions to return a file's buffer. You could have an option like have a dictionary file as a c++ header externally so u can only decrypt with that file(in theory). Something so great and easy, that people would document it! Is this even a possible feet? I think Drew_Benton should take on this project. He's a cheerful, helpful, friendly guy, who from my experiences wiht him, has shown his intellegence in custom file formats. Who here aggrees with me? P.S. Sory about my long, unplanned paragraph that is difficult to read.
Advertisement
Quote:Original post by Yamian
I think Drew_Benton should take on this project. He's a cheerful, helpful, friendly guy, who from my experiences wiht him, has shown his intellegence in custom file formats.


WHaaaaatt! So I'm sitting here reading though a few random threads, and I see I have been volunteered for something! [lol] Thanks for the compliments but I'm not sure I have the expertise in the encrypting/archieving stuff that other memebers around here do. We should see if Ryan Clark is still around for his original file data stuff on the Wiki is great, it just needs to be updated some. As par another post, I still have on my todo list to contribute some to the Wiki, I have not forgotten, just been a bit busy. I should have some more time for programming soon.

Now tool programming is something I am working on right now, so what exactly is this library that you are proposing? Should it have the basics of encryption, decryption, archiving and streaming?

Quote:Like a GUI based program where you put in your own encryption methods and keys to make your own format, then use generic functions to return a file's buffer. You could have an option like have a dictionary file as a c++ header externally so u can only decrypt with that file(in theory).


I see everything that you are saying except the dictonary file concept. Can you explain some more on what you mean? I can see all of what you are saying about GUI based, custom encryption/decryption functions, but just not that. I'll have take a look into a few things, I just may look into making a public library such as this, no promises though! [smile] I'll get back to you on this.
Quote:Original post by Yamian
I recently began researching file encrypting/archieving for my game files and it is a scattered, poorly documented subject! i think someone shoudl make a new, easy, very very simple one. Like a GUI based program where you put in your own encryption methods and keys to make your own format, then use generic functions to return a file's buffer. You could have an option like have a dictionary file as a c++ header externally so u can only decrypt with that file(in theory). Something so great and easy, that people would document it! Is this even a possible feet? I think Drew_Benton should take on this project. He's a cheerful, helpful, friendly guy, who from my experiences wiht him, has shown his intellegence in custom file formats. Who here aggrees with me?


However, there are a few good links here for ya.
CLF. (In the center of the page). Compressed file library is, well, an engine written in C++ that allows you to compress and decompress files. It allows a plug ins, which makes it easy to add encryption.

and of course...
Game libs listing. It lists a few good libraries for you.
The Tiny Encryption Algorithm (TEA is small, fast and straigh forward. You could easily implement this in any program.
I've found multiple algorythems but what I'm talking here is a program where u just put in ur own algorythms.

what I meant by an external dictionary was like, instead of filenames and number of files being in the archieve, the archieve is just all the filoes put into one file(encrypted or not) and information liek the name of the file, how many files there are, and where the file starts in the archieve, would be external. I didn't so much volunteer u, just respect u for all ur help. I'll keep looking on my great search though. it doesn't even need to compress files, just organize them into one file. Uhh, for example, like the http://gpwiki.org/index.php/C:Custom_Resource_Files you so generously ported to VC6, have all those bytes as a simple C++ Header except the " The stored file's data, where n is the file size." That way the resource is only useful with that header, making a super encryption and... better organization. Even something like when encrypting your file, it generates a function with your algorythem and puts it in the header.

[Edited by - Yamian on June 8, 2005 7:36:41 PM]
Here's a C++ implementation of the Blowfish algorithm for encrypting memory buffers. The only issue to be aware of is the memory buffer passed to the algorithm must be evenly divisible by 8 - in other words BuffSize % 8 == 0.

Regarding your other post on LZMA and Bzip2's lack of encryption it would be a trivial matter to use Bzip2 to compress the data then use an implementation like above to encrypt it. If you do a seach on CodeProject you will find numerous other algorithms already implemented for you to use.
Well, with LZMA, the file compression is great, but I can't fid any examples of code for decrypting 7z files with a password. Maybe I should 7z it without a password then add one of these algorythems to it, for now. I stll think an encryption program would be great though.
Quote:Original post by Yamian
I recently began researching file encrypting/archieving for my game files and it is a scattered, poorly documented subject!


That's because it's unwise for amateurs to try implimenting encryption, just like it's unwise for someone trained in first aid to think they are qualified to perform brain surgery. Encryption is well documented, but you'll need to be reading academic white papers, not internet tutorials, to get information.

This topic is closed to new replies.

Advertisement