Can somebody give me the equivalent code in JCE for the given C# AES code below?
(Ofcourse, I checked this topic
http://forum.java.sun.com/thread.jspa?threadID=603209
as well, but couldn't figure out much; I have
little knowledge in this area; I've a job to figure out an equivalent code for
this and use it in JSP.)
Thanks,
RK.
byte[] bytesToEncrypt = ASCIIEncoding.ASCII.GetBytes(stringToEncrypt);
//RijndaelManaged uses AES and defaults to CBC mode
RijndaelManaged rij = new RijndaelManaged();
rij.KeySize = 128;
ICryptoTransform encryptor = rij.CreateEncryptor(
Convert.FromBase64String("7inEMafSQqaSANhMe92Gdw=="), initializationVectorBytes );
byte[] encryptedBytes = encryptor.TransformFinalBlock(bytesToEncrypt, 0, bytesToEncrypt.Length);