Click here to Skip to main content
15,879,348 members
Articles / Desktop Programming / MFC
Article

Cryptest (MFC Style Crypto++ v4.2 Library GUI).

Rate me:
Please Sign up or sign in to vote.
4.62/5 (16 votes)
6 Jan 2002CPOL3 min read 237.1K   2.7K   91   57
A GUI version of the Crypto++ v4.2 Library that was written by Wei Dai.

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:

Image 1

Image 2

Image 3

Image 4

Image 5

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 http://www.eskimo.com/~weidai/cryptlib.html, 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, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Product Manager
Germany Germany
I have been programming (as a hobby) for 20+ years (Unix C, Scripting, VB, C/C++, C#). I am getting too old to talk about it and been in the Security line of work (both Military/Civilian) for 25+ years.

Comments and Discussions

 
AnswerRe: Does it work withe the 5.0 version ? Pin
Dan Madden2-Jan-03 11:03
Dan Madden2-Jan-03 11:03 
GeneralRe: Does it work withe the 5.0 version ? Pin
DREVET Olivier31-Mar-03 8:30
DREVET Olivier31-Mar-03 8:30 
GeneralGreat Work! Pin
Anonymous11-Oct-02 8:01
Anonymous11-Oct-02 8:01 
GeneralRe: Great Work! Pin
Dan Madden22-Dec-02 22:56
Dan Madden22-Dec-02 22:56 
GeneralHi Pin
Vishi04310-Oct-02 3:08
Vishi04310-Oct-02 3:08 
GeneralRe: Hi Pin
Dan Madden22-Dec-02 22:58
Dan Madden22-Dec-02 22:58 
GeneralRe: Help me!! Pin
xxhimanshu12-Nov-03 1:06
xxhimanshu12-Nov-03 1:06 
GeneralPlease~ HELP ME!!! Pin
jasmine30-Sep-02 22:47
jasmine30-Sep-02 22:47 
D:\download\Encryption\CryptestDemo\Cryptest\bench.cpp(9) : fatal error C1083: Cannot open include file: 'adler32.h': No such file or directory
BenchMark.cpp
Cryptest.cpp
D:\download\Encryption\CryptestDemo\Cryptest\Cryptest.cpp(30) : fatal error C1083: Cannot open include file: 'socketft.h': No such file or directory
CryptestDlg.cpp
FileStffDlg.cpp
TCPForwarding.cpp
Validat1.cpp
D:\download\Encryption\CryptestDemo\Cryptest\Validat1.cpp(33) : fatal error C1083: Cannot open include file: 'skipjack.h': No such file or directory
Validat2.cpp
D:\download\Encryption\CryptestDemo\Cryptest\Validat2.cpp(17) : fatal error C1083: Cannot open include file: 'xtrcrypt.h': No such file or directory
Validat3.cpp
D:\download\Encryption\CryptestDemo\Cryptest\Validat3.cpp(11) : fatal error C1083: Cannot open include file: 'adler32.h': No such file or directory
GeneralRe: Please~ HELP ME!!! Pin
Dan Madden30-Sep-02 23:23
Dan Madden30-Sep-02 23:23 
QuestionHow to use this program with my Objects of a Class Pin
Vishi04324-Sep-02 19:02
Vishi04324-Sep-02 19:02 
QuestionHow to use Crypto++ in Windows CE? Pin
Bui Huy Kien6-Sep-02 18:09
Bui Huy Kien6-Sep-02 18:09 
AnswerRe: How to use Crypto++ in Windows CE? Pin
Anonymous28-May-03 13:04
Anonymous28-May-03 13:04 
GeneralRe: How to use Crypto++ in Windows CE? Pin
Anonymous20-Aug-03 9:27
Anonymous20-Aug-03 9:27 
GeneralCompling Cryptest under MSC++.NET Pin
16-Jun-02 10:20
suss16-Jun-02 10:20 
GeneralRe: Compling Cryptest under MSC++.NET Pin
Dan Madden19-Jun-02 21:30
Dan Madden19-Jun-02 21:30 
GeneralRe: Compling Cryptest under MSC++.NET Pin
7-Aug-02 22:42
suss7-Aug-02 22:42 
GeneralRe: Compling Cryptest under MSC++.NET Pin
Dan Madden7-Aug-02 22:49
Dan Madden7-Aug-02 22:49 
GeneralError compiling Crypto++ 4.2 Pin
24-Jan-02 1:38
suss24-Jan-02 1:38 
GeneralException Pin
6-Jan-02 21:16
suss6-Jan-02 21:16 
GeneralRe: Exception Pin
Dan Madden7-Jan-02 1:23
Dan Madden7-Jan-02 1:23 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.