ks.encryptString(alias,strtoencrypt)
End Sub
Sub KeyStore_Encrypted(encrypted() As Byte, iv() As Byte, base64 As String)
Log($"KeyStore_Encrypted(${base64},${encrypted.Length},${iv.Length})"$)
' Note to save the iv array to later be able to Decrypt!
Log($"Decrypt using the IV"$)
Dim decrypted As String = ks.decryptString("DonManfred",base64,iv)
Log($"Decrypted: ${decrypted}"$)
End Sub
It is a Event which is raised because i need to return multiple values; not only the encrypted string.
In the event you get the encrypted string AND the iv Vector.
the base 64 is the encryted string. It it up to you to do what you want to do with.
It is the encrypted string converted to base64. You can save it if you want.
Remember to have a copy of the iv used.