We already know about DES algorithm methodThe RSA Public Key Encryption is useful method for Encryption and Decryption .The Code behind the Method is mention below. System; using System.Collections; using System.Collections.Generic; using System.Data; using System.Diagnostics; using System.Security; using System.Security.Cryptography; using System.Text; using System.IO; public class Tester { public static void Main() { RSACryptoServiceProvider myRSAProvide = new RSACryptoServiceProvider(); string strCrypt = null; byte[] bteCrypt = null; byte[] bteResult = null; try { strCrypt = "12345678"; bteCrypt = Encoding.ASCII.GetBytes(strCrypt); bteResult = myRSAProvide.Encrypt(bteCrypt, false); Console.WriteLine(Encoding.ASCII.GetString(bteResult)); } catch (CryptographicException ex) {
- using
0 comments:
Post a Comment