요약·해설과 원문, 전문 번역을 서로 분리했습니다. API 이름, symbol, source path는 원문 표기를 사용합니다.
1. 요약·해설
원문의 핵심 논리와 kernel programming 관점의 보충 설명입니다. 아래의 전문 번역과는 별도로 작성했습니다.
2. 영어 원문 전체
번역 기준이 된 Linux v6.18.37 원문입니다. 줄 번호는 이 버전의 파일 좌표입니다.
원문 전체 펼치기
==========================================
Encrypted keys for the eCryptfs filesystem
==========================================
ECryptfs is a stacked filesystem which transparently encrypts and decrypts each
file using a randomly generated File Encryption Key (FEK).
Each FEK is in turn encrypted with a File Encryption Key Encryption Key (FEKEK)
either in kernel space or in user space with a daemon called 'ecryptfsd'. In
the former case the operation is performed directly by the kernel CryptoAPI
using a key, the FEKEK, derived from a user prompted passphrase; in the latter
the FEK is encrypted by 'ecryptfsd' with the help of external libraries in order
to support other mechanisms like public key cryptography, PKCS#11 and TPM based
operations.
The data structure defined by eCryptfs to contain information required for the
FEK decryption is called authentication token and, currently, can be stored in a
kernel key of the 'user' type, inserted in the user's session specific keyring
by the userspace utility 'mount.ecryptfs' shipped with the package
'ecryptfs-utils'.
The 'encrypted' key type has been extended with the introduction of the new
format 'ecryptfs' in order to be used in conjunction with the eCryptfs
filesystem. Encrypted keys of the newly introduced format store an
authentication token in its payload with a FEKEK randomly generated by the
kernel and protected by the parent master key.
In order to avoid known-plaintext attacks, the datablob obtained through
commands 'keyctl print' or 'keyctl pipe' does not contain the overall
authentication token, which content is well known, but only the FEKEK in
encrypted form.
The eCryptfs filesystem may really benefit from using encrypted keys in that the
required key can be securely generated by an Administrator and provided at boot
time after the unsealing of a 'trusted' key in order to perform the mount in a
controlled environment. Another advantage is that the key is not exposed to
threats of malicious software, because it is available in clear form only at
kernel level.
Usage::
keyctl add encrypted name "new ecryptfs key-type:master-key-name keylen" ring
keyctl add encrypted name "load hex_blob" ring
keyctl update keyid "update key-type:master-key-name"
Where::
name:= '<16 hexadecimal characters>'
key-type:= 'trusted' | 'user'
keylen:= 64
Example of encrypted key usage with the eCryptfs filesystem:
Create an encrypted key "1000100010001000" of length 64 bytes with format
'ecryptfs' and save it using a previously loaded user key "test"::
$ keyctl add encrypted 1000100010001000 "new ecryptfs user:test 64" @u
19184530
$ keyctl print 19184530
ecryptfs user:test 64 490045d4bfe48c99f0d465fbbbb79e7500da954178e2de0697
dd85091f5450a0511219e9f7cd70dcd498038181466f78ac8d4c19504fcc72402bfc41c2
f253a41b7507ccaa4b2b03fff19a69d1cc0b16e71746473f023a95488b6edfd86f7fdd40
9d292e4bacded1258880122dd553a661
$ keyctl pipe 19184530 > ecryptfs.blob
Mount an eCryptfs filesystem using the created encrypted key "1000100010001000"
into the '/secret' directory::
$ mount -i -t ecryptfs -oecryptfs_sig=1000100010001000,\
ecryptfs_cipher=aes,ecryptfs_key_bytes=32 /secret /secret
3. 한국어 전문 번역
영어 원문의 문단 순서와 의미를 유지한 전체 번역입니다. 코드, 함수명, symbol과 URL은 원문 표기를 유지합니다.
FEK와 FEKEK
1-20eCryptfs는 무작위 File Encryption Key(FEK)로 각 파일을 투명하게 암호화·복호화하는 stacked filesystem이다. 각 FEK는 다시 File Encryption Key Encryption Key(FEKEK)로 암호화된다.
커널 경로에서는 사용자 passphrase에서 파생한 FEKEK와 kernel CryptoAPI를 직접 사용한다. 사용자 공간 경로에서는 `ecryptfsd` daemon과 외부 라이브러리가 FEK를 암호화해 public-key cryptography, PKCS#11, TPM 기반 연산을 지원한다. FEK 복호화 정보 구조체는 authentication token이며, `ecryptfs-utils`의 `mount.ecryptfs`가 사용자의 session keyring에 넣은 `user` type kernel key에 저장할 수 있다.
파일별 FEK를 상위 FEKEK로 감싸고 FEKEK의 출처에 따라 처리 경로가 달라진다.
==========================================
Encrypted keys for the eCryptfs filesystem
==========================================
ECryptfs is a stacked filesystem which transparently encrypts and decrypts each
file using a randomly generated File Encryption Key (FEK).
Each FEK is in turn encrypted with a File Encryption Key Encryption Key (FEKEK)
either in kernel space or in user space with a daemon called 'ecryptfsd'. In
the former case the operation is performed directly by the kernel CryptoAPI
using a key, the FEKEK, derived from a user prompted passphrase; in the latter
the FEK is encrypted by 'ecryptfsd' with the help of external libraries in order
to support other mechanisms like public key cryptography, PKCS#11 and TPM based
operations.
The data structure defined by eCryptfs to contain information required for the
FEK decryption is called authentication token and, currently, can be stored in a
kernel key of the 'user' type, inserted in the user's session specific keyring
by the userspace utility 'mount.ecryptfs' shipped with the package
'ecryptfs-utils'.
ecryptfs 형식의 encrypted key
21-38`encrypted` key type에는 eCryptfs와 함께 쓰기 위한 새 `ecryptfs` 형식이 추가됐다. 이 형식의 payload는 authentication token을 담고, 그 안의 FEKEK는 커널이 무작위로 만들며 parent master key로 보호한다.
known-plaintext 공격을 피하려고 `keyctl print`나 `keyctl pipe`의 data blob에는 구조가 알려진 authentication token 전체를 넣지 않고 암호화된 FEKEK만 넣는다. 관리자는 부팅 때 `trusted` key를 unseal한 뒤 통제된 환경에서 필요한 encrypted key를 안전하게 생성해 mount에 제공할 수 있다. 평문 key는 커널 수준에서만 존재해 악성 사용자 공간 software에 노출될 위험도 줄어든다.
The 'encrypted' key type has been extended with the introduction of the new
format 'ecryptfs' in order to be used in conjunction with the eCryptfs
filesystem. Encrypted keys of the newly introduced format store an
authentication token in its payload with a FEKEK randomly generated by the
kernel and protected by the parent master key.
In order to avoid known-plaintext attacks, the datablob obtained through
commands 'keyctl print' or 'keyctl pipe' does not contain the overall
authentication token, which content is well known, but only the FEKEK in
encrypted form.
The eCryptfs filesystem may really benefit from using encrypted keys in that the
required key can be securely generated by an Administrator and provided at boot
time after the unsealing of a 'trusted' key in order to perform the mount in a
controlled environment. Another advantage is that the key is not exposed to
threats of malicious software, because it is available in clear form only at
kernel level.
new·load·update 명령 형식
39-51새 key는 `keyctl add encrypted name "new ecryptfs key-type:master-key-name keylen" ring`, 저장 blob은 `load hex_blob`, parent master key 교체는 `keyctl update keyid "update key-type:master-key-name"` 형식이다. `name`은 정확히 16개 hexadecimal 문자, `key-type`은 `trusted` 또는 `user`, `keylen`은 64다.
원문이 요구하는 고정 값과 선택지를 보존한다.
Usage::
keyctl add encrypted name "new ecryptfs key-type:master-key-name keylen" ring
keyctl add encrypted name "load hex_blob" ring
keyctl update keyid "update key-type:master-key-name"
Where::
name:= '<16 hexadecimal characters>'
key-type:= 'trusted' | 'user'
keylen:= 64
생성·저장·mount 예제
52-73예제는 이미 load된 `user:test` key를 parent로 사용해 이름 `1000100010001000`, 길이 64바이트의 eCryptfs encrypted key를 `@u` user keyring에 만든다. 반환 serial은 `19184530`이며 `keyctl print`로 형식·parent·길이와 암호화 blob을 확인하고 `keyctl pipe`로 `ecryptfs.blob`에 저장한다.
마지막 명령은 `/secret`을 같은 위치에 eCryptfs로 mount하면서 `ecryptfs_sig=1000100010001000`, cipher `aes`, key byte 길이 32를 지정한다. 긴 hexadecimal blob과 줄 연속 표시는 원문 그대로 보존한다.
parent key에서 encrypted key를 만들고 signature 이름으로 mount한다.
Example of encrypted key usage with the eCryptfs filesystem:
Create an encrypted key "1000100010001000" of length 64 bytes with format
'ecryptfs' and save it using a previously loaded user key "test"::
$ keyctl add encrypted 1000100010001000 "new ecryptfs user:test 64" @u
19184530
$ keyctl print 19184530
ecryptfs user:test 64 490045d4bfe48c99f0d465fbbbb79e7500da954178e2de0697
dd85091f5450a0511219e9f7cd70dcd498038181466f78ac8d4c19504fcc72402bfc41c2
f253a41b7507ccaa4b2b03fff19a69d1cc0b16e71746473f023a95488b6edfd86f7fdd40
9d292e4bacded1258880122dd553a661
$ keyctl pipe 19184530 > ecryptfs.blob
Mount an eCryptfs filesystem using the created encrypted key "1000100010001000"
into the '/secret' directory::
$ mount -i -t ecryptfs -oecryptfs_sig=1000100010001000,\
ecryptfs_cipher=aes,ecryptfs_key_bytes=32 /secret /secret
요약·해설
ecryptfs.rst:1-73eCryptfs의 FEK·FEKEK 계층, encrypted key의 ecryptfs 형식과 생성·저장·mount 명령을 설명합니다.