5
$\begingroup$

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?

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

1 Answer 1

10
$\begingroup$

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;
}
*/
$\endgroup$
0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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