什么是标准加密文件格式? [英] What are the standard encryption file formats?

查看:231
本文介绍了什么是标准加密文件格式?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我对加密文件格式有点困惑。

I'm a bit confused on encryption file formats.

假设我要用AES-256加密文件。我通过加密算法运行文件,我现在有一个加密字节流。

Let's say I want to encrypt a file with AES-256. I run the file through the encryption algorithm and I now have a stream of encrypted bytes.

我显然可以将这个字节流写入文件,但任何第三方加密应用程序不会理解它,因为它不只是一个加密字节的原始流。

I obviously can write that stream of bytes to a file, but any third-party encryption application is not going to understand it since it's not expecting just a raw stream of encrypted bytes.

我可以编写哪些文件格式,以便其他加密工具可以理解

Into what file formats can I write that so that other encryption tools can understand it?

我知道的(我认为)是:

The ones I know of (I think) are:

PKCS#7
ASN.1
DER
PEM
PKCS#8

但我不知道它们是如何彼此相关的。

but I'm not sure how they all relate to each other.

显然,AESCrypt实用程序也有一个格式,似乎是其自己的专有格式:
http://www.aescrypt.com/aes_file_format.html

Apparently the AESCrypt utility also has a format, which appears to be its own proprietary format: http://www.aescrypt.com/aes_file_format.html

这个东西上有没有骗子?

Is there a cheatsheet anywhere on this stuff? I've been googling and found bits and pieces, but never felt like I had the complete picture.

推荐答案

PKCS#8是一个完整的图片,不是加密文件格式,它是私钥的格式。

PKCS#8 is not an encrypted-file format, it's a format for private keys.

ASN.1和DER是将结构化消息转换为二进制的规则。它们本身不是文件格式,虽然它们用于定义和描述文件格式。

ASN.1 and DER are rules for translating a structured message into binary. They are not, in and of themselves, a file format, although they're used to define and describe file formats.

PKCS#7与PEM密切相关,它们都是用于公用密钥加密文件的格式。它们是按照base-64封装的DER编码的ASN.1消息来定义的。它们是安全互联网邮件的S / MIME格式的基础。 (请参阅 RFC3851

PKCS#7 is closely related to PEM, and they're both formats for public-key encrypted files. They are defined in terms of base-64 encapsulated DER encoded ASN.1 messages. They are the basis of the S/MIME format for secure internet mail. (see RFC3851)

在与S / MIME并行是OpenPGP文件格式,也主要是为公钥加密文件设计的。 (请参阅 RFC4880

In parallel with S/MIME is the OpenPGP file format, also mainly designed for public-key encrypted files. (See RFC4880)

在S / MIME和OpenPGP格式,都有一个包含对称密钥加密数据的块。可以创建只包含此块的有效S / MIME或OpenPGP文件。这样,S / MIME(a.k.a. PKCS#7)和OpenPGP格式也可用于对称密钥加密。

In both S/MIME and OpenPGP formats, there is a block which contains symmetric-key encrypted data. It is possible to create valid S/MIME or OpenPGP files containing only this block. In this way, the S/MIME (a.k.a. PKCS#7) and OpenPGP formats can be used for symmetric-key encryption also.

这篇关于什么是标准加密文件格式?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆