'Code module
Sub Process_Globals
'These global variables will be declared once when the application starts.
'Public variables can be accessed from all modules.
Public App As Application
Public NavControl As NavigationController
Private Page1 As Page
Private Button1 As Button
Private myEncript() As Byte
Private StringEncriptada As String
Private Password As String = "fakhfaodfhdf344230oaljfalh" '<= Encryption password
End Sub
Private Sub Application_Start (Nav As NavigationController)
NavControl = Nav
Page1.Initialize("Page1")
Page1.RootPanel.LoadLayout("Pagetest")
Page1.Title = "Page 1"
Page1.RootPanel.Color = Colors.White
NavControl.ShowPage(Page1)
'Encrypt
Dim PlainText As String="This is a encryption test..." '<== String to encryption
Dim myCipher As Cipher
Dim bc As ByteConverter
Dim myArray() As Byte=bc.StringToBytes(PlainText,"ISO-8859-1")
myEncript = myCipher.Encrypt(myArray ,Password)
Dim bc As ByteConverter
StringEncriptada=bc.StringFromBytes(myEncript,"ISO-8859-1")
End Sub
Sub Button1_Click
'Decrypt
Dim myCipher As Cipher
Dim PlainText1 As String
Dim Bc As ByteConverter
Dim myArray() As Byte=Bc.StringToBytes(StringEncriptada,"ISO-8859-1")
PlainText1 = Bc.StringFromBytes(myCipher.Decrypt(myArray, Password), "ISO-8859-1")
Log("Decripted=" & PlainText1)
End Sub