我现在有这样一段 RSA 公钥加密后的信息(用十六进制字符串表示)
char * data =
"8c4c05b86de3740abff4e6dc498afe1a7fe348cb80f5d7d029f098d315dcc6cf1496f11114ce4a6489b03f322297b71e272e55b9b9e2f0fddf4f0258539018056dbddb5f0e0909013c7ff4988d28b47aaa5896a75997e74af6a25dd02c259f06d0689ba48f42a6093bd6b4b8810cb7458350c6bdcc86c0f2a5f7c4defffba599f5f106054a393ed70c24b7fdc0b2aadb5a8b740dd94b0e3c4520521af873ac110141f978d2fc548e6bc98f03bb59c67415f08bdf52a8135949c0c1e844f5c42c52339b1e6ee93d504d4748fb5ef10ce34fd32cbda578e705e8340a73fd26c263c15d37a8f1d1c57fecb4164bfae460d5f3e61b6d48e37639d351c0ca4df5bd07";
已知私钥的 .pem 文件是
-----BEGIN RSA PRIVATE KEY-----
MIIEogIBAAKCAQEAms015yxDAwiqm3fcg5stTt3P1LDT3daK50rvumLPM32N1eXX
4IhU65K6ZgZVCHcGmWyUHo4UhXzvt5ozHzNanJCHx1ZPgi/SzaQUJ2jN2g5UuuRz
PVCJNcTx+l1HCdcTLysULQ+aBvSfWbgXq5Z254ZMvqn22N7ItmpN5OW10R/hQGt3
kQAi+z672kSWBn5vcBK7rEp0PfDj0pYL1i5x56jwqW/OPaEcr5qHGQWjxcnqEoVn
pRkFuj6Wx222+jnfgw0UsCFGkaYYUmROWpokE38QzvEUcQELi+s6GPqFRDbRcGtV
Jb2/aX/tr4QYwE85wXrMi6e9ZTVhqvXqwsdllQIDAQABAoIBAAeFUMkabWcIVMGY
4S3DrD/YpvA+ZwywD6+NBHiZtFdcEjgCIqrV9Mo9JrEuPZNbtQZfMBML9BNILp1M
8I7jf9N7ch1NJC+/Aw7ameAQR3AAoj0yPCcOcpwaJWd0gK8Js/TmsuQ9jc4otFU3
jG7ZsI0vCSt6NnPy3u193KryPhMa1gu+x8gzh47oDjzIlQcxHyUfe6C1oebQrmJX
p/ih7F1OwmccM5SwYVdWB9mgwqvw+cLZuTKrsw1K0yxrcrivncDeGWPqrhBVEWPU
jwQG5STPpciW1Ar22u1r2ZjjquEDyvrcFWIbUBJhvXFfGlB7G3Z8N2l3rJywJv5y
JHOxSUECgYEAwCcLwOl16NECF0/D62h9ppkTJ3E4wvuRcQvDif36QIs8dF3vyj/B
ZJErbTLYwAwHLu3em64cn3QEbxm6Xh90F8WHtlsUHvJKKWi7RNaUqfhLFF9FF9IE
xDuPPDBnWBAWacBk1hRq7mggnOUOFdsQtQU6fP7OhXy52N8uQFwHdDcCgYEAzj0B
hTVsqJowAg++RQHZrpvuy4gnWhFH3+FaCi7ivu4uwpOnCRDaFrHH7jAYmqoHvWiN
YsRr2+czr3U1WIWuG1HLTCj8RZyI0eVSng0xw8czIl3vJu3eN4hq3V3cM0JiVckv
pIUL4zNlwwh8ylNxA/bPRhaR+c8DmaHhKUn8ppMCgYABMLy75zZZyOGwb0gRb0ZH
/+7EcckePBy8jIwbkL06JSKsveA8aoSyMMwKEySQnAJ3YfXdFQkMW9WjMo+bAarg
ctLSaGIJhwq6kvGGDaZCH02nxKdS7HQnGw9aGhqpyv+4i/6T7PB0paR+FFUwAXlr
BatFFvcEkK8+DrPkpi1NpQKBgAD9xBMa1aHd09s+riBwyNYRA83QorfJG3pU//TK
kuZuCKWAxi3B+fpf8mEPtB6SMKVValCONyKAcvwl6RK62cJh20NLcyL2hKXVn1cJ
IzMYswM4Rlz+ibHkovbba6KHcCePZv44cX0vEw8j7E2gpwto1Ug19Y+o0hCb+ZQU
OfWnAoGANmcWVE7QNcvshIHR0GrlXWmjK/l/TZTh1DVRkfri6eltAFaTbSs03fdL
AEGcbKVurGbdbXgGzpdVmL2+vqe54B07RLTsPvGvkak6E8s4/c5U6x5RLLA0ZZMn
+cyn6yxAcAemW0dc90YqVkGYjCefPw5CDbcgRK8DIPyInIVWYYY=
-----END RSA PRIVATE KEY-----
请问这个用 C 语言怎么解密呢?注意这里的密文是以字符数组的形式出现的,我是不是要先把它转换为二进制的 char 类型呢?
这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。
V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。
V2EX is a community of developers, designers and creative people.