【发布时间】:2013-07-29 08:03:02
【问题描述】:
我正在尝试使用 gnupg 从命令行使用对称密码加密文件,以将其包含在 powershell 脚本中。 我需要一个非交互式 gnupg cmd 命令行,我一直在尝试:
gpg --passphrase supersecret -c c:\File\aa.jpg
和
echo supersecret| gpg -c --passphrase-fd=0 c:\File\aa.jpg
但两种方式都出现在 Windows 窗体窗口中。
这种方式不会出现 Windows 窗体,但我无法解密:
gpg.exe --batch --passphrase-fd 0 -c c:\File\aa.jpg < supersecret
解密错误:
gpg.exe --decrypt c:\File\aa.jpg
gpg: datos cifrados CAST5
gpg: cifrado con 1 frase contrase±a
gpg: DBG: borrada frase de paso en cachÚ con ID: S5DE110F2F3E16E83
gpg: descifrado fallido: Bad session key
有什么想法吗?
【问题讨论】:
-
是我的错,行 gpg.exe --batch --passphrase-fd 0 -c c:\File\aa.jpg
-
最好将其发布为您自己问题的答案;以后遇到类似问题的其他人可能会更容易识别解决方案。
标签: windows powershell gnupg