在Windows Phone 8 AES加密 [英] AES Encryption in windows phone 8

查看:293
本文介绍了在Windows Phone 8 AES加密的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在我的Windows phone8应用程序中执行AES加密。



我搜索了很多,但无法获得清晰的视图。 p>

任何人都可以给我一个链接,它给出了实现AES加密ni WP8应用程序的明确例子。



do is,



1)我需要将键,初始向量和值作为字符串传递。



2 )需要以AES加密的任何格式加密该字符串,最后需要获取加密后的值作为字符串。



任何人都可以帮助我。



我使用此示例,并为键使用UTF8编码,以及Iv



myAes.Key = Encoding.UTF8.GetBytes(terr!f!cp @ ssw0rdw!thonetw!st!n!t);
myAes.IV = Encoding.UTF8.GetBytes(1234567890987654);



值到字符串am使用ToBase64转换



afterText.Text = Convert.ToBase64String(encrypted);



这里我需要告诉我的后端团队,这里使用的确切的加密,我不知道这里发生了什么,你能告诉我什么是确切的加密发生在这里。



谢谢。

解决方案

CryptographicBuffer Class 是您的朋友:




  • 使用Hex或用于表示为字符串的二进制值的Base64编码。

  • 使用UTF-8转换为字节。

I am trying to do AES Encryption in my windows phone8 app.

I searched a lot, but couldn't get a clear view to do so.

Can anybody give me link that gives the clear example of implementing AES Encryption ni WP8 App.

What i need to do is,

1)I need to pass key, initial vector, and value as strings.

2)need to encrypt that string in any format of AES Encryption, and finally need to get the encrypted value as string.

Can anybody help me.

am using this example and using UTF8 encoding for key, and Iv

myAes.Key = Encoding.UTF8.GetBytes("terr!f!cp@ssw0rdw!thonetw!st!n!t"); myAes.IV = Encoding.UTF8.GetBytes("1234567890987654");

and after encoding to convert the bytes of encrypted value to string am using ToBase64 convertion

afterText.Text = Convert.ToBase64String(encrypted);

here i need to tell my back end team, what the exact encryption am using here, am not sure about what is happening here, Can you please tell me whats that exact encryption happening here.

Thank you.

解决方案

The CryptographicBuffer Class is your friend:

  • Use Hex or Base64 encoding for binary values you want to represent as strings. This includes Key, IV and ciphertext
  • Use UTF-8 for text you want to turn to bytes.

这篇关于在Windows Phone 8 AES加密的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆