Techniques for obscuring sensitive strings in C++

后端 未结 14 877
孤街浪徒
孤街浪徒 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 12:54

    Somewhat dependent on what you are trying to protect as joshperry points out. From experience, I would say that if it is part of some licensing scheme to protect your software then don't bother. They will eventially reverse engineer it. Simply use a simple cipher like ROT-13 to protect it from simple attacks (line running strings over it). If it is to secure users sensitive data I would be questioning whether protecting that data with a private key stored locally is a wise move. Again it comes down to what you are trying to protect.

    EDIT: If you are going to do it then a combination of techniques that Chris points out will be far better than rot13.

提交回复
热议问题