程序師世界是廣大編程愛好者互助、分享、學習的平台,程序師世界有你更精彩!
首頁
編程語言
C語言|JAVA編程
Python編程
網頁編程
ASP編程|PHP編程
JSP編程
數據庫知識
MYSQL數據庫|SqlServer數據庫
Oracle數據庫|DB2數據庫
 程式師世界 >> 編程語言 >> 更多編程語言 >> 編程綜合問答 >> c-跪求:HMAC-MD5的算例,用於驗證

c-跪求:HMAC-MD5的算例,用於驗證

編輯:編程綜合問答
跪求:HMAC-MD5的算例,用於驗證

自己根據網上的資料改了一段HMAC-MD5的代碼,希望能有實例驗證一下是否正確,例如:
已知公共密鑰key和需要加密的數據流data,求HMAC-MD5結果

char* key="abcde";
UNCHAR data[]={{
0x01 ,0x00 ,0x00 ,0xad ,0x06 ,0x34,

0x1f ,0xd8 ,0x04 ,0x02 ,0x1b ,0x4a ,0x57 ,0x6f ,0x7b ,0xd4 ,0x7a ,0x4a ,0x5d ,0x4e ,0x50 ,0x12,
0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00,
0x06 ,0x06 ,0x00 ,0x00 ,0x00 ,0x02 ,0x01 ,0x0a ,0x31 ,0x32 ,0x33 ,0x34 ,0x35 ,0x36 ,0x37 ,0x00,
0x0c ,0x06 ,0x00 ,0x00 ,0x05 ,0xd0 ,0x1e ,0x18 ,0x30 ,0x30 ,0x2d ,0x32 ,0x37 ,0x2d ,0x31 ,0x39,
0x2d ,0x39 ,0x46 ,0x2d ,0x41 ,0x44 ,0x2d ,0x32 ,0x41 ,0x3a ,0x7a ,0x72 ,0x6c ,0x74 ,0x1f ,0x13,
0x30 ,0x30 ,0x2d ,0x32 ,0x33 ,0x2d ,0x31 ,0x34 ,0x2d ,0x45 ,0x33 ,0x2d ,0x36 ,0x30 ,0x2d ,0x39,
0x30 ,0x3d ,0x06 ,0x00 ,0x00 ,0x00 ,0x13 ,0x4d ,0x18 ,0x43 ,0x4f ,0x4e ,0x4e ,0x45 ,0x43 ,0x54,
0x20 ,0x35 ,0x34 ,0x4d ,0x62 ,0x70 ,0x73 ,0x20 ,0x38 ,0x30 ,0x32 ,0x2e ,0x31 ,0x31 ,0x67 ,0x4f,
0x0e ,0x02 ,0x00 ,0x00 ,0x0c ,0x01 ,0x31 ,0x32 ,0x33 ,0x34 ,0x35 ,0x36 ,0x37 ,0x04 ,0x06 ,0xc0,
0xa8 ,0x01 ,0x05 ,0x05 ,0x06 ,0x00 ,0x00 ,0x00 ,0x01 ,0x57 ,0x0e ,0x53 ,0x54 ,0x41 ,0x20 ,0x70,
0x6f ,0x72 ,0x74 ,0x20 ,0x23 ,0x20 ,0x31

};


最佳回答:


已解決,HMAC-MD5的算例在 標准rfc2104 有提供,也感謝樓上各位作答

  1. 上一頁:
  2. 下一頁:
Copyright © 程式師世界 All Rights Reserved