I am curious about how password recovery works for password protected files. And I want to know the exact flow of the 7-zip encryption mechanism :) !!
7-zip
uses the AES-256 encryption algorithm in CBC mode to encrypt files or a folder. The key is generated from the user's passphrase using the SHA-256 hash function. The passphrase is hashed using SHA-256 2^19 (524288) times, to increase the cost of exhaustive search. Also, to help reduce the risk of dictionary attacks, a salt is appended to the passphrase before hashing.
My first question is: how does key_derivation function work to generate a 256-bit key? What is the importance of the IV for AES CBC mode and how it is generated?
My second and most important question is: how is the key is verified to decrypt the 7-zip archive? How does its key_verification function work?