bkcrack 1.7.1
Crack legacy zip encryption with Biham and Kocher's known plaintext attack.
file.hpp
Go to the documentation of this file.
1#ifndef BKCRACK_FILE_HPP
2#define BKCRACK_FILE_HPP
3
24
25#include "types.hpp"
26
27#include <fstream>
28
30class FileError : public BaseError
31{
32public:
34 explicit FileError(const std::string& description);
35};
36
39auto openInput(const std::string& filename) -> std::ifstream;
40
42auto loadStream(std::istream& is, std::size_t size) -> std::vector<std::uint8_t>;
43
46auto loadFile(const std::string& filename, std::size_t size) -> std::vector<std::uint8_t>;
47
50auto openOutput(const std::string& filename) -> std::ofstream;
51
52#endif // BKCRACK_FILE_HPP
BaseError(const std::string &type, const std::string &description)
Constructor.
FileError(const std::string &description)
Constructor.
auto openOutput(const std::string &filename) -> std::ofstream
Open an output file 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 loadStream(std::istream &is, std::size_t size) -> std::vector< std::uint8_t >
Load at most size bytes from an input stream.
auto openInput(const std::string &filename) -> std::ifstream
Open an input file stream.
Useful types, constants and utility functions.