使用供应商提供的公钥进行 gnupg 解密
我已经在我的办公室桌面(windows server 2008 sp2)上安装了 gnupg 并生成了密钥,并且我能够使用密钥进行加密和解密(通过导入第三方 xxx.asc 文件生成)...但几天前我不得不按框重新映像。所以我必须再次安装 gnupg....我再次从同一个 xxx.asc 文件导入这些密钥..即使这次我得到了相同的密钥集...但因此我能够将我的测试文件加密到.gpg 扩展名..我无法解密加密文件....错误说..
解密失败:密钥不可用
任何从事此工作的人都可以帮助我摆脱这个.....
i have installed gnupg on my office desktop(windows server 2008 sp2) and generated the keys and i was able to encrypt and decrypt using the keys(generated by importing third party xxx.asc file)...but few days back i had to reimage by box. so i had to install the gnupg again....i again imported those keys from the same xxx.asc file..even this time i got the same key set...but thus time though im able to encrypt my test file to .gpg extension .. I am unable to decrypt the encrypted file....the error says..
decryption failed: Secret key not available
can any one who worked on this please help me in getting out of this.....
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
公钥仅用于加密,而秘密密钥仅用于解密。因此,您可以自由地共享您的公钥,其他人可以向您发送加密的内容。
公共密码学的安全性取决于这种设计。
因此,要解密您的测试文件,您必须首先导入所需的密钥。
Public keys are only for encrypting and secret keys are only for decrypting stuff. Thus, you can freely share your public key and other people can send you encrypted stuff.
The security of public cryptography depends on this design.
Thus, to decrypt your test file you have to import the needed secret key first.
你问的没有意义。当您想要将加密文件发送给另一个人时,您需要使用他们的公钥来加密该文件。您可以使用您的私钥对文件进行签名,以验证该文件是否是您发送的。如果文件使用您的公钥加密,则只有您可以使用您的私钥解密该文件。另外,默认情况下,当您从 gpg 导出密钥时,它仅导出公钥。如果要导出私钥,则需要使用--export-secret-key选项。
What you are asking does not make sense. When you want to send an encrypted file to another person, you need to use their public key to encrypt the file. You can use your private key to sign the file to verify that it was sent by you. If a file is encrypted by your public key, only you can decrypt that file using your private key. Also, by default when you export keys from gpg, it only exports the public key. If you want to export the private key, you need to use the --export-secret-key option.