Hi to all
I have this code in a Static code module
It's wrong this code?
because when compiling in debugging show this error
Error in Sub Decrypt
Thanks
I have this code in a Static code module
B4X:
'Static code module
Sub Process_Globals
Private fx As JFX
Private C As B4XCipher
Private str1 As String = "hgt34q"
Private str2 As String = "M5z23t"
Private str3 As String = "N1eDs9"
Dim bc As ByteConverter
Private pw As String
End Sub
Sub Crypta(dato As String) As String
pw = str1 & str2 & str3
Return bc.StringFromBytes(C.Encrypt(bc.StringToBytes(dato, "UTF8"), pw), "UTF8")
End Sub
Sub Decrypt(dato As String) As String
pw = str1 & str2 & str3
Return bc.StringFromBytes(C.Decrypt(bc.StringToBytes(dato, "UTF8"), pw), "UTF8")
End Sub
It's wrong this code?
because when compiling in debugging show this error
B4X:
B4J Version: 5.90
Parsing code. (0.10s)
Compiling code. (0.27s)
Compiling layouts code. (0.03s)
Organizing libraries. (0.00s)
Compiling generated Java code. Error
B4J line: 20
Return bc.StringFromBytes(C.Decrypt(bc.StringToBy
javac 1.8.0_121
src\b4j\Test\cryptencrypt.java:65: error: cannot access DataLengthException
if (true) return _bc.StringFromBytes(_c.Decrypt(_bc.StringToBytes(_dato,"UTF8"),_pw),"UTF8");
^
class file for org.bouncycastle.crypto.DataLengthException not found
1 error
Error in Sub Decrypt
Thanks