你可以去查查msdn。
假设有TextBox1,TextBox2.using System.Security.Cryptography ; RSAParameters rsaParam;
CspParameters CSPpar = new CspParameters ();
CSPpar.Flags=CspProviderFlags.UseMachineKeyStore ;
RSACryptoServiceProvider rsa= new RSACryptoServiceProvider (CSPpar);
byte[] byteinput=(new System.Text.UnicodeEncoding ()).GetBytes (TextBox1.Text );
byte[] byteEncrypted=rsa.Encrypt(byteinput,false);
rsaParam=rsa.ExportParameters (true); TextBox2.Text = (new System.Text.UnicodeEncoding()).GetString(byteEncrypted);那么TextBox2就是一些看起来象乱码的东西了.
假设有TextBox1,TextBox2.using System.Security.Cryptography ; RSAParameters rsaParam;
CspParameters CSPpar = new CspParameters ();
CSPpar.Flags=CspProviderFlags.UseMachineKeyStore ;
RSACryptoServiceProvider rsa= new RSACryptoServiceProvider (CSPpar);
byte[] byteinput=(new System.Text.UnicodeEncoding ()).GetBytes (TextBox1.Text );
byte[] byteEncrypted=rsa.Encrypt(byteinput,false);
rsaParam=rsa.ExportParameters (true); TextBox2.Text = (new System.Text.UnicodeEncoding()).GetString(byteEncrypted);那么TextBox2就是一些看起来象乱码的东西了.
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货