Chinaunix首页 | 论坛 | 博客
  • 博客访问: 5873219
  • 博文数量: 671
  • 博客积分: 10010
  • 博客等级: 上将
  • 技术积分: 7310
  • 用 户 组: 普通用户
  • 注册时间: 2006-07-14 09:56
文章分类

全部博文(671)

文章存档

2011年(1)

2010年(2)

2009年(24)

2008年(271)

2007年(319)

2006年(54)

我的朋友

分类: C/C++

2008-08-27 10:29:14

Introduction

This article makes use of the Crypto++ Library v4.2, see "Obtaining the Crypto++ v4.2 Library" below...

Overview

I developed this for two reasons,

  1. Because I promised in an earlier article, and
  2. I wanted to use the Crypto++ Library components in an application with a GUI.

Below is the GUI that is presented in this demo:

Obtaining the Crypto++ v4.2 Library

To run compile the demo code, you will need to download the Windows version of the Crypto++ Library v4.2 and source files from , and compile it.

Implementation notes

Below you will find out what I did to get this built and working. If you follow the steps below, you will be able to compile/run this example.

  1. Download the Crypto++ v4.2 Library (see link above) & this demo.
  2. Compile the Crypto++ Library (both Debug/Release).
  3. Take the Debug version of the library and rename it to cryptlib42d.lib.
  4. Take the Release version of the library and rename it to cryptlib42r.lib.
  5. Copy the *.lib files to both of the LIB directories where VC++ is installed.
  6. Unzip the demo and put it into a directory of your choice.
  7. Go to the Menu -> Tools | Options | Directory Tab, and enter the directory path where you unziped the Crypto++ Library to.
  8. Go to the Menu -> Project | Settings | Link Tab, and enter the build library (cryptlib42d.lib/cryptlib42r.lib) in the "Object/Library modules" edit box.
  9. Make sure the above library matches the build (*r.lib=Release/*d.lib=Debug) for the Cryptest demo.
  10. Compile the Cryptest demo (do not run it from here).
  11. For the validation portion to work, you need to copy the .dat files from the Crypto++ location to the build directory (Debug/Release).
  12. Go To the Cryptest.exe and execute it from Windows Explorer.
  13. Let me know how it goes!!!!

Now that you have the demo working, let me explain a few things...

I have made the GUI so that it is a bit hard to get it to error (although it is possible!).

I used the following functions in this demo:

  • GenerateRSAKey
  • RSADecryptString
  • RSAEncryptString
  • RSASignFile
  • RSAVerifyFile
  • EncryptString(using DES-EDE in CBC Mode)
  • DecryptString(using DES-EDE in CBC Mode)
  • EncryptFile
  • DecryptFile
  • SecretShareFile
  • SecretRecoverFile
  • InformationDisperseFile
  • InformationRecoverFile
  • GzipFile
  • GunzipFile
  • DigestFile

Acknowledgements

I notified Wei Dai that I was doing this project and asked his permission to post this at CodeProject. He was kind enough to answer the email and he let me know that this posting was covered in the License.txt file. So, you do not need to bother him with these dumb questions as I did.

A special thanks to Wei Dai for making the Crypto++ Library publically available for us to enjoy it!!!

Known bugs/issues

  • Only tested with Visual C++ 6.0 SP5.
  • Only tested with Windows 2000.
  • NOT tested with WindowsXP (yet).
  • It is not fully tested and debugged.

Bugs

  • None yet...

Issues

  • For you to see TCP forwarding working, you must receive TCP packets on the port specified, otherwise the machine will seem to hang whilst it listens on the port.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found

阅读(1176) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~