请求帮助!!RSA公钥加密

乡客2023 2014-11-17 11:05:50
现有C#公钥<RSAKeyValue><Modulus>0rOQCQFGG29G0TPPwWzMacfDX0w5uCYUp4YIYJjY6l+CLYvkCdHwm/.......=</Modulus><Exponent>AQAB</Exponent></RSAKeyValue>

本人要用c++进公钥签名,请问下我该怎么做??希望知道的能给个思路,能给段代码参考最好,万分感谢
...全文
184 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
乡客2023 2014-11-18
  • 打赏
  • 举报
回复
多谢个位,已想到解决方案,加密这块C#好搞,写个加密服务,其他照就c++需然不是最佳方案,还好能解决问题
乡客2023 2014-11-18
  • 打赏
  • 举报
回复
多谢个位,已想到解决方案,加密这块C#好搞,写个加密服务,其他照就c++需然不是最佳方案,还好能解决问题
gpbgpbgpb 2014-11-18
  • 打赏
  • 举报
回复
好多年不回贴了,帮你回一个,不太理解你的问题,是要用现有RSA的公钥来加密文件,还是说要将这个RSA的公钥签名,然后发给别人,如果是前者,还需要一个模数n, 如果是后者就用DSA吧,更贴切,当然RSA一样可以用来签名。不过,我猜你的意思是前者。
赵4老师 2014-11-18
  • 打赏
  • 举报
回复
Cryptographic Functions These low-level Win32® cryptographic functions were formerly in Microsoft® CryptoAPI version 1.0, and provide you the most flexibility in applying cryptography to your applications. These functions facilitate communication with the cryptographic service providers (CSP). The following functions are included in this category and can also be found in Wincrypt.h. Function Description CryptAcquireContext Acquires a handle to a particular key container within a particular CSP. CryptContextAddRef Adds one to the reference count on a HCRYPTPROV handle. CryptCreateHash Initiates the hashing of a stream of data. CryptDecrypt Decrypts data that was previously encrypted via the CryptEncrypt function. CryptDeriveKey Generates cryptographic keys derived from base data. CryptDestroyHash Destroys the hash object referenced by the hHash parameter. CryptDestroyKey Releases the handle referenced by the hKey parameter. After a key handle has been released, it becomes invalid and cannot be used again. CryptDuplicateHash Makes an exact copy of a hash and the state the hash is in. CryptDuplicateKey Makes an exact copy of a key and the state the key is in. CryptEncrypt Encrypts data. CryptEnumProviders Enumerates the providers on a computer. CryptEnumProviderTypes Enumerates the types of providers supported on the computer. CryptExportKey Exports cryptographic keys out of a cryptographic service provider in a secure manner. CryptFormatObject Formats the encoded data and returns a Unicode string in the allocated buffer according to the certificate encoding type. CryptGenKey Generates random cryptographic keys for use with the CSP module. CryptGenRandom Fills a buffer with random bytes. CryptGetDefaultProvider Determines the default CSP either for the current user or the computer for a given provider type. CryptGetHashParam Retrieves data that governs the operations of a hash object. CryptGetKeyParam Retrieves data that governs the operations of a key. CryptGetProvParam Retrieves parameters that govern the operations of a CSP. CryptGetUserKey Retrieves a handle to a permanent user key pair, such as the user's signature key pair. CryptHashData Computes the cryptographic hash on a stream of data. CryptHashSessionKey Computes the cryptographic hash on a key object. CryptImportKey Transfers a cryptographic key from a key blob to a CSP. CryptProtectData Performs encryption on the data in a DATA_BLOB. CryptQueryObject Takes a CERT_BLOB or a file name and returns the information about the content of the blob or the file. CryptReleaseContext Releases a handle to a CSP and a key container. CryptSetHashParam In theory, this function customizes the operations of a hash object. Currently, only a single parameter is defined for this function. CryptSetKeyParam Customizes various aspects of a key's operations. CryptSetProvider Specifies the current user default CSP. CryptSetProviderEx Specifies either the current user default CSP or the computer default CSP. CryptSetProvParam Customizes the operations of a CSP. CryptSignHash Signs a piece of data. CryptUnprotectData Performs a decryption and integrity check of the data in a DATA_BLOB. CryptVerifySignature Verifies a signature against a hash object.
乡客2023 2014-11-17
  • 打赏
  • 举报
回复
引用 1 楼 zhao4zhong1 的回复:
RSA都是用私钥签名,公钥解密。我觉得。
现在就是要拿人家的密钥进行签名,不懂呀求思路
赵4老师 2014-11-17
  • 打赏
  • 举报
回复
RSA都是用私钥签名,公钥解密。我觉得。

64,682

社区成员

发帖
与我相关
我的任务
社区描述
C++ 语言相关问题讨论,技术干货分享,前沿动态等
c++ 技术论坛(原bbs)
社区管理员
  • C++ 语言社区
  • encoderlee
  • paschen
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
  1. 请不要发布与C++技术无关的贴子
  2. 请不要发布与技术无关的招聘、广告的帖子
  3. 请尽可能的描述清楚你的问题,如果涉及到代码请尽可能的格式化一下

试试用AI创作助手写篇文章吧