Here is the specific code that uses the session key and passes it to the server for authentication
a2 = encrypt.AESEncrypt(a2, "<%=(String)session.getAttribute("__GETLOGINKEY")%>", 256);
been stuck in doing the login page for days. appreciate all the help.
This is not the full code, unfortunately we're not able to help you with this very limited one line.
If you need to encrypt the request parameter using AES algorithm and send it I can only suggest using JSR223 PreProcessor for that.
Check out Encryption and decryption with Groovy which contains some code snippets for AES encryption. There is also Apache Groovy: What Is Groovy Used For? article which sheds some light on Groovy scripting in JMeter.
However
session.getAttributelooks like to be a server-side code, I think you should rather take a look at client-side, for example there should be some JavaScript function performing parameters encryption or something like this.