LUKS에 사용 가능한 암호화 방법 나열 대한 자신을 알리기 위해 노력했다, 그래서

하드 디스크를 암호화하는 유효한 최신 방법을 찾고있었습니다. 몇 가지 연구를 한 후 나는 LUKS를 만났고 그것을 주사하기로 결정했습니다. 그래서 다음과 같이 HDD를 올바르게 암호화하는 방법에 대한 몇 가지 예를 찾았습니다.

cryptsetup --verbose --cipher aes-xts-plain64 --key-size 512 --hash sha512 --iter-time 5000 --use-random luksFormat /dev/sda3

–cipher–hash 내가 LUKS을 위해 특별히 사용할 수있는 다양한 암호화 및 해시에 대한 자신을 알리기 위해 노력했다, 그래서 그것의 일부가, 나에게 가장 흥미로웠다. 현재 사용중인 Linux에 대해 사용 가능한 암호화 형식을 기계 친화적 인 형식으로 보여주는 파일을 여는 것 외에 유용한 정보를 찾을 수 없습니다. 그러나 내가 들었 듯이이 파일조차도 매일 매일 처리하지 않는 사람에게는 읽기가 어려울뿐만 아니라 모든 암호화 방법의 전체 범위가 누락되었을 수 있습니다.

내 질문 : LUKS 암호화에 대한 전체 암호 / 해시 목록이 있습니까?

내가 선택할 수있는 것을 단순히 보여주는 것입니다 … 그리고 아마도 다른 방식의 차이점이 무엇인지에 대한 간단한 설명을 제공 할 것입니다.



답변

기본적으로 커널에 따라 다르므로 ” See / proc / crypto “는 “답변”입니다. cryptsetup 매뉴얼 페이지는 다음과 같이 말합니다.

NOTES ON SUPPORTED CIPHERS, MODES, HASHES AND KEY SIZES

   The available combinations of ciphers, modes, hashes and key  sizes  depend
   on  kernel  support.  See /proc/crypto for a list of available options. You
   might need to load additional kernel crypto modules in order  to  get  more
   options.

   For  the  --hash option, if the crypto backend is libgcrypt, then all algo‐
   rithms supported by the gcrypt library are  available.   For  other  crypto
   backends some algorithms may be missing.

그러나 내 /proc/crypto뱀이나 xts (aes)는 언급하지 않았으므로 대신 어떤 cryptsetup benchmark보고서 (및 속도도 표시)를 보는 것이 좋습니다 . 예를 들면 다음과 같습니다.

$ cryptsetup benchmark
# Tests are approximate using memory only (no storage IO).
PBKDF2-sha1       292752 iterations per second
PBKDF2-sha256     221362 iterations per second
PBKDF2-sha512     142010 iterations per second
PBKDF2-ripemd160  277124 iterations per second
PBKDF2-whirlpool  155727 iterations per second
#  Algorithm | Key |  Encryption |  Decryption
     aes-cbc   128b   164.7 MiB/s   164.5 MiB/s
 serpent-cbc   128b   119.5 MiB/s   205.0 MiB/s
 twofish-cbc   128b   163.5 MiB/s   208.6 MiB/s
     aes-cbc   256b   148.4 MiB/s   147.9 MiB/s
 serpent-cbc   256b   128.1 MiB/s   205.3 MiB/s
 twofish-cbc   256b   202.3 MiB/s   213.1 MiB/s
     aes-xts   256b   165.4 MiB/s   145.3 MiB/s
 serpent-xts   256b   150.0 MiB/s   194.5 MiB/s
 twofish-xts   256b   206.4 MiB/s   206.9 MiB/s
     aes-xts   512b   149.4 MiB/s   147.5 MiB/s
 serpent-xts   512b   181.7 MiB/s   195.0 MiB/s
 twofish-xts   512b   207.1 MiB/s   208.6 MiB/s

해시는 처음 몇 줄 (sha1, sha256, sha512, ripemd160, whirlpool)입니다. 암호는 알고리즘 헤더 아래에 있습니다.

기본값이 무엇인지 살펴보면 “꽤 좋은”항목에 대한 좋은 아이디어를 얻을 수 있습니다.

$ cryptsetup --help|tail -n 8
Default compiled-in key and passphrase parameters:
    Maximum keyfile size: 8192kB, Maximum interactive passphrase length 512 (characters)
Default PBKDF2 iteration time for LUKS: 1000 (ms)

Default compiled-in device cipher parameters:
    loop-AES: aes, Key 256 bits
    plain: aes-cbc-essiv:sha256, Key: 256 bits, Password hashing: ripemd160
    LUKS1: aes-xts-plain64, Key: 256 bits, LUKS header hashing: sha1, RNG: /dev/urandom

키가 더 큰 (을 사용하여) 사용 --key-size하면 약간 느리면 더 강해야합니다.

   --key-size, -s <bits>
          Sets  key  size in bits. The argument has to be a multiple of 8.
          The possible key-sizes are limited by the cipher and mode used.

          See /proc/crypto for more information.  Note  that  key-size  in
          /proc/crypto is stated in bytes.

답변

notdavidcronenberg 사용자의 작업과 관련하여 : 내가 찾은 유일한 대답은 LUKS On-Disk Format Specification (PDF) 문서에 있습니다.

유효한 암호 이름

유효한 암호 모드

  • ecb 암호 출력이 직접 사용됩니다.
  • cbc-plain암호는 CBC 모드에서 작동합니다. CBC 체인은 모든 섹터를 절단하고 섹터 번호를 초기 벡터 (32 비트 및 리틀 엔디안으로 변환)로 다시 초기화합니다. 이 모드는 4 장 [Fru05b]에 지정되어 있습니다.
  • cbc-essiv:{hash}암호는 원래 키의 IV 키를 생성하기 위해 해시를 사용하여 ESSIV 모드에서 작동합니다. 예를 들어 sha256을 해시로 사용하는 경우 암호 모드 사양은 “cbcessiv : sha256″입니다. ESSIV는 4 장 [Fru05b]에 지정되어 있습니다.
  • xts-plain64 plain64는 일반 초기 벡터의 64 비트 버전입니다.

유효한 해시 사양