PGP 加密文件或文本?

发布于 2024-10-03 12:10:20 字数 87 浏览 0 评论 0原文

我有一个需要加密的 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

々眼睛长脚气 2024-10-10 12:10:20

加密总是会产生二进制结果,然后可以对其进行“装甲”(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.

ゞ花落谁相伴 2024-10-10 12:10:20

通常,当他们说 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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文