Reputation: 1356
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
Upvotes: 4
Views: 1525
Reputation: 4490
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.
Upvotes: 0
Reputation: 1897
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
Upvotes: 1
Reputation: 158
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) :/
Upvotes: 1
Reputation: 189439
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.
Upvotes: 3