I have a C# application required to calculate token same as JavaScript below:
key = CryptoJS.enc.Hex.parse("436574536f667445454d537973576562");
iv = CryptoJS.enc.Hex.parse("1934577290ABCDEF1264147890ACAE45");
text ={userID: 0,tokenTime:'2017-05-06 19:20:22'};
text=JSON.stringify(text);
token=CryptoJS.AES.encrypt(text,key,{iv:iv}).toString();
token=9L9qY0fmi3Riysac3YbIciIIJFisPZZC3uBxjriVH1OyARL2ZQ/HVO941/Tod2PT
(JavaScript can not be change)
But,I am confuse by what is include in string "token"?
only ciphertext or whole result of encryption in string?
And,how to convert format of key and iv for CryptoJS to a format which accepted by C#(RijndaelManaged or AesCryptoServiceProvider)?
Most of the question and answer using "CryptoJS.enc.utf8.parse",so I try to convert key and iv from hex to utf-8 ,but only key can be converted.