Non usare stringhe normali.
In C# pensavo a qualcosa del genere ...
codice:using System; using System.Security; using System.Runtime.InteropServices; public class Example { static private SecureString accsec; static private void cripto() { accsec = new SecureString(); accsec.AppendChar('P'); accsec.AppendChar('A'); accsec.AppendChar('S'); accsec.AppendChar('S'); accsec.AppendChar('W'); accsec.AppendChar('O'); accsec.AppendChar('R'); accsec.AppendChar('D'); } public static void Main() { cripto(); IntPtr bstr = Marshal.SecureStringToBSTR(accsec); try { Console.WriteLine(Marshal.PtrToStringBSTR(bstr)); } finally { Marshal.FreeBSTR(bstr); } } }