求解密的方法~~~~~~ 小弟看到一个加密的东东,不知如何加密,请高手指教。R+wt15HjHi7yB2yvZO2bPQ== 解密为123456 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 应该是base64编码...Convert类里面有对应解码方法... 我看怎么跟MD5加密出来的东东很像~~~偶不是安在天的手下,实在不知道怎么直接解密~~~偶也很想知道单向MD5加密后如果忘了密码怎么查...期待楼下的牛人 相反 123456 加密为R+wt15HjHi7yB2yvZO2bPQ== use CAPICOM and DES encrypt. private void button1_Click(object sender, System.EventArgs e) { crypt=new RSACryptoServiceProvider(); publickey=crypt.ToXmlString(false); richtext.Text="导出秘匙的情况下:\n"+publickey+"\n"; privatekey=crypt.ToXmlString(true); string info="仅仅导出公匙的情况下:\n"+privatekey+"\n"; richtext.AppendText(info); crypt.Clear(); } //保存公匙信息 private void button2_Click(object sender, System.EventArgs e) { save=new SaveFileDialog(); save.Filter="File Text (*.txt)|*.txt|All File (*.*)|*.*"; save.ShowDialog(); publicinfo=save.FileName; } //保存密匙信息 private void button3_Click(object sender, System.EventArgs e) { save=new SaveFileDialog(); save.Filter="File Text (*.txt)|*.txt|All File (*.*)|*.*"; save.ShowDialog(); privateinfo=save.FileName; } //把钥匙信息写入文件 private void button6_Click(object sender, System.EventArgs e) { StreamWriter one=new StreamWriter(publicinfo,true,UTF8Encoding.UTF8); one.Write(publickey); StreamWriter two=new StreamWriter(privateinfo,true,UTF8Encoding.UTF8); two.Write(privatekey); one.Flush(); two.Flush(); one.Close(); two.Close(); MessageBox.Show("成功保存公匙和密匙!"); } //用公匙加密 private void button4_Click(object sender, System.EventArgs e) { crypt=new RSACryptoServiceProvider(); UTF8Encoding enc=new UTF8Encoding(); bytes=enc.GetBytes(textBox1.Text); crypt.FromXmlString( readpublickey ); bytes = crypt.Encrypt( bytes,false ); string encryttext=enc.GetString(bytes);//encryptbyte); richtext2.Text="加密结果:\n"+encryttext+"\n"+"加密结束!"; } private void button5_Click(object sender, System.EventArgs e) { UTF8Encoding enc=new UTF8Encoding(); byte [] decryptbyte; crypt.FromXmlString ( readprivatekey ) ; decryptbyte = crypt.Decrypt( bytes,false ); string decrypttext=enc.GetString( decryptbyte ); richtext3.Text = "解密结果:\n" + decrypttext + "\n" + "解密结束!" ; } //从文件中读取公匙信息 private void button7_Click(object sender, System.EventArgs e) { StreamReader sr ; open = new OpenFileDialog( ); open.Filter="Text File (*.txt)|*.txt|All File (*.*)|*.* "; // open.ShowDialog(); if(open.ShowDialog()==DialogResult.OK) { sr = new StreamReader(open.FileName,UTF8Encoding.UTF8); } else { MessageBox.Show("发生错误!"); return; } readpublickey = sr.ReadToEnd(); sr.Close(); } //从文件中读取私匙信息 private void button8_Click(object sender, System.EventArgs e) { open = new OpenFileDialog( ); open.Filter="Text File (*.txt)|*.txt|All File (*.*)|*.* "; open.ShowDialog(); StreamReader sr = new StreamReader(open.FileName,UTF8Encoding.UTF8); readprivatekey = sr.ReadToEnd(); sr.Close(); } 怎么自定义控件呢 VaryByControl 缓存控件的问题 采用这种方式导出excel文件时,怎么制定sheet的名字? 开发软件的报错机制怎么搞? 有偿求 C# 2003 遍历FTP目录的代码 查询DataGrid某列数据 急!!!我在运行C#色时候总遇到同一个错误 请各位大哥帮帮忙!!!! 未将对象引用设置到对象的实例 新手:怎么判定一个文本框只能输入特定的字符 请问.NET框架类库中有没有什么函数可以取两个(或多个)数组(或集合)的交集(或全集)的? C#2.0调用ActiveX组件出错,请教原因? 请教NET平台下的GPRS编程
偶也很想知道单向MD5加密后如果忘了密码怎么查...期待楼下的牛人
{
crypt=new RSACryptoServiceProvider();
publickey=crypt.ToXmlString(false);
richtext.Text="导出秘匙的情况下:\n"+publickey+"\n";
privatekey=crypt.ToXmlString(true);
string info="仅仅导出公匙的情况下:\n"+privatekey+"\n";
richtext.AppendText(info);
crypt.Clear();
}
//保存公匙信息
private void button2_Click(object sender, System.EventArgs e)
{
save=new SaveFileDialog();
save.Filter="File Text (*.txt)|*.txt|All File (*.*)|*.*";
save.ShowDialog();
publicinfo=save.FileName;
}
//保存密匙信息
private void button3_Click(object sender, System.EventArgs e)
{
save=new SaveFileDialog();
save.Filter="File Text (*.txt)|*.txt|All File (*.*)|*.*";
save.ShowDialog();
privateinfo=save.FileName;
}
//把钥匙信息写入文件
private void button6_Click(object sender, System.EventArgs e)
{
StreamWriter one=new StreamWriter(publicinfo,true,UTF8Encoding.UTF8);
one.Write(publickey);
StreamWriter two=new StreamWriter(privateinfo,true,UTF8Encoding.UTF8);
two.Write(privatekey);
one.Flush();
two.Flush();
one.Close();
two.Close();
MessageBox.Show("成功保存公匙和密匙!");
}
//用公匙加密
private void button4_Click(object sender, System.EventArgs e)
{
crypt=new RSACryptoServiceProvider();
UTF8Encoding enc=new UTF8Encoding();
bytes=enc.GetBytes(textBox1.Text);
crypt.FromXmlString( readpublickey );
bytes = crypt.Encrypt( bytes,false );
string encryttext=enc.GetString(bytes);//encryptbyte);
richtext2.Text="加密结果:\n"+encryttext+"\n"+"加密结束!";
} private void button5_Click(object sender, System.EventArgs e)
{
UTF8Encoding enc=new UTF8Encoding();
byte [] decryptbyte;
crypt.FromXmlString ( readprivatekey ) ;
decryptbyte = crypt.Decrypt( bytes,false );
string decrypttext=enc.GetString( decryptbyte );
richtext3.Text = "解密结果:\n" + decrypttext + "\n" + "解密结束!" ;
}
//从文件中读取公匙信息
private void button7_Click(object sender, System.EventArgs e)
{
StreamReader sr ;
open = new OpenFileDialog( );
open.Filter="Text File (*.txt)|*.txt|All File (*.*)|*.* ";
// open.ShowDialog();
if(open.ShowDialog()==DialogResult.OK)
{
sr = new StreamReader(open.FileName,UTF8Encoding.UTF8);
}
else
{
MessageBox.Show("发生错误!");
return;
}
readpublickey = sr.ReadToEnd();
sr.Close();
}
//从文件中读取私匙信息
private void button8_Click(object sender, System.EventArgs e)
{
open = new OpenFileDialog( );
open.Filter="Text File (*.txt)|*.txt|All File (*.*)|*.* ";
open.ShowDialog();
StreamReader sr = new StreamReader(open.FileName,UTF8Encoding.UTF8);
readprivatekey = sr.ReadToEnd();
sr.Close();
}