本文介绍了如何显示加密的图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我需要示例程序来显示加密的图像,请帮助我
这是用于加密的代码.但是我收到了诸如密钥在指定状态下无效"之类的错误消息
Hi,I am in need of sample program to display the encrypted image ,someone pls help me
This is the code for encryption.But I got a error like "key not valid for use in specified state"
byte[] img = imagetobyte(pictureBox1.Image);
RSAParameters rsaPubParams;
RSAParameters rsaPrivateParams;
RSACryptoServiceProvider rsaCSP = new RSACryptoServiceProvider();
//Generate public and private key data.
rsaPrivateParams = rsaCSP.ExportParameters(true);
rsaPubParams = rsaCSP.ExportParameters(false);
rsaCSP.ImportParameters(rsaPubParams);
byte[] output=new byte[13000000];
output = rsaCSP.Encrypt(img,false);
pictureBox2.Image = byteArrayToImage(output);
如何纠正?
在问题本身中添加了用户注释[/edit]
how to rectify it?
Added the user comments to the question itself[/edit]
推荐答案
这篇关于如何显示加密的图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!