Public Sub EncryptText(text As String) As Byte()
Dim c As B4XCipher
Return c.Encrypt(text.GetBytes("utf8"), "12345")
End Sub
' This sub will send the messaage to the app
Sub Send_Message
Dim msg As String = $"{"Command":"Test", "Message": "Test Message"}"$
msg = BytesToString(EncryptText(msg), 0, EncryptText(msg).Length, "UTF8")
Log("OUT: " & msg) ' this seems to log the encryped message
ws.RunFunction("server_incoming", Array As Object(msg))
ws.Flush
End Sub