Solved

How to use Wei Dai's crypto++

Posted on 2000-05-14
4
326 Views
Last Modified: 2013-11-20
I got an Encrypt/Decrypt lib, which is Wei Dai's crypto++. But it is very complex and I don't know clearly how to use it. If anyone has used it, can you tell me the steps to use it in my own application? BTW, I only want to use DES, but this lib provide a lot of algorithms and it is very large. So is there any method to make it smaller?
0
Comment
Question by:Zhu051200
  • 2
  • 2
4 Comments
 
LVL 1

Accepted Solution

by:
agomes earned 50 total points
Comment Utility
You can use Microsoft's Crypto API (http://msdn.microsoft.com/library/partbook/win98dh/gettingstarted.htm) but I think it is too messy for only using DES.

In http://www.homeport.org/~adam/crypto/ there are other libraries, but the DES only library in http://www.cryptosoft.com (des3_win32_vc.zip) is simpler and easier to use.

Good luck!
0
 

Author Comment

by:Zhu051200
Comment Utility
thanks!
the DES lib at http://www.cryptosoft.com is used to encrypt or decrypt 8 byte buffer. How to use it to encrypt a file? Can u give me some examples or advice?

thanks in advance
0
 
LVL 1

Expert Comment

by:agomes
Comment Utility
There is already a sample on encrypting/decrypting a whole file in that zip file (des3_win32_vc.zip) called 'demo.c'. If you are using Visual C++, don't bother about the make file, just create a console application and paste the code. With MFC you can use CFile's Read() an Write() as well, instead of fread() and fwrite().

I am not sure (I didn't try) but I think you can change the buffer size, but changing the key size also.

I hope this helps you.
0
 

Author Comment

by:Zhu051200
Comment Utility
I tried the demo file(name is des.h)
but this file have some problems. whether the password is correct, the decryption will still works. Do you think so?

Now I can with Weidai's lib. It's ok. But I'll still give the points to you for your kind help and patient. If you have time, please check that demo file.I am not sure where's the problem.

Thanks!
0

Featured Post

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Introduction: Ownerdraw of the grid button.  A singleton class implentation and usage. Continuing from the fifth article about sudoku.   Open the project in visual studio. Go to the class view – CGridButton should be visible as a class.  R…
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
This video discusses moving either the default database or any database to a new volume.

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now