在Ruby中访问pgp加密文件
我有一个 pgp 加密的文件,需要在运行时从中提取数据。
这可以通过仅解密到内存来完成吗(而不是创建解密文件并在完成后删除它)?
I have a pgp-encrypted file that I need to extract data from at runtime.
Can this be done by decrypting to memory only (as opposed to creating a decrypted file and deleting it when done)?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
几个月前发布了一个名为 OpenPGP 的 Ruby 库。 看来它对你有用。
A Ruby library called OpenPGP was released a few months ago. It seems like it'd work for you.
不幸的是,大多数方法(例如sign()、verify()、encrypt()和decrypt())尚未在OpenPGP gem中实现(在撰写本文时),这使其无用。
我还找到了gpgr(https://github.com/HHRy/gpgr )没有用处。
我正在使用 gpg-me(https://github.com/ueno/ ruby-gpgme/) 用于签署电子邮件。 至少对于这个目的来说,它工作得很好。
我没有尝试解密文件,但简单浏览一下源代码表明它也可以工作。
Unfortunately, most of the methods (e.g. sign(), verify(), encrypt(), and decrypt()) are not yet implemented (by the time of this writing) in the OpenPGP gem, which makes it useless.
I also found gpgr (https://github.com/HHRy/gpgr) not to be useful.
I am using gpg-me (https://github.com/ueno/ruby-gpgme/) for signing emails. At least for this purpose, it works fine.
I have not tried to decrypt files, but a short look at the source codes suggests that it will also work.