4

I am trying to encrypt data using AES (ECB) .How can i do it .I have tried AES class ,but it does not have an option to set the mode .Is there any other way available ? Any Windows phone AES libraries available which implement ECB mode of operation?

Thanks and Regards

Vaysage

Vaysage
  • 1,326
  • 2
  • 15
  • 30

4 Answers4

3

The answer is: No or at least not with the standard AesManaged class. Silverlight in all its current variants does not support the Mode property and always uses CBC.

AnthonyWJones
  • 187,081
  • 35
  • 232
  • 306
  • Thanks sir . Is there any library available? – Vaysage Feb 16 '11 at 13:07
  • @Vaysage: None that I know of. Since Silverlight does contain a reasonable set of Cryptography functions there isn't a great demand for another library with more bells and whistles. – AnthonyWJones Feb 16 '11 at 13:10
1

I wasn't able to find a free library doing that.

In some projects I had to "fallback" to RijndaelManaged (block size set to 128). It works well if you have to consume webservices in another language (AES + CBC + PKCS5Padding)

It doesn't help if you have a stict requirement for AES (ECB) :/

anael
  • 158
  • 1
  • 8
  • Thanks for trying to help .I got an implementation at [Simple_Cryptographer](http://www.codeproject.com/KB/recipes/Simple_Cryptographer.aspx).And I have ported it to work with byte arrays . – Vaysage Feb 21 '11 at 08:29
1

There is Bouncy Castle port for Silverlight, and it have what you need. If you dont want to recomplilate it for Windows Phone for you own, you can take dll from this place: Awkward Coder Blog

Thaven
  • 1,857
  • 3
  • 19
  • 35
0

However you can. Use IV as zeros and encrypt block by block (16bytes/128bit), not a stream. Every block should have IV filled with zeros and it will mimic ECB.

crea7or
  • 4,421
  • 2
  • 26
  • 37