Please offer a good encryption library for VC ++ 2008

I am working on a small project and need your help. Here are the details:

  • My project is in VC ++ 2008
  • I need to save some packages of important resource files with my exe project in encrypted form
  • While running exe, I want to decrypt and use these files on the fly (without saving the decrypted files in a temporary location)
  • These files are binary files.
  • The project is small and simple.
  • Encryption can be simple or moderately secure.

I am looking for the encryption library / sdk / toolkit for a simple project, the library should have the following requirements

  • It should be small and easy to use, I do not need many functions, and I do not have enough development time.
  • It should be free to use.
  • It should be able to decrypt streams or decrypt files directly in memory, without storing them at any temporary location
  • He should have good tutorials / examples / community support, I don't have much time to develop
  • It must support more than one encryption strategy so that I can switch to a better algorithm, if necessary, without changing the library

I'm really new to encryption libraries, kindly give your suggestion, and do the background research myself.

Edit

Also, can you suggest a good way to hide my key inside an EXE? This application is for clicks and launching without any registration or installation.

+6
c ++ encryption
source share
6 answers

Will decrypt the key hard-coded in your program or delivered, for example. license file?

If you're hard-coded, don't worry about looking for any type of fantasy encryption, all you can hope for is a (very thin!) Obfuscation layer - even simple XOR scrambling will be no worse than AES.

However, TomCrypt or Crypto ++ .

EDIT

You can also choose something really simple, like TEA . Or you can stick with simple XOR encryption and compress your executable; A good feature of XOR single-byte encryption is that the encrypted data will still be compressible :) (caveat emptor: exe compression sometimes causes false positives in antivirus applications).

The thing to keep in mind is that “if it works, it can be broken”, so focus on distracting random prying eyes and forget about protecting yourself from “really interested people” - it takes a lot > of effort and knowledge to make anything remotely successful.

EDIT 2

To “hide” the decryption key, you can simply save the binary key (which is the decryption algorithm itself) rather than a textual representation, or you can use the gibberish string. It doesn’t matter, random users will not be able to use the key in any case, and you cannot hide it from certain people :)

+7
source share

I don't know if this really suits all your requirements, but look at Botan .

+2
source share

I used Crypto ++, and although I recognize genius for its concept ... I hate the fact that you need genius (or close enough) to use it. There are good examples, but the slightest attempt to deviate from them turns into an extremely frustrating time.

I would recommend Google Keyczar: it was designed for simple crypto:

  • safe defaults so don't worry about them
  • support for multiple algorithms: asymmetric and symmetric, hashing
  • key processing, with a rotation mechanism, etc., although this may not be very useful in your case

Check out the website: Keyczar

A small note: there may be some problems with streaming decoding due to the API, I'm not experienced enough to answer this.

+2
source share

This is a kind of "UnAnswer": I know only one free library that supports the function you need, and this is not enough or just for work. But anyway, check out Crypto ++ . I think others will also talk about this.

0
source share

You can simply use the Capicom ActiveX control. This has been discontinued, but I do not think it will cause you any problems. This is a wrapper around Microsoft CryptoAPI.

  • This is just a shell around the OS functions, so it is quite small and easy to use.

  • Microsoft offers a reissue for it, so you can include it in your programs.

  • It can decrypt strings. Not sure about threads.

  • This is from MS, so tutorials and community support is given.

  • It supports multiple encryption algorithms. Please note that some of the newer algorithms are not available in earlier versions of Windows because it uses CryptoAPI.

This is not ideal, but if you want something, you can develop quickly, this is not a bad choice.

0
source share

If you use only Windows, I would recommend the Windows Crypto API http://msdn.microsoft.com/en-us/library/aa388162(v=VS.85).aspx

0
source share

All Articles