• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 367
  • Last Modified:

How to use Wei Dai's crypto++

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
Zhu051200
Asked:
Zhu051200
  • 2
  • 2
1 Solution
 
agomesCommented:
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
 
Zhu051200Author Commented:
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
 
agomesCommented:
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
 
Zhu051200Author Commented:
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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now