bkcrack 1.7.1
Crack legacy zip encryption with Biham and Kocher's known plaintext attack.
|
Parse and store arguments. More...
#include <Arguments.hpp>
Classes | |
struct | ChangeKeys |
Arguments needed to change an archive's internal password representation. More... | |
struct | ChangePassword |
Arguments needed to change an archive's password. More... | |
class | Error |
Exception thrown if an argument is not valid. More... | |
struct | LengthInterval |
Range of password lengths to try during password recovery. More... |
Public Member Functions | |
Arguments (int argc, const char *argv[]) | |
Constructor parsing command line arguments. | |
auto | loadData () const -> Data |
Load the data needed for an attack based on parsed arguments. |
Public Attributes | |
std::optional< std::string > | cipherFile |
File containing the ciphertext. | |
std::optional< std::size_t > | cipherIndex |
Index of the zip entry containing ciphertext. | |
std::optional< std::string > | cipherArchive |
Zip archive containing cipherFile. | |
std::optional< std::string > | plainFile |
File containing the known plaintext. | |
std::optional< std::size_t > | plainIndex |
Index of the zip entry containing plaintext. | |
std::optional< std::string > | plainArchive |
Zip archive containing plainFile. | |
std::size_t | plainFilePrefix = 1 << 20 |
Maximum number of bytes of plaintext to read from plainFile. | |
int | offset = 0 |
Plaintext offset relative to ciphertext without encryption header (may be negative) | |
std::map< int, std::uint8_t > | extraPlaintext |
bool | ignoreCheckByte = false |
Tell not to use the check byte derived from ciphertext entry metadata as known plaintext. | |
int | attackStart = 0 |
Staring point of the attack on Z values remaining after reduction. | |
std::optional< std::string > | password |
Password from which to derive the internal password representation. | |
std::optional< Keys > | keys |
Internal password representation. | |
std::optional< std::string > | decipheredFile |
File to write the deciphered text corresponding to cipherFile. | |
bool | keepHeader = false |
Tell whether to keep the encryption header or discard it when writing the deciphered text. | |
std::optional< std::string > | decryptedArchive |
File to write an unencrypted copy of the encrypted archive. | |
std::optional< ChangePassword > | changePassword |
Arguments needed to change an archive's password. | |
std::optional< ChangeKeys > | changeKeys |
Arguments needed to change an archive's internal password representation. | |
std::optional< std::vector< std::uint8_t > > | bruteforce |
Characters to generate password candidates. | |
std::optional< LengthInterval > | length |
Range of password lengths to try during password recovery. | |
std::string | recoveryStart |
Starting point for password recovery. | |
int | jobs |
Number of threads to use for parallelized operations. | |
bool | exhaustive = false |
Tell whether to try all candidates (keys or passwords) exhaustively or stop after the first success. | |
std::optional< std::string > | infoArchive |
Zip archive about which to display information. | |
bool | version = false |
Tell whether version information is needed or not. | |
bool | help = false |
Tell whether help message is needed or not. |
Parse and store arguments.
Arguments::Arguments | ( | int | argc, |
const char * | argv[] ) |
Constructor parsing command line arguments.
Error | if an argument is not valid |
auto Arguments::loadData | ( | ) | const -> Data |
Load the data needed for an attack based on parsed arguments.
FileError | if a file cannot be opened |
ZipError | if a zip entry cannot be opened |
Data::Error | if the loaded data cannot be used to carry out an attack |
std::optional<ChangeKeys> Arguments::changeKeys |
Arguments needed to change an archive's internal password representation.
Changing the internal password representation is an alternative to changing the password when the target password is not known, but its internal representation is known.
std::optional<ChangePassword> Arguments::changePassword |
Arguments needed to change an archive's password.
std::map<int, std::uint8_t> Arguments::extraPlaintext |
Additional bytes of plaintext with their offset relative to ciphertext without encryption header (may be negative)
std::optional<LengthInterval> Arguments::length |
Range of password lengths to try during password recovery.
std::size_t Arguments::plainFilePrefix = 1 << 20 |
Maximum number of bytes of plaintext to read from plainFile.
Set to 1 MiB by default. Using more plaintext is possible, but it uses more RAM and does not speed up the attack much.