I\'m trying to write an encrpytion using the OTP method. In keeping with the security theories I need the plain text documents to be stored only in memory and never ever wri
Using one of std::stringstream
or fmemopen will get you file-like access to blocks of memory. If (for security) you want to avoid it being swapped out, use mlock
which is probably easiest to use with fmemopen
's buffer than std::stringstream
. Combining mlock
with std::stringstream
would probably need to be done via a custom allocator (used as a template parameter).