积极答复者
请问wp7中怎样实现3des算法

问题
答案
全部回复
-
你好 在WPF中可以使用Frame,不过在Windows Phone的页面都承载于一个Windows Phone自己的Frame控件里边。
你可以直接添加一个容器控件,根据你的操作,动态的显示/隐藏控件
如果你想要自定义控件,我想可以通过类似于 http://msdn.microsoft.com/en-us/library/ff941103%28v=VS.92%29.aspx 这样的方法来实现,
下面这段代码直接添加在你的UserControls中应该也是可以的(我目前机器上无Windows Phone开发环境无法测试)。不过需要注意 controls这个命名空间,具体你可以参考下Panorama和Pivot的示例代码
<Grid x:Name="LayoutRoot" Background="Transparent"> <!--Pivot Control--> <controls:Pivot Title="MY APPLICATION"> <!--Pivot item one--> <controls:PivotItem Header="item1"> <Grid/> </controls:PivotItem> <!--Pivot item two--> <controls:PivotItem Header="item2"> <Grid/> </controls:PivotItem> </controls:Pivot> </Grid>
Raymond Tang (Microsoft C# MVP)
Denn Ich Gehoer nur mir
微软中文论坛同城社区成都QQ群:74268428
My Chinese Blog
Chengdu,Sichuan Province,China -
不好意思,可以打开的。但是我3des加密长度超过8位就会出现错误:我的代码接口是:
private string TripleDESEncrypt(string plainText)
{
// Create a key
// Random rnd = new Random();
string keyrnd = "123abcdefg123abcdefg6789";
plainText = "123abcdefg123abcdefg6789123abcdefg123abcdefg6789";
//string key = "";
byte[] Key = DESCrytography.CreateTripleDesKey(keyrnd);
ConfigModel.TripleDESKey=Encoding.UTF8.GetString(Key,0,Key.Length);
// Create a buffer of text
// rnd.NextBytes(plainText);
// Encrypt
byte[] cypherText = null;
DESCrytography.TripleDES(Encoding.UTF8.GetBytes(plainText), ref cypherText, Key, true);
string crypherstr = Convert.ToBase64String(cypherText);
return crypherstr;
}不知道需要设置哪些参数,可以改变它的加密解密模式为:DESede/ECB/PKCS5Padding组合模式补位
- 已编辑 阿拉丁de神灯 2011年7月28日 3:28 添加内容
-
今天在做多项数据加密时碰到一个问题. Windows phone 7手机客户端APP向服务器端请求数据 , 服务器端采用HMAC_MD5哈希算法,进行加密数据的匹配. 目前发现Silverlight平台中只支持 System.Security.Cryptography.HMACSHA1和 System.Security.Cryptography.HMACSHA256, 尚未找到HMAC_MD5? 请问Windows phone 7是否支持HMAC_MD5哈希算法?
chenkai.
idea is not born! -
楼主的3DES代码能分享下吗?我的邮箱865688003@qq.com