I have some JSON data that I need to encrypt before sending it to the client side. I can encrypt the data using pycrpto like this:
from Crypto.Cipher import AES
key = '0123456789abcdef'
mode = AES.MODE_CBC
encryptor = AES.new(key, mode)
text = jsonData
ciphertext = encryptor.encrypt(text)
And then I can send it to the client side. Now I need to use jQuery/Javascript to convert the ciphertext to plain text. jsaes is an implementation of AES in Javascript. Can it be used to decrypt data back to plain text? Or is there any other library I can use to complete this task?