c# - Will SecureString give me any advantage when it comes to MSIL decompilation? -
is in way better this
char[] sec = { 'a', 'b', 'c'}; securestring s = new securestring(); foreach (char c in sec) { s.appendchar(c); } intptr pointername = system.runtime.interopservices.marshal.securestringtobstr(s); string secret = system.runtime.interopservices.marshal.ptrtostringbstr(pointername);
than this
string secret = "abc";
or this
char[] sec = { 'a', 'b', 'c'}; string secret = new secret(sec);
if want protect "abc" beeing detected in decompiled msil code?
securestring protect string once in memory, string compiled msil still there in plain. if need hide sensitify information conside encrypted app.config described here: http://weblogs.asp.net/jgalloway/archive/2008/04/13/encrypting-passwords-in-a-net-app-config-file.aspx
hth dominik
Comments
Post a Comment