Reputation: 127
I need to open and read an encrypted file in a C++ program. Do I need to keep the password in the program? Are the user able to get the password when the program is disassembled?
What's the best way to keep the user away from the password?
Upvotes: 1
Views: 214
Reputation: 371
Another simplistic solution (provides very basic security only - may be succeptible to hacker attack )
Upvotes: 0
Reputation: 1622
If you just put the password hard coded then, yes. With some dissassembly it is easy to get the password (you don't even need to dissassemble fully, only get the strings). You can try to obfuscate the password somehow, such as computing a hash of something that creates the password (this is very simplistic). In the end if you give someone an encrypted file and a program that opens that file you can't really hide that information from them.
Upvotes: 1