加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > 安全 > 正文

bash – 解密目录中的多个OpenPGP文件

发布时间:2020-12-15 19:05:35 所属栏目:安全 来源:网络整理
导读:我在目录中有几百gpg加密文件,格式为filename.xyz.gpg,其中“xyz”是一些任意扩展名。我需要解密所有的文件,以生成filename.xyz,这样我就不需要手动输入每个文件的密码。 我已经尝试了以下目录“测试”: for file in 'ls Testing'; do (echo password|g
我在目录中有几百gpg加密文件,格式为filename.xyz.gpg,其中“xyz”是一些任意扩展名。我需要解密所有的文件,以生成filename.xyz,这样我就不需要手动输入每个文件的密码。

我已经尝试了以下目录“测试”:

for file in 'ls Testing'; do (echo <password>|gpg --passphrase-fd 0 -d $file 
--output     $file.decrypted);

我刚刚用命令提示符>结束,没有任何反应。

我的语法有什么问题?有没有一个更有效的方式来做这个没有bash shell循环?

正如手册中所说,您需要添加–batch选项:
--passphrase-fd n
          Read the passphrase from file descriptor n. Only the first line will be read from file descriptor n. If you use 0 for n,the passphrase will be read from
          STDIN. This can only be used if only one passphrase is supplied.  Note that this passphrase is only used if the option --batch has also been given.  This is
          different from gpg.

   --passphrase string
          Use string as the passphrase. This can only be used if only one passphrase is supplied. Obviously,this is of very questionable security on a multi-user sys                        

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读