6

A previous discussion on Cryptography StackExchange leads me to understand that 7-Zip does not use salt to derive an encryption key from password to use its AES-256 encryption; that this is a potentially severe shortcoming; and that its impact is to make it relatively easy to crack multiple .7z files.

My question is, what does this mean in practice? Possible inferences or points of confusion:

(1) Virtually all other notable AES-256 file encryption tools (e.g., AES Crypt, Gpg4win, Cryptomator) do use salt; therefore they are significantly more secure than 7-Zip.

(2) The absence of salt doesn't have any practical effect on brute force password cracking methods, else Elcomsoft would not say that .7z is still harder to crack than RAR5.

(3) The absence of salt is a severe shortcoming only where the cracker seeks access to multiple .7z files. But why would that make a difference? If all those files use the same password, then yes, brute forcing one will open them all. If they use different passwords, the absence of salt would presumably make no difference.

(4) The absence of salt in 7-Zip is moot if I use some other AES-256 tool with salt to create a .7z file.

Ray Woodcock
  • 183
  • 6

2 Answers2

6

The absence of salt is a severe shortcoming only where the cracker seeks access to multiple 7z files. But why would that make a difference?

If there is a password verification method and there is no salt, then password search can be batched. Calculate one hash and test for all targets. If you consider that the 7Zip uses SHA-256 with $2^{19}$ iteration this is a huge reduction in the attacking timing.

The batching is usually performed by building a rainbow table in advance for the small size of passwords including the known passwords. This highly reduces the attack time if the target passwords are on the table.

If the attacker has only one file, then this doesn't matter; instead of building the table, just search. For further usages building the table is preferable.

It seems that 7zip doesn't use a password verification method. One has to decrypt and unzip the file. If during this process there is a format error the process will stop. This severely affects the performance of batching. Still, the attacker can generate the hash of the password and test for all targets this is faster than one by one for each file.

In any case use passwords with good strength like passwords generated from dicewire or Bip-39. If you have a password that has strength > 128 then you are safe against the attacker even the batch.

Note that there is no detailed information about the experiment made with Elcomsoft. Does it a single password or multiple password search. It seems a single search. The article is not well written in this sense.

The less number of password tries is due to the number of iterations.

The absence of salt in 7-Zip is moot if I use some other AES-256 tool with salt to create a 7z file.

Lack of Salt is not a real problem for a power user. Just generate a salt and carry it with the 7zip file. During the key generation prepend the salt to yo your password.

For normal users, the salt must be used against the batch attackers.

kelalaka
  • 48,443
  • 11
  • 116
  • 196
  • That helps. My understanding now: (1) Comparing 7-Zip vs. e.g., Gpg4win requires knowing whether the tool uses salt and/or a password verification method. (2) Better testing and/or reporting are needed to determine whether a 7-zip file is more secure than a RAR4 or RAR5. (3) Not sure. (4) An AES-256 tool that uses salt and does not use a password verification method will create a more secure .7z file than 7-Zip does.

    Aside from no. 3, does that sound about right?

    – Ray Woodcock May 24 '21 at 20:32
  • 1
  • one always should write explicitly so that others can repeat the process. This is why we require implementations around. 2) When you open the archive (any) it may leave traces of the files on the disk. I prefer Verarypt volume for encryption. You can setup small volumes, too.
  • – kelalaka May 24 '21 at 21:04
  • 1
  • salt is there, for a single target there is no difference at all, 4) Use veracypt.
  • – kelalaka May 24 '21 at 21:06