Encrypting Readonly Arrays / Collections

Feb 15, 2011 at 4:45 AM

Arrays such as:

private static readonly byte[] b = new byte[] { 0x1, 0x2, 0x3 };
private static readonly short[] s = new short[] { 0x1, 0x2, 0x3 };
private static readonly int[] i = new int[] { 123, 433, 223 };

Are not encrypted with confuser.
An option to encrypt and/or compress these types of arrays would be wonderful.
Even a simple XOR cipher would do just fine.

If your feeling brave... Collections :)

private static readonly List<int> Example = new List<int> {1, 2, 3, 4, 5, 6, 7, 8, 9, 0};
private static readonly Dictionary<int, string> Example = new Dictionary<int, string> {{1, "1"}, {2, "2"}, {3, "3"}, {4, "4"}, {5, "5"}};



Coordinator
Feb 15, 2011 at 9:06 AM

For the the static readonly array, it can be supported and later may integrate into constant confusion.

For collections, in Reflector i see:

    Dictionary<int, string> dictionary = new Dictionary<int, string>();
    dictionary.Add(1, "1");
    dictionary.Add(2, "2");
    dictionary.Add(3, "3");
    dictionary.Add(4, "4");
    dictionary.Add(5, "5");

so it should be obfuscated with other constants as well.

Coordinator
Mar 6, 2011 at 2:54 PM
This discussion has been copied to a work item. Click here to go to the work item and continue the discussion.