日期:2014-05-17  浏览次数:21052 次

C#实现RSA加密和解密详解

RSA加密解密源码:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Security.Cryptography;

namespace MyRSA
{

public class MyRSA

{

private static string publicKey = 

"<RSAKeyValue><Modulus>6CdsXgYOyya/yQH" +

"TO96dB3gEurM2UQDDVGrZoe6RcAVTxAqDDf5L" + 

"wPycZwtNOx3Cfy44/D5Mj86koPew5soFIz9sx" +

"PAHRF5hcqJoG+q+UfUYTHYCsMH2cnqGVtnQiE" +

"/PMRMmY0RwEfMIo+TDpq3QyO03MaEsDGf13sP" +

"w9YRXiac=</Modulus><Exponent>AQAB</Exponent></RSAKeyValue>";

private static string privateKey = 

"<RSAKeyValue><Modulus>6CdsXgYOyya/yQH" +

"TO96dB3gEurM2UQDDVGrZoe6RcAVTxAqDDf5L" +

"wPycZwtNOx3Cfy44/D5Mj86koPew5soFIz9sx" +

"PAHRF5hcqJoG+q+UfUYTHYCsMH2cnqGVtnQiE" +