Encrypt strings

This algorithm prevents a simple textual search through the binary locating interesting code, such as the code responsible for showing a specific warning.

BeforeAfter
static void CheckLicense()
{
    if (!LicenseValid())
    {
        MessageBox.Show(
            "License not valid.");
    }
}
private static void CheckLicense()
{
    if (!LicenseValid())
        MessageBox.Show(
            StateConsoleCollection.Site);
}

static class StateConsoleCollection
{
    public static string Site
        = UnregisterInternal.Type(24);
}

Rummage creates a field for each encrypted string, and picks a plausible-sounding name for it so that it does not stand out. The string is decrypted on first use and only once. The performance impact of this technique is negligible. Do keep in mind, however, that this transformation does not permanently erase information, and can, in theory, be undone.

As a side-effect of this obfuscation, attempts to decompile the program can easily render the program invalid: simply opening the obfuscated program in a .NET analysis tool or library discards all the encrypted string data.