Dash Core Source Documentation (0.16.0.1)

Find detailed information regarding the Dash Core source code.

Encryption/decryption context with key information. More...

#include <crypter.h>

Public Member Functions

bool SetKeyFromPassphrase (const SecureString &strKeyData, const std::vector< unsigned char > &chSalt, const unsigned int nRounds, const unsigned int nDerivationMethod)
 
bool Encrypt (const CKeyingMaterial &vchPlaintext, std::vector< unsigned char > &vchCiphertext) const
 
bool Decrypt (const std::vector< unsigned char > &vchCiphertext, CKeyingMaterial &vchPlaintext) const
 
bool SetKey (const CKeyingMaterial &chNewKey, const std::vector< unsigned char > &chNewIV)
 
void CleanKey ()
 
 CCrypter ()
 
 ~CCrypter ()
 

Private Member Functions

int BytesToKeySHA512AES (const std::vector< unsigned char > &chSalt, const SecureString &strKeyData, int count, unsigned char *key, unsigned char *iv) const
 

Private Attributes

std::vector< unsigned char, secure_allocator< unsigned char > > vchKey
 
std::vector< unsigned char, secure_allocator< unsigned char > > vchIV
 
bool fKeySet
 

Friends

class wallet_crypto::TestCrypter
 

Detailed Description

Encryption/decryption context with key information.

Definition at line 76 of file crypter.h.

Constructor & Destructor Documentation

◆ CCrypter()

CCrypter::CCrypter ( )
inline

Definition at line 99 of file crypter.h.

References fKeySet, vchIV, vchKey, WALLET_CRYPTO_IV_SIZE, and WALLET_CRYPTO_KEY_SIZE.

◆ ~CCrypter()

CCrypter::~CCrypter ( )
inline

Definition at line 106 of file crypter.h.

References CleanKey().

Member Function Documentation

◆ BytesToKeySHA512AES()

int CCrypter::BytesToKeySHA512AES ( const std::vector< unsigned char > &  chSalt,
const SecureString strKeyData,
int  count,
unsigned char *  key,
unsigned char *  iv 
) const
private

◆ CleanKey()

void CCrypter::CleanKey ( )
inline

Definition at line 92 of file crypter.h.

References fKeySet, memory_cleanse(), vchIV, and vchKey.

Referenced by ~CCrypter().

◆ Decrypt()

bool CCrypter::Decrypt ( const std::vector< unsigned char > &  vchCiphertext,
CKeyingMaterial vchPlaintext 
) const

◆ Encrypt()

bool CCrypter::Encrypt ( const CKeyingMaterial vchPlaintext,
std::vector< unsigned char > &  vchCiphertext 
) const

◆ SetKey()

bool CCrypter::SetKey ( const CKeyingMaterial chNewKey,
const std::vector< unsigned char > &  chNewIV 
)

Definition at line 62 of file crypter.cpp.

References fKeySet, memcpy(), vchIV, vchKey, WALLET_CRYPTO_IV_SIZE, and WALLET_CRYPTO_KEY_SIZE.

Referenced by DecryptSecret(), and EncryptSecret().

◆ SetKeyFromPassphrase()

bool CCrypter::SetKeyFromPassphrase ( const SecureString strKeyData,
const std::vector< unsigned char > &  chSalt,
const unsigned int  nRounds,
const unsigned int  nDerivationMethod 
)

Friends And Related Function Documentation

◆ wallet_crypto::TestCrypter

friend class wallet_crypto::TestCrypter
friend

Definition at line 78 of file crypter.h.

Member Data Documentation

◆ fKeySet

bool CCrypter::fKeySet
private

Definition at line 82 of file crypter.h.

Referenced by CCrypter(), CleanKey(), Decrypt(), Encrypt(), SetKey(), and SetKeyFromPassphrase().

◆ vchIV

std::vector<unsigned char, secure_allocator<unsigned char> > CCrypter::vchIV
private

◆ vchKey

std::vector<unsigned char, secure_allocator<unsigned char> > CCrypter::vchKey
private

The documentation for this class was generated from the following files:
Released under the MIT license