C# Aes Crypto implementation to Javascript RRS feed

  • Question

  • User445938139 posted

    I have a Rijndael based c# code. Which js library should i use? And idea will be helpful.

    Wednesday, December 4, 2019 8:54 AM

All replies

  • User475983607 posted

    JavaScript is plain text in the browser which make your implementation insecure.

    Wednesday, December 4, 2019 2:06 PM
  • User445938139 posted

    Yes, i know. When i solve this problem i will figure it out. 

    Wednesday, December 4, 2019 2:45 PM
  • User475983607 posted


    Yes, i know. When i solve this problem i will figure it out. 

    Figure what out?  Any crypto written in JavaScript is insecure.  Data should be encrypted and decrypted on the server which you have working at this time.

    Wednesday, December 4, 2019 3:29 PM
  • User753101303 posted


    keySize seems different and BlockSize casing wrong for example. Do you have an encrypted value and the value we are supposed to find? If on my own I would try to both encrypt/decrypt in js to see first if I'm consistent on this side and then if it matches what I find on the C# side.

    As pointed already it could be better to make sure you'll really need that before making this to work. You try to protect what ?

    Wednesday, December 4, 2019 3:46 PM
  • User445938139 posted


    as a c# 

    1. my object is encText = {"encText": "sample"}
    2. secret key is "7YIOB9NooY225lP6CRSqKQ0KiluAF/6cYn3kFXvJkS0=";
    3. and my encrpted text is "P+KvsN/m3qOc8egIkqyi4w=="

    just try to protect my data object. So as a javascript side i get ecrypted text and key, try to react decrypted data object.</div>

    Wednesday, December 4, 2019 9:19 PM
  • User753101303 posted

    If over the wire, https does this for you in both direction.

    Wednesday, December 11, 2019 7:40 AM