I have a concrete problem but I'm afraid it might be a duplicate or in violation of another rule, and I've been told that the SO meta is an adequate place to ask feedback on possible questions. The question would be as such:
I'm writing a small rust CLI program that prints a message to the user after they have solved a task. Normally, string literals or constants are stored in clear in a binary, so the
strings
command and some heuristic withgrep
will usually reveal whatever string the developer would like to hide.
Rust already has a tool for hiding string literals (theobfstr
crate) but it only generates temporary values and my problem has to do with constants: due to its length, the message is imported from a text file viainclude_str!
as aconst
. This means thati should encrypt it at the time of declaration and use a function to generate a temporary decryption at the moment of usage
Is there a Rust crate that handles compile-time obfuscation of constant strings?
Would this be answered or removed?