Click here to Skip to main content
11,435,106 members (48,350 online)
Click here to Skip to main content

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

, 6 Jan 2002 CPOL
Rate this:
Please Sign up or sign in to vote.
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:

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)

Share

About the Author

Dan Madden
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

 
QuestionI encountered numorous errors during compiling (Crypto++ 5.2.2 is used), what is wrong? Pin
Sstar912-Jan-09 18:29
memberSstar912-Jan-09 18:29 
AnswerRe: I encountered numorous errors during compiling (Crypto++ 5.2.2 is used), what is wrong? Pin
Jeffrey Walton18-Feb-09 11:48
memberJeffrey Walton18-Feb-09 11:48 
GeneralCrypto++ Integration Article Pin
Jeffrey Walton8-Dec-06 19:17
memberJeffrey Walton8-Dec-06 19:17 
Generalreproducing your sample Pin
Samuel gerber9-May-05 5:05
memberSamuel gerber9-May-05 5:05 
Hello great work!
Your project was eased to compile(thanks)! But to be sure to understand I tried to create a new project reproducing your sample and using only the part of the "FileStuff" but without success. Can You help me!
...
std::allocator >::~basic_string,class std::allocator >(void)" (??1?$basic_strin
g@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@XZ) already defined in cryptlib42d.lib(filters.obj)
...
thanks
Samuel Smile | :)
GeneralLots of errors when I compile the Crypto++ Pin
ROCKISDEAD15-Mar-05 11:17
memberROCKISDEAD15-Mar-05 11:17 
GeneralRe: Lots of errors when I compile the Crypto++ Pin
li.cao6-Apr-05 22:43
memberli.cao6-Apr-05 22:43 
GeneralMax message length Pin
Petitjean28-Jan-05 4:09
memberPetitjean28-Jan-05 4:09 
QuestionHow to convert HEX to bytes... Pin
Ritcho8-Oct-04 17:45
memberRitcho8-Oct-04 17:45 
Generalv5.1- ElGamal & DSA 2048-bit key generation error Pin
niuyanhua11-Jul-04 15:59
memberniuyanhua11-Jul-04 15:59 
Generalv5.1 Library GUI Pin
niuyanhua5-Jul-04 17:47
memberniuyanhua5-Jul-04 17:47 
GeneralMFC DLL Crypto++ v5.1 Pin
ckmluu11-May-04 3:13
sussckmluu11-May-04 3:13 
GeneralRe: MFC DLL Crypto++ v5.1 Pin
Dan Madden11-May-04 3:24
memberDan Madden11-May-04 3:24 
GeneralRe: MFC DLL Crypto++ v5.1 Pin
ckmluu11-May-04 7:02
sussckmluu11-May-04 7:02 
GeneralRe: MFC DLL Crypto++ v5.1 Pin
Dan Madden11-May-04 7:14
memberDan Madden11-May-04 7:14 
GeneralRe: MFC DLL Crypto++ v5.1 Pin
Dan Madden11-May-04 7:27
memberDan Madden11-May-04 7:27 
GeneralRe: MFC DLL Crypto++ v5.1 Pin
ckmluu11-May-04 21:52
sussckmluu11-May-04 21:52 
GeneralRe: MFC DLL Crypto++ v5.1 Pin
Dan Madden12-May-04 2:55
memberDan Madden12-May-04 2:55 
GeneralRe: MFC DLL Crypto++ v5.1 Pin
ckmluu12-May-04 6:24
memberckmluu12-May-04 6:24 
QuestionHelp me. How to Gzip string? Pin
kempge1-May-04 18:27
memberkempge1-May-04 18:27 
QuestionHow to Gzip a string? Pin
Watcher_bj30-Apr-04 23:28
memberWatcher_bj30-Apr-04 23:28 
GeneralGreat Pin
Anthony_Yio14-Apr-04 19:13
memberAnthony_Yio14-Apr-04 19:13 
QuestionHow to override the OnOpenDocument() function Pin
VC ++ master20-Jan-04 7:19
memberVC ++ master20-Jan-04 7:19 
AnswerRe: How to override the OnOpenDocument() function Pin
Daniel Madden10-Mar-04 19:52
memberDaniel Madden10-Mar-04 19:52 
QuestionHelp me Please?? Pin
xxhimanshu11-Nov-03 21:26
memberxxhimanshu11-Nov-03 21:26 
GeneralMulti thread App (Run time error) Help me. please... Pin
muhon10-Jun-03 6:00
membermuhon10-Jun-03 6:00 
GeneralRe: Multi thread App (Run time error) Help me. please... Pin
winroot1-Mar-04 14:26
memberwinroot1-Mar-04 14:26 
GeneralCompilation Errors - Bench.cpp: Pin
JPhelps28-May-03 3:59
memberJPhelps28-May-03 3:59 
GeneralRe: Compilation Errors - Bench.cpp: Pin
Anonymous28-May-03 4:26
sussAnonymous28-May-03 4:26 
GeneralCompilation Errors: Pin
JPhelps28-May-03 3:54
memberJPhelps28-May-03 3:54 
GeneralProblem to copile under vc++7 Pin
selecta5-May-03 6:55
memberselecta5-May-03 6:55 
GeneralAbout RSA keys Pin
pimOOsse14-Apr-03 2:03
memberpimOOsse14-Apr-03 2:03 
GeneralRe: About RSA keys-importing in .NET Pin
marco p6-Aug-03 23:54
membermarco p6-Aug-03 23:54 
GeneralRe: About RSA keys Pin
speechnovice30-Sep-03 21:06
memberspeechnovice30-Sep-03 21:06 
Questionwhy occur error ? Pin
seok29323-Jan-03 14:35
memberseok29323-Jan-03 14:35 
AnswerRe: why occur error ? Pin
Daniel Madden23-Jan-03 20:53
memberDaniel Madden23-Jan-03 20:53 
AnswerRe: why occur error ? Pin
Anonymous28-May-03 14:00
sussAnonymous28-May-03 14:00 
GeneralECC sample Pin
AbdulRahman13-Jan-03 21:55
memberAbdulRahman13-Jan-03 21:55 
QuestionDoes it work withe the 5.0 version ? Pin
Sorin Sbarnea29-Dec-02 3:12
memberSorin Sbarnea29-Dec-02 3:12 
AnswerRe: Does it work withe the 5.0 version ? Pin
Daniel Madden2-Jan-03 12:03
memberDaniel Madden2-Jan-03 12:03 
GeneralRe: Does it work withe the 5.0 version ? Pin
pimOOsse31-Mar-03 9:30
memberpimOOsse31-Mar-03 9:30 
GeneralGreat Work! Pin
Anonymous11-Oct-02 9:01
sussAnonymous11-Oct-02 9:01 
GeneralRe: Great Work! Pin
Daniel Madden22-Dec-02 23:56
memberDaniel Madden22-Dec-02 23:56 
GeneralHi Pin
Vishi04310-Oct-02 4:08
memberVishi04310-Oct-02 4:08 
GeneralRe: Hi Pin
Daniel Madden22-Dec-02 23:58
memberDaniel Madden22-Dec-02 23:58 
GeneralRe: Help me!! Pin
xxhimanshu12-Nov-03 2:06
memberxxhimanshu12-Nov-03 2:06 
GeneralPlease~ HELP ME!!! Pin
jasmine30-Sep-02 23:47
sussjasmine30-Sep-02 23:47 
GeneralRe: Please~ HELP ME!!! Pin
Daniel Madden1-Oct-02 0:23
memberDaniel Madden1-Oct-02 0:23 
QuestionHow to use this program with my Objects of a Class Pin
Vishi04324-Sep-02 20:02
memberVishi04324-Sep-02 20:02 
QuestionHow to use Crypto++ in Windows CE? Pin
Bui Huy Kien6-Sep-02 19:09
memberBui Huy Kien6-Sep-02 19:09 
AnswerRe: How to use Crypto++ in Windows CE? Pin
Anonymous28-May-03 14:04
sussAnonymous28-May-03 14:04 

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

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

| Advertise | Privacy | Terms of Use | Mobile
Web03 | 2.8.150428.2 | Last Updated 7 Jan 2002
Article Copyright 2002 by Dan Madden
Everything else Copyright © CodeProject, 1999-2015
Layout: fixed | fluid