Boost logo

Boost :

Subject: Re: [boost] [encrypted strings]
From: Sohail Somani (sohail_at_[hidden])
Date: 2009-04-27 14:35:28


Eric Niebler wrote:
> David Abrahams wrote:
>> on Mon Apr 27 2009, Sohail Somani <sohail-AT-taggedtype.net> wrote:
>>
>>> There is an implementation of a mpl::string by Eric Neibler somewhere.
>>
>> well, that's an interesting point. The string itself wouldn't even
>> appear in the data segment. Cool.
>
> Below is the definition of a std_str() function that takes an
> mpl::string and turns it into a std::string. (boost/mpl/string.hpp is
> available on trunk, but hasn't been released yet.) It's not *very*
> obfuscated, but should be enough to fool a naive string-dump.

I think it should be straightforward for the OP to write a rot13
transformation and apply that (at compile-time) to the mpl::string (or
even vector_c<char,...>.) Then he can use the inverse + your function to
compute the deciphered string at runtime every time he needs it. Though
I guess he could also have the computation of the inverse set up at
compile time, just not execute it.

Interesting mental exercise anyway!

-- 
Sohail Somani
http://uint32t.blogspot.com

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk