2014-05-07 105 views
1

我试图使用GPG解密文件,为此我使用“Starksoft.Cryptography.OpenPGP”。我收到以下错误gpg:公钥解密失败:密码错误

Starksoft.Cryptography.OpenPGP.GnuPGException: An error occurred while trying to execute command --list-secret-keys. 

但是当我通过命令提示符“> GPG --list秘密密钥”执行命令,它会列出按键。我无法使“Starksoft.Cryptography.OpenPGP”正常工作。

接下来我尝试通过直接使用cmd.exe运行进程来获得解决方案。但以下命令都不起作用:

​​3210

任何人都可以告诉我如何解密文件?

+0

嗨VIJI,你可以检查,如果我的变化是有意义的吗?我很难理解这个问题。 –

+0

是的。用于编辑 – Viji

回答

0

我想出了gpg命令行的问题。第二个命令行工作得很好。

回声Mypasspharse | gpg.exe --passphrase-FD 0 -o “C:\ successtest.txt” --decrypt “C:\ testfile.txt.gpg”

问题是:

Mypassphare contained a character ">" which interpreted as std out redirect in windows command prompt. So, passphase wasn't passing to the next command properly. 

由于此命令正常工作,我没有检查其他语法。如果错误,请随时查看其他命令并更新。

我总结了第q &一个here:http://techsharehub.blogspot.com/2014/09/gpg-public-key-decryption-failed-bad.html

相关问题