Disk ARchive 2.7.16
Full featured and portable backup and archiving tool
Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | List of all members
libdar::crypto_sym Class Reference

symetrical strong encryption, interface to grypt library More...

#include <crypto_sym.hpp>

Inherits libdar::crypto_module.

+ Collaboration diagram for libdar::crypto_sym:

Public Member Functions

 crypto_sym (const secu_string &password, const archive_version &reading_ver, crypto_algo algo, const std::string &salt, const infinint &iteration_count, hash_algo kdf_hash, bool use_pkcs5)
 
 crypto_sym (const crypto_sym &ref)
 
 crypto_sym (crypto_sym &&ref) noexcept
 
crypto_symoperator= (const crypto_sym &ref)
 
crypto_symoperator= (crypto_sym &&ref) noexcept
 
virtual U_32 encrypted_block_size_for (U_32 clear_block_size) override
 
virtual U_32 clear_block_allocated_size_for (U_32 clear_block_size) override
 
virtual U_32 encrypt_data (const infinint &block_num, const char *clear_buf, const U_32 clear_size, const U_32 clear_allocated, char *crypt_buf, U_32 crypt_size) override
 
virtual U_32 decrypt_data (const infinint &block_num, const char *crypt_buf, const U_32 crypt_size, char *clear_buf, U_32 clear_size) override
 
virtual std::unique_ptr< crypto_module > clone () const override
 
const std::string & get_salt () const
 give access to the calculated or provided salt More...
 

Static Public Member Functions

static size_t max_key_len (crypto_algo algo)
 returns the max key length in octets for the given algorithm
 
static size_t max_key_len_libdar (crypto_algo algo)
 returns the max key length in octets to use to compute a key from a user provided password
 
static bool is_a_strong_password (crypto_algo algo, const secu_string &password)
 check whether the given password is reported as strong in regard to the given cipher
 

Private Member Functions

void detruit ()
 
void copy_from (const crypto_sym &ref)
 
void move_from (crypto_sym &&ref)
 

Private Attributes

std::string sel
 the salt More...
 

Detailed Description

symetrical strong encryption, interface to grypt library

Definition at line 66 of file crypto_sym.hpp.

Constructor & Destructor Documentation

◆ crypto_sym() [1/3]

libdar::crypto_sym::crypto_sym ( const secu_string password,
const archive_version reading_ver,
crypto_algo  algo,
const std::string &  salt,
const infinint iteration_count,
hash_algo  kdf_hash,
bool  use_pkcs5 
)
Parameters
passwordcipher password
reading_verarchive format version
algociphering algorithm to use
saltif set empty, the salt is generated by the crypto_sym when use_pkcs5 is set to true, else it is not used
iteration_countnot used if use_pkcs5 is not set
kdf_hashnot used if use_pkcs5 is not set
use_pkcs5must be set to true when password is human defined to add a key derivation

◆ crypto_sym() [2/3]

libdar::crypto_sym::crypto_sym ( const crypto_sym ref)
inline

Definition at line 77 of file crypto_sym.hpp.

◆ crypto_sym() [3/3]

libdar::crypto_sym::crypto_sym ( crypto_sym &&  ref)
inlinenoexcept

Definition at line 78 of file crypto_sym.hpp.

◆ ~crypto_sym()

virtual libdar::crypto_sym::~crypto_sym ( )
inlinevirtualnoexcept

Definition at line 81 of file crypto_sym.hpp.

Member Function Documentation

◆ copy_from()

void libdar::crypto_sym::copy_from ( const crypto_sym ref)
inlineprivate

Definition at line 189 of file crypto_sym.hpp.

◆ detruit()

void libdar::crypto_sym::detruit ( )
inlineprivate

Definition at line 188 of file crypto_sym.hpp.

◆ get_salt()

const std::string & libdar::crypto_sym::get_salt ( ) const
inline

give access to the calculated or provided salt

Definition at line 100 of file crypto_sym.hpp.

References sel.

◆ move_from()

void libdar::crypto_sym::move_from ( crypto_sym &&  ref)
inlineprivate

Definition at line 190 of file crypto_sym.hpp.

◆ operator=() [1/2]

crypto_sym & libdar::crypto_sym::operator= ( const crypto_sym ref)
inline

Definition at line 79 of file crypto_sym.hpp.

◆ operator=() [2/2]

crypto_sym & libdar::crypto_sym::operator= ( crypto_sym &&  ref)
inlinenoexcept

Definition at line 80 of file crypto_sym.hpp.

Member Data Documentation

◆ sel

std::string libdar::crypto_sym::sel
private

the salt

Definition at line 113 of file crypto_sym.hpp.

Referenced by get_salt().


The documentation for this class was generated from the following file: