mercredi 1 juin 2016

Secure, password specific std::string that zeroes itself upon de-allocation

I found something relevant to the question at [ 1 ] but it is Boost specific due to the age of the post and C++11 having not been matured by that point but otherwise, I'm looking for a secure std::string typedef of the sort below that zeroes itself upon de-allocation.

typedef std::basic_string<char, std::char_traits<char>, SecureStr<char>> string;

[ 1 ] - how does one securely clear std::string?

Would anyone know of good examples? The code must also NOT be optimized away on compilation and as such, compromise the security of the application. I know this can be quite the problem without good use of APIs into the O/S and/or compiler.

Aucun commentaire:

Enregistrer un commentaire