Hi,
We are doing AES encryption of username & password for login transaction. We have written a custom code outside the scenario where we have defined a constant value(1001 & 123). Now, we want to parameterize those values by using csv file, how can we achieve that here ?
Encryption code:-
val text1toEncrypt = “1001”
val text2ToEncrypt = “123”
val secret = “secretkey”
val IvParameterSpec = “Ivparamspec”
val cipher = Cipher.getInstance(“AES/CBC/PKCS5Padding”, “SunJCE”)
val key = new SecretKeySpec(secret.getBytes(“UTF-8”), “AES”)
val IvParameterSpec1 = new IvParameterSpec(IvParameterSpec.getBytes(“UTF-8”))
cipher.init(Cipher.ENCRYPT_MODE, key, IvParameterSpec1 )
println(“Chithra”+cipher)
def uname = cipher.doFinal(text1toEncrypt.getBytes(“UTF-8”))
def pass = cipher.doFinal(text2ToEncrypt.getBytes(“UTF-8”))
def Username = Base64.getEncoder.encodeToString(uname)
def Password = Base64.getEncoder.encodeToString(pass)
println(“Final_username” + Username)
println(“Final_password” + Password)
private val scn = scenario(“MHC”)
Please help us on urgent basis.