你可以去查查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就是一些看起来象乱码的东西了.