PGP 加密文件或文本?
我有一个需要加密的 csv 文件。我想问一下,加密内容和加密文件有什么区别吗?或者它们是相同的?因为我们的客户没有明确说明他们想要什么?
谢谢,
I have a csv file that required to be encrypted. I want to ask that is there any difference between encrypt the content and encrypt the file? Or they are the same? Because our client doesn't clearly specify what they want?
Thanks,
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
加密总是会产生二进制结果,然后可以对其进行“装甲”(base64 编码和包装)以获得文本。所有符合 OpenPGP 标准的实现都通过自动将装甲数据解码为二进制来处理装甲数据,因此您指定什么模式并不重要。一种特殊情况是,当您计划将结果粘贴到其他一些文本数据(例如文本文档)时,则必须进行防护。
Encryption will always produce binary result, which can be "armored" (base64-encoded and wrapped) then in order to get the text. All implementations conformant to OpenPGP standard handle armored data by decoding it to binary automatically, so it doesn't really matter what mode you specify. One special case is when you plan to paste the result to some other text data (such as text document), then armoring is mandatory.
通常,当他们说 PGP 加密时,他们谈论的是商业程序,这些程序用他们的公钥将一个或多个文件加密到一个 gpg 文件中,他们可以用他们的私钥解密该文件。
另一种方法是在代码中自己逐行加密(有一些库可以使用文件流执行此操作;非常简单)。
您的客户必须以某种方式告诉您稍后将如何解密数据,这将首先告诉您如何加密。
Usually when they say PGP encryption, they are talking about commercial programs that encrypt a file or files into one gpg file with their public, which they can decrypt with their private key.
The other way is encrypt it yourself line-by-line in code (there are libraries that do that using file streams; very easy).
Your client one way or another has to tell you how that expect to decrypt the data later on, which will tell you how you encrypt in the first place.