bkcrack 1.7.1
Crack legacy zip encryption with Biham and Kocher's known plaintext attack.
file.hpp File Reference

Opening files and loading raw data. More...

#include "types.hpp"
#include <fstream>

Go to the source code of this file.

Classes

class  FileError
 Exception thrown if a file cannot be opened. More...
 

Functions

auto openInput (const std::string &filename) -> std::ifstream
 Open an input file stream.
 
auto loadStream (std::istream &is, std::size_t size) -> std::vector< std::uint8_t >
 Load at most size bytes from an input stream.
 
auto loadFile (const std::string &filename, std::size_t size) -> std::vector< std::uint8_t >
 Load at most size bytes from a file.
 
auto openOutput (const std::string &filename) -> std::ofstream
 Open an output file stream.
 

Detailed Description

Opening files and loading raw data.

This graph shows how functions from this file work together:

Function Documentation

◆ loadFile()

auto loadFile ( const std::string & filename,
std::size_t size ) -> std::vector< std::uint8_t >

Load at most size bytes from a file.

Exceptions
FileErrorif the file cannot be opened

◆ openInput()

auto openInput ( const std::string & filename) -> std::ifstream

Open an input file stream.

Exceptions
FileErrorif the file cannot be opened

◆ openOutput()

auto openOutput ( const std::string & filename) -> std::ofstream

Open an output file stream.

Exceptions
FileErrorif the file cannot be opened