Sub EncryptText(text As String, password As String) As Byte()
Dim c As B4XCipher
Return c.Encrypt(text.GetBytes("utf8"), password)
End Sub
Sub DecryptText(EncryptedData() As Byte, password As String) As String
Dim c As B4XCipher
Dim b() As Byte = c.Decrypt(EncryptedData, password)
Return BytesToString(b, 0, b.Length, "utf8")
End Sub
Dim encryptedData() As Byte = EncryptText("confidential", "123456")
Log(DecryptText(encryptedData, "123456"))