【翠字营原创】 编译 Crypto++ cryptlib 适合VC6 VC7 VC8 VC9 VC10

来源:互联网 发布:清华ubuntu源 编辑:程序博客网 时间:2024/04/30 20:19

 

Crypto++ Library is a free C++ class library of cryptographic schemes.
可以到下面的网址下载最新源代码:

http://www.cryptopp.com/

 

Crypto++ Library 是开源的、跨平台的C++, 提供丰富的加密解密算法,包括:MD5,IDEA, Triple-DES,AES (Rijndael), RC6, MARS, Twofish, Serpent, RSA, DSA, SHA-1, SHA-2 等等。

 

支持的编译器如下:

  * MSVC 6.0 - 2010
  * GCC 3.3 - 4.5
  * C++Builder 2010
  * Intel C++ Compiler 9 - 11.1
  * Sun Studio 12u1, Express 11/08, Express 06/10

 

==============================

 

这里简单说明一下使用 MSVC2008 对Crypto++进行编译使用的方法和注意事项, 希望对大家开始学习有帮助!

下面一段的英文比较简单, 说明了Crypto++包含的工程情况, 以及使用注意事项, 一看就清楚:

 

On Windows, Crypto++ can be compiled into 3 forms: a static library
including all algorithms, a DLL with only FIPS Approved algorithms, and
a static library with only algorithms not in the DLL.

 

 

To compile Crypto++ with MSVC, open the "cryptest.dsw" (for MSVC 6 and MSVC .NET
2003) or "cryptest.sln" (for MSVC 2005 - 2010) workspace file and build one or
more of the following projects:

 

//用于生成包含所有算法的静态库

cryptlib - a static libraryincluding all algorithms

 

//用于生成仅包含FIPS作为标准的算法的dll和导入库

cryptopp - This builds the DLL. Please note that if you wish to use Crypto++
  as a FIPS validated module, you must use a pre-built DLL that has undergone
  the FIPS validation process instead of building your own.
 

//基于dll开发的例子程序
dlltest - This builds a sample application that only uses the DLL.

 

//基于cryptlib静态库开发的测试驱动程序

cryptest Non-DLL-Import Configuration - This builds the full static library
  along with a full test driver.
 

//基于dll 和不包含FIPS法静态库开发的测试驱动程序

 

 

cryptest DLL-Import Configuration - This builds a static library containing
  only algorithms not in the DLL, along with a full test driver that uses
  both the DLL and the static library.

 

To use the Crypto++ DLL in your application, #include "dll.h" before including
any other Crypto++ header files, and place the DLL in the same directory as
your .exe file. dll.h includes the line #pragma comment(lib, "cryptopp")
so you don't have to explicitly list the import library in your project
settings.

 

To use a static library form of Crypto++, make the "cryptlib"
project a dependency of your application project, or specify it as
an additional library to link with in your project settings.
In either case you should check the compiler options to
make sure that the library and your application are using the same C++
run-time libraries and calling conventions.

 

-----------------

名词解释:

FIPS : Federal Information Processing Standards   (美国)联邦信息处理标准

 

 

 

 

 

原创粉丝点击