# Is it true that 7zip doesn't use any salt with its KDF?

This issue claims that 7zip does not use any salt with its key derivation function: https://github.com/magnumripper/JohnTheRipper/issues/1679

If that's true, wouldn't that mean you can crack multiple 7z files at very little extra cost?

• I think the format supports salts, although 7zip (the application) doesn't implement this functionality (AFAICT). Nov 10, 2015 at 19:19
• That's actually really surprising. This seems like a rather severe issue for 7zip.
– forest
Feb 24, 2018 at 3:38
• See elaboration on some aspects of this [link fixed by moderator]. May 24, 2021 at 19:38

From looking at the source or 7zip that seems to be the case. The format has a place for a salt, as SEJPM's link shows. It is mixed into the homebrewn iterated SHA-256 hash before the key. The 7zip decoder even seems to support salts. However, the encoder never uses a salt.

Oddly there is even code for generating a random 4-byte salt, but it is commented out. In the latest release of the code at least: I do not know if previous versions may have had it enabled.

For example, below is the salt generation part from the encoder (from 7zAes.cpp). Code calling this has also been commented out in various places.

/*
STDMETHODIMP CEncoder::ResetSalt()
{
_key.SaltSize = 4;
g_RandomGenerator.Generate(_key.Salt, _key.SaltSize);
return S_OK;
}
*/