Please note that I am trying to perform the above, but have been unsuccessful thus far. Here is some of my code:
import com.hurlant.crypto.symmetric.AESKey;
import com.hurlant.crypto.symmetric.DESKey;
import com.hurlant.util.Hex;
import com.hurlant.crypto.symmetric.IPad;
import com.hurlant.crypto.symmetric.ICipher;
import com.hurlant.crypto.symmetric.IVMode;
import com.hurlant.crypto.symmetric.NullPad;
import com.hurlant.crypto.Crypto;
import com.hurlant.util.Base64;
private function stopTimer():void {
var logData:Object = new Object();
JSLog.debug("stopTimer()", logData);
t.stop();
timerAtPause = hrs * 3600000 + min * 60000 + sec * 1000 + mls;
var encryptedSession = encrypt("MyApp");
var encryptedTime = encrypt(timerAtPause.toString());
url += encryptedSession;
url += "&hometime=";
url += encryptedTime;
JSLog.info("stopTimer() url: " + url, logData);
navigateToURL(new URLRequest(url), "_self");
JSLog.info("stopTimer(): navigating to url", logData);
timerAtPause = 0;
timerAtStart = 0;
hrs = 0;
min = 0;
sec = 0;
mls = 0;
}
private function encrypt(input:String):String
{
var logData:Object = new Object();
JSLog.debug("encrypt()", logData);
JSLog.debug("encrypt() input string: " + input, logData);
var decrKey:String = new String("1234567890123456");
// byte[] iv = { 20, 92, 88, 20, 46, 89, 25, 19 };
var iv:ByteArray = new ByteArray();
iv.writeUnsignedInt(20);
iv.writeUnsignedInt(92);
iv.writeUnsignedInt(88);
iv.writeUnsignedInt(20);
iv.writeUnsignedInt(46);
iv.writeUnsignedInt(89);
iv.writeUnsignedInt(25);
iv.writeUnsignedInt(19);
var decrIV:String = iv.readUTF();
var inputBA:ByteArray=Hex.toArray(Hex.fromString(input));
var key:ByteArray = Hex.toArray(Hex.fromString(decrKey));
var pad:IPad = new NullPad();
var aes:ICipher = Crypto.getCipher("aes-cbc", key, pad);
var ivmode:IVMode = aes as IVMode;
ivmode.IV = Hex.toArray(Hex.fromString(decrIV));
aes.encrypt(inputBA);
JSLog.debug("encrypt(): end", logData);
return Base64.encodeByteArray( inputBA);
}
According to the logs, it is entering encrypt(input:String) function, but it doesn't make it to the end.
Successfully connected to the listen only stream. {"user":{"username":"Roger","userId":"eamwek7flvos_2","externalMeetingId":"HomeEdu","meetingName":"HomeEdu","meetingId":"a1d63a1fb90b422ecce953b3302b6e521f96df8c-1475379236141"}}
bbblogger.js?v=VERSION:23 stopTimer() {}
bbblogger.js?v=VERSION:23 encrypt() {}
bbblogger.js?v=VERSION:23 encrypt() input string: HomeEdu {}
Does anyone have any idea why this is so? Does anyone have any suggestions? TIA.