Techniques for obscuring sensitive strings in C++

后端 未结 14 884
孤街浪徒
孤街浪徒 2020-12-12 12:12

I need to store sensitive information (a symmetric encryption key that I want to keep private) in my C++ application. The simple approach is to do this:

std::         


        
14条回答
  •  孤街浪徒
    2020-12-12 13:06

    A strategy i've used in the past is to create an array of seemingly-random characters. You initially insert, and then locate your particular characters with a algebraic process where each step from 0 to N will yield a number < size of the array which contains the next char in your obfuscated string. (This answer is feeling obfuscated now!)

    Example:

    Given an array of chars (numbers and dashes are for reference only)

    0123456789
    ----------
    ALFHNFELKD
    LKFKFLEHGT
    FLKRKLFRFK
    FJFJJFJ!JL
    

    And an equation whose first six results are: 3, 6, 7, 10, 21, 47

    Would yield the word "HELLO!" from the array above.

提交回复
热议问题