首页
社区
课程
招聘
[求助]关于微软加密库的的算法
2010-1-31 11:00 5651

[求助]关于微软加密库的的算法

2010-1-31 11:00
5651
Microsoft Base Cryptographic Provider
一软件注册验证算法如下。
if(CryptAcquireContext(
   &hProv,
   "Hexprobe Signature: 1.1",
   "Microsoft Base Cryptographic Provider v1.0",
   PROV_RSA_FULL,
   0))
{
CryptAcquireContext(
   &hProv,
   "Hexprobe Signature: 1.1",
   "Microsoft Base Cryptographic Provider v1.0",
   PROV_RSA_FULL,
   CRYPT_NEWKEYSET))
}
//pdata
//06 02 00 00 00 24 00 00 52 53 41 31 00 02 00 00 01 00 01 00 D5 0C 7B 70 74 CF C9 40 EB 4A 50 32
//26 B2 93 CC 1D A0 CF 77 F3 E3 9B 84 D2 2B 35 57 51 2D E7 8F 28 BB 0D 0A BC 45 30 39 9F FA E9 51
//74 60 45 17 7F A0 52 1A 68 31 B3 47 31 16 82 A2 BC A0 EB A6 
CryptImportKey(hProv,pdata,54,0,0,&phKey)
CryptCreateHash(hProv,CALG_MD5,0,0,&hHash)
CryptHashData(hHash,pUserName,lengthofUserName ,0)

CryptVerifySignature(hHash,pUserKey,lengthofpUserKey,phKey,"Hexprobe Version: 1.1",0)

如果签名相符则注册成功。
请问如果能根据公钥pdata及上面所列的信息,算出私钥来,或者有哪个网站能跑这个东西。
	invoke CryptAcquireContext,addr hProv,addr hex,addr mic,PROV_RSA_FULL,CRYPT_NEWKEYSET;
	invoke CryptGenKey,hProv,AT_SIGNATURE,CRYPT_EXPORTABLE,addr hKey
	mov dwBlobLen,10000
	invoke CryptExportKey,hKey,0,PUBLICKEYBLOB,0,addr bKeyBlob,addr dwBlobLen

我用如上方法产生的公钥每回都不同,随机的,所以我无法通过暴力来枚举所有可能的私钥。

请高人给说下怎样能枚举可能的私钥,只要理论上能枚举出来就可以,不考虑时间长短。或者我应该再读下哪方面的文章。

阿里云助力开发者!2核2G 3M带宽不限流量!6.18限时价,开 发者可享99元/年,续费同价!

收藏
点赞0
打赏
分享
最新回复 (1)
雪    币: 2096
活跃值: (100)
能力值: (RANK:420 )
在线值:
发帖
回帖
粉丝
rockinuk 8 2010-1-31 11:25
2
0
Microsoft Base Cryptographic Provider
The Microsoft Base Cryptographic Provider is the initial cryptographic service provider (CSP) provider, and is distributed with CryptoAPI versions 1.0 and 2.0. It is a general-purpose provider that supports digital signatures and data encryption.

The RSA public key algorithm is used for all public key operations.

To maintain backward compatibility with earlier versions the new version of the provider retains the version 1.0 designation of the name in Wincrypt.h. However, version 2.0 of this provider is currently shipping. To determine the actual version of the provider in use, call CryptGetProvParam with the dwParam argument set to PP_VERSION. If 0x0200 is returned in pbData, then you have version 2.0.

Source from http://msdn.microsoft.com/en-us/library/aa386980(VS.85).aspx
游客
登录 | 注册 方可回帖
返回