CryptoSys PKI  23.0.0
Public Types | Static Public Member Functions | List of all members
dipki::Wipe Class Reference

Data wiping functions. More...

Public Types

enum class  Opts
 Wipe options. More...
 

Static Public Member Functions

static bool Data (bvec_t &data)
 Zeroise then clear data in memory. More...
 
static bool File (const std::string fileName, Opts opts=Opts::Dod7Pass)
 Securely wipe and delete a file. More...
 
static bool String (std::string &s)
 Zeroise then clear a string. More...
 

Detailed Description

Data wiping functions.

Member Enumeration Documentation

◆ Opts

enum dipki::Wipe::Opts
strong

Wipe options.

Enumerator
Dod7Pass 

DOD 7-pass (default)

Simple 

Overwrite with single pass of zero bytes (quicker but less secure).

Member Function Documentation

◆ Data()

static bool dipki::Wipe::Data ( bvec_t data)
static

Zeroise then clear data in memory.

Parameters
datadata to be wiped
Returns
true if successful; false if fails
dipki::bvec_t bv = dipki::str2bvec("Some secret data");
cout << "After Wipe::Data='" << dipki::Cnv::ToHex(bv) << "'" << endl;
// After Wipe::Data=''
static std::string ToHex(const bvec_t &bv)
Encodes an array of bytes as a hexadecimal-encoded string.
static bool Data(bvec_t &data)
Zeroise then clear data in memory.
std::vector< unsigned char > bvec_t
A vector of bytes (our typedef for a byte array)
Definition: dipki.hpp:79
bvec_t str2bvec(const std::string &s)
Convert a string to a byte vector.

◆ File()

static bool dipki::Wipe::File ( const std::string  fileName,
Opts  opts = Opts::Dod7Pass 
)
static

Securely wipe and delete a file.

Parameters
fileNameName of file to be wiped
optsOptions (optional, default = DOD 7-pass)
Returns
true if successful; false if fails

◆ String()

static bool dipki::Wipe::String ( std::string &  s)
static

Zeroise then clear a string.

Parameters
sString to be wiped
Returns
true if successful; false if fails
std::string s = "More secret data";
cout << "After Wipe::String='" << s << "'" << endl;
// After Wipe::String=''
static bool String(std::string &s)
Zeroise then clear a string.
Copyright © 2004-24 D.I. Management Services Pty Limited t/a CryptoSys ABN 78 083 210 584 Australia. All rights reserved. <www.di-mgt.com.au> <www.cryptosys.net>. Generated on Mon Sep 23 2024 15:37:33 by Doxygen 1.9.1.