
Linux(Fedora 28)에서는 홈 디렉터리 LUKS가 암호화되어 있습니다. Gnome Disk(스크린샷)를 사용할 때 기본 LUKS 파티션(위쪽 파란색 직사각형)과 해독된 홈 파티션(아래쪽 흰색 직사각형)을 별도로 벤치마킹할 수 있습니다.
LUKS 파티션은 500MB/s의 액세스 시간을 제공하지만 암호 해독된 액세스는 350MB/s를 제공합니다. 분명히 이것은 500GB SSD와 동일한 파티션입니다.
이렇게 결론을 내리는 것이 공평한가?암호화데이터 액세스 속도가 30%(= 150/500) 느려지나요?
이 유형의 번호가 문서화되어 있습니까? 아니면 제가 뭔가 잘못하고 있는 것입니다. 이것은 내가 예상했던 것보다 훨씬 더 느린 속도입니다.
편집하다:이것은 내 결과입니다
$ cryptsetup benchmark
# Tests are approximate using memory only (no storage IO).
PBKDF2-sha1 384375 iterations per second for 256-bit key
PBKDF2-sha256 494611 iterations per second for 256-bit key
PBKDF2-sha512 323634 iterations per second for 256-bit key
PBKDF2-ripemd160 293225 iterations per second for 256-bit key
PBKDF2-whirlpool 185917 iterations per second for 256-bit key
argon2i 4 iterations, 748334 memory, 4 parallel threads (CPUs) for 256-bit key (requested 2000 ms time)
argon2id 4 iterations, 745443 memory, 4 parallel threads (CPUs) for 256-bit key (requested 2000 ms time)
# Algorithm | Key | Encryption | Decryption
aes-cbc 128b 195.0 MiB/s 664.0 MiB/s
serpent-cbc 128b 28.8 MiB/s 94.7 MiB/s
twofish-cbc 128b 58.8 MiB/s 111.6 MiB/s
aes-cbc 256b 146.5 MiB/s 507.3 MiB/s
serpent-cbc 256b 33.3 MiB/s 110.2 MiB/s
twofish-cbc 256b 59.3 MiB/s 123.6 MiB/s
aes-xts 256b 433.7 MiB/s 416.8 MiB/s
serpent-xts 256b 101.0 MiB/s 94.7 MiB/s
twofish-xts 256b 111.8 MiB/s 110.3 MiB/s
aes-xts 512b 349.5 MiB/s 356.6 MiB/s
serpent-xts 512b 101.6 MiB/s 96.0 MiB/s
twofish-xts 512b 111.2 MiB/s 108.1 MiB/s
$ lscpu | grep aes
Flags: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge
mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall
nx rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology
nonstop_tsc cpuid aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx est
tm2 ssse3 cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic popcnt tsc_deadline_timer
aes xsave avx f16c rdrand lahf_lm cpuid_fault epb pti ssbd ibrs ibpb stibp
tpr_shadow vnmi flexpriority ept vpid fsgsbase smep erms xsaveopt dtherm
ida arat pln pts flush_l1d
2020년 편집:컴퓨터를 바꿨더니 더 빠른 프로세서로 설명할 수 있는 것 이상으로 완전히 다른 결과가 크라이포 벤치마크에서 나타났습니다. 따라서 내 기존 하드웨어에는 전용 암호화 칩이 없는 것 같습니다.
$ cryptsetup benchmark
# Tests are approximate using memory only (no storage IO).
PBKDF2-sha1 1756408 iterations per second for 256-bit key
PBKDF2-sha256 2264742 iterations per second for 256-bit key
PBKDF2-sha512 1653905 iterations per second for 256-bit key
PBKDF2-ripemd160 949797 iterations per second for 256-bit key
PBKDF2-whirlpool 711381 iterations per second for 256-bit key
argon2i 8 iterations, 1048576 memory, 4 parallel threads (CPUs) for 256-bit key (requested 2000 ms time)
argon2id 8 iterations, 1048576 memory, 4 parallel threads (CPUs) for 256-bit key (requested 2000 ms time)
# Algorithm | Key | Encryption | Decryption
aes-cbc 128b 1256.4 MiB/s 3669.2 MiB/s
serpent-cbc 128b 101.6 MiB/s 771.8 MiB/s
twofish-cbc 128b 230.0 MiB/s 418.4 MiB/s
aes-cbc 256b 947.9 MiB/s 2961.6 MiB/s
serpent-cbc 256b 105.1 MiB/s 785.0 MiB/s
twofish-cbc 256b 235.7 MiB/s 424.5 MiB/s
aes-xts 256b 2209.9 MiB/s 2218.9 MiB/s
serpent-xts 256b 762.0 MiB/s 776.6 MiB/s
twofish-xts 256b 415.7 MiB/s 384.0 MiB/s
aes-xts 512b 1701.8 MiB/s 1677.2 MiB/s
serpent-xts 512b 713.7 MiB/s 769.6 MiB/s
twofish-xts 512b 407.9 MiB/s 414.2 MiB/s
답변1
암호화는 액세스 시 OS에서 각 디스크 블록을 해독해야 하므로 CPU 로드를 추가합니다. 테스트 결과(~600MB/s 암호 해독)는 i7의 일반 AES 처리에 대해 상당히 평균입니다.
이 문제를 방지하기 위해 최신 CPU에는 일반적으로 하드웨어 기반 AES 지원이 내장되어 있습니다. Intel은 이 기능을 "AES-NI"( lscpu
"aes"로 표시)라고 부르며 동일한 속도로 2~3GB/s에 도달할 수 있습니다. AES 암호 해독.
먼저 실행하여 lscpu
기능 플래그 중 "aes"가 언급되어 있는지 확인하세요. 그만큼인텔 아크CPU 모델에 존재하는 것으로 표시되지만 펌웨어(BIOS) 설정에 의해 비활성화될 수 있습니다. (ARK에는 각주가 있습니다:"일부 제품은 프로세서 구성 업데이트를 통해 AES 새 지침을 지원할 수 있습니다. 최신 프로세서 구성 업데이트가 포함된 BIOS에 대해서는 OEM에 문의하세요.")
Linux는 "aesni_intel" 모듈을 사용하여 하드웨어 가속을 활성화합니다. 를 실행하여 커널에서 활성화되어 있는지 확인하십시오 zgrep AES_NI_INTEL /proc/config.gz
. " "가 표시되면 =y
기본 커널 이미지의 일부이며 사용 가능해야 합니다.
출력에 " =m
"가 표시되면 모듈로 컴파일된 것입니다. 를 실행하여 모듈을 수동으로 로드해 보세요 sudo modprobe -v aesni_intel
. 명령으로 모듈을 찾을 수 없으면 재부팅해야 할 수도 있습니다. (재부팅 후 uname -r
와 동일한 커널 버전이 표시되는지 확인하십시오 ls /lib/modules
.)