B4J Question [ B4XEncryption ] Problem in Encrypt

Waldemar Lima

Well-Known Member
Licensed User
hello everyone !
i am trying to create a cyphered string, but show this error messages >
B4X:
B4J Version: 9.30
Parsing code.    (0.00s)
    Java Version: 8
Building folders structure.    (0.01s)
Compiling code.    (0.00s)
Compiling layouts code.    (0.00s)
Organizing libraries.    (0.00s)
Compiling generated Java code.    Error
B4J line: 33
token = crypt.Encrypt(Data,\
javac 1.8.0_311
src\b4j\example\main.java:77: error: no suitable method found for NumberToString(byte[])
_token = BA.NumberToString(_crypt.Encrypt(_data,"buc374"));
           ^
    method BA.NumberToString(double) is not applicable
      (argument mismatch; byte[] cannot be converted to double)
    method BA.NumberToString(float) is not applicable
      (argument mismatch; byte[] cannot be converted to float)
    method BA.NumberToString(int) is not applicable
      (argument mismatch; byte[] cannot be converted to int)
    method BA.NumberToString(long) is not applicable
      (argument mismatch; byte[] cannot be converted to long)
    method BA.NumberToString(Number) is not applicable
      (argument mismatch; byte[] cannot be converted to Number)
1 error

code used >
B4X:
#Region  Project Attributes
    #MainFormWidth: 800
    #MainFormHeight: 600
    #AdditionalJar: bcprov-ext-jdk15to18-170
    #AdditionalJar: bcprov-jdk15on-154
#End Region

Sub AppStart (Form1 As Form, Args() As String)
.....
    Dim Data() As Byte
    Data = auth.GetBytes("UTF8")
    
    token = crypt.Encrypt(Data,"buc374")
end sub

how can i fix it ?
 
Top