The MASM Forum Archive 2004 to 2012

General Forums => The Campus => Topic started by: Dark Schneider on August 09, 2011, 07:07:50 PM

Title: Need help with RSA encryption
Post by: Dark Schneider on August 09, 2011, 07:07:50 PM
I have a public key received from a server via socket and
I need to encrypt some data with that key before I can send it back.

How should I do it? Encryption is not something I want to mess with if I can avoid.
Any working example about CryptoAPI would be great. I got lost after reading MSDN.
Title: Re: Need help with RSA encryption
Post by: dedndave on August 09, 2011, 10:39:41 PM
drizz has some stuff for this on his site...
http://www.drizz.eu.pn/index.php?option=com_jotloader&view=categories&cid=0_ace66080c316578be4a59e0b372e58fa&Itemid=2
in particular, the Bignum Library - examples - bntest1
you may also find addtional stuff in his CryptoHash Library
and you'll want his StdLib for the examples
Title: Re: Need help with RSA encryption
Post by: drizz on August 10, 2011, 11:51:44 AM
Are you sure you need to do this "manually"? OpenSSL ?
Title: Re: Need help with RSA encryption
Post by: Dark Schneider on August 12, 2011, 01:52:21 AM
I just want to get it done in my project and no I don't want to do stuffs like this manually.
Does OpenSSL has a static lib version I can use in my masm project?
I'm trying to avoid carrying extra DLLs around.

In Drizz's cryptohash I found Blowfish which I also need, TY.
Title: Re: Need help with RSA encryption
Post by: Alexander on August 12, 2011, 04:19:17 AM
Dark,

Hope this is useful. http://www.cryptopp.com/
Title: Re: Need help with RSA encryption
Post by: Dark Schneider on August 12, 2011, 10:25:57 AM
Guess I have to stick with these DLLs until I know better.
Might take long time for this stuff to sink in but I'm trying.

Crypto++ written in C, is there any way to make a static lib that can link from masm?
Title: Re: Need help with RSA encryption
Post by: drizz on August 12, 2011, 09:36:40 PM
Quote from: Dark Schneider on August 12, 2011, 01:52:21 AMDoes OpenSSL has a static lib version I can use in my masm project?
I'm trying to avoid carrying extra DLLs around.
Yes you can use OpenSSL with masm http://www.slproweb.com/products/Win32OpenSSL.html has a static you can link. Create include manually or use h2incx from japheth, .. or maybe someone already has an include...
Maybe you want to use WinHTTP?
Title: Re: Need help with RSA encryption
Post by: Dark Schneider on August 13, 2011, 02:21:21 PM
The data that I want to encode is custom structured binary data so I'll have to go with winsock.

Thank you very much for all advices.
Title: Re: Need help with RSA encryption
Post by: ToutEnMasm on August 13, 2011, 03:24:44 PM
If you need include files,those ones are in the sdk translted here:
http://www.masm32.com/board/index.php?topic=8542.0
The translator who made that is headinc.