magoneitor / crypto-js

Automatically exported from code.google.com/p/crypto-js
0 stars 0 forks source link

AES encrypted string to be converted to base 64 string and then to byte array in Javascript #132

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Hi,

I am new to JavaScript. I am encrypting a form using AES in JavaScript and when 
I try to convert the encrypted string to base64 string, i get null string. From 
base64 string, I need to convert to byte array which is the type for my 
webmethod.

Please help me on this. Following is the code i tried so far.

var randomKey='12345'
var 
encryptedString=CryptoJS.AES.encrypt(JSON.stringify(CurrentModel.serialize()).ra
mdomKey); //CurrentModel is the model from MVC
console.log(encryptedString); //outputs string
console.log($.base64.encode(encryptedString)); //null string

Original issue reported on code.google.com by sasirekh...@gmail.com on 28 May 2014 at 6:52