0
votes

I need a javascript library which can decrypt AES data. I've found some libraries, like:

http://www.movable-type.co.uk/scripts/aes.html

http://point-at-infinity.org/jsaes/

But none of them support a IV key (Initialization Vector).

The reason i need that is because some C#.NET server is sending me data which is encrypted with AES and it also uses a IV key.

Now i need to decrypt that message with Javascript somehow, but couldn't find any library which supports the Initialization Vector. So does anyone know a javascript library which supports this too for decrypting?

1

1 Answers

1
votes

The IV is not strictly a feature of AES. It depends on the mode of operation. The first link only implements CTR mode, and the second doesn't use any mode (it just encrypts one block). You should check what mode is used by your server. If it is CBC, you should be able to implement it over an AES implementation without any problem.

And now for the fun question: why do you have a server encrypting data to send it to JS? It doesn't add any security: JS is always executed in an unsafe environment (cf http://www.matasano.com/articles/javascript-cryptography/ for more information).