-2

When I try to use TrueCrypt or VeraCrypt, write speeds are very slow, but read speeds are fast. This happens with both programs, and it occurs regardless of whether I'm using an encrypted file container or an encrypted partition. (So, no, this isn't fragmentation etc.)

For example, on my SSD where unencrypted read and write speed both benchmark over 1GB/s on CrystalDiskMark, an encrypted volume using AES-XTS and HMAC-RIPEMD-160 benchmarks read speeds of 810 MB/s vs. write speeds of 40 MB/s.

Why are encrypted writes so much slower than encrypted reads?

(And no, I'm not doing something silly like benchmarking in a VM. I swear I've already thought of all the "easy" answers and they don't explain the situation as far as I can tell.)

  • Possible duplicate of Is a VeraCrypt partition slower? – Keltari Apr 28 '18 at 6:16
  • 1
    "Why are encrypted writes so much slower than encrypted reads?" The unencrypted write time should be significantly longer than the read time, so that benchmark is suspect. But the encryption process takes longer than the decryption process. It isn't clear what level of detail you're looking for to explain the difference. – fixer1234 Apr 28 '18 at 6:52
  • @fixer1234: "The unencrypted write time should be significantly longer than the read time, so that benchmark is suspect." ...no, my benchmark isn't suspect; you just haven't seen fast SSDs. However, I'm not aware of encryption taking 20x more time than decryption; it should be about the same as far as I'm aware. If you believe otherwise, you don't really need any detail to prove it: just show me a program (or use standard OpenSSL commands) that demonstrate encryption taking 20x longer than decryption. I'll happily accept such an answer. – Mehrdad Apr 28 '18 at 7:32
  • @Keltari: No, this isn't a duplicate of that... my read speed is so ridiculously faster than my write speed, even for the encrypted partition. That guy was just wondering why encryption was slower than plaintext... it doesn't explain the read-write discrepancy. – Mehrdad Apr 28 '18 at 7:35
  • What model CPU do you have? – davidgo Apr 28 '18 at 9:13
0

Are you sure it's the encryption alone causing the speed differences?

First, your drive could be using compression to return artificially high unencrypted read & write speeds. This article (also linked below) shows "Zalman actually draws an honest picture of data compression and its effect. The chart on its product website clearly shows that writing incompressible data may happen slower that compressible information." with the graphic showing incompressible reads 500MB/s and incompressible writes ~160MB/s.

And if the drive was full or wasn't TRIMed it could slow down writes from needing to erase sectors before writing. It's a security leak to even use TRIM with encryption, since it reveals which sectors are empty, and VeraCrypt may not be TRIMing (it really shouldn't), slowing writes.

And CrystalDiskMark (or the SSD itself) could be strongly influenced by the filesystem and type of test being done. I'd try several different tests, and different benchmarks too (like AS SSD & Iometer & PCMark) and real-world usage tests before concluding that slow encryption is the only possible cause.

This article on Tom's Hardware, Does Your SSD's File System Affect Performance?, shows wildly different read & write speeds for three different filesystems on two different SSD's, without any encryption. Here's a few of the results:

enter image description here

Reads could even be much slowerdescription

enter image description here

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.