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

Popular posts from this blog

c# - SharpSVN - How to get the previous revision? -

c++ - Is it possible to compile a VST on linux? -

url - Querystring manipulation of email Address in PHP -