I am unsure if I should have posted this in the Windows Programming forum, so let me know.
I have sensitive data shared across multiple processes using #pragma comment(linker, "Shared:rws"). They are two C strings of 1K characters. I am encrypting these using CryptProtectMemory() and I decrypt it whenever I need using a class that synchronizes access across the processes using a mutex. The result is a std::wstring object containing the unencrypted data.
I think I should create a new class, namely securewstring, that securely erases the buffer using SecureZeroMemory() and that inherits from std::wstring.
So the question would be: Is there an already-made secure string in STL? If not, can you point me in the right direction about creating a new one? What's the name of the pointer containing the buffer and its size? What should I override? I would imagine I need a new destructor. What else? Operator=? Or can I just override a "clean up" method that is called by all those?