B4J Question decrypted string under b4i longer than under b4a and b4j

schimanski

Well-Known Member
Licensed User
Longtime User
I have mentioned, that the decrypted string under b4i with the following code is longer than the decrypted-string under b4a and b4j. For example, I encrypt "70100" and the decrypt string in the log is "70100□□□□□□□□□□□".

If I copy the string out of the log-screen, I only get the 70100, but the length of the decrypted string is 16, not 5. This porblem does only exists, if I decrypt in b4i. Does anybody knows, why the string is filled up with a sign like that "□"?

Thanks for help....

B4X:
'Verschlüsselung der Zeichenkette mit AES, dann die verschlüsselten Bytes in Base64-String wandeln und anschliessend diesen String in ein URL-Format wandeln'
Sub encrypt(Zeichenkette As String) As String
    Return su.EncodeUrl(su.encodeBase64(Cipher.Encrypt(Zeichenkette.GetBytes("UTF8"), Password)), "UTF8")
End Sub

'Den URL-String wieder dekodieren, anschliessend die Base64-Zeichenkette in Bytes wandeln und dann entschlüsseln. Die entschlüsselten Bytes wieder in einen String wandeln und zurück geben'
Sub decrypt (Zeichenkette As String) As String
    Return bc.StringFromBytes(Cipher.Decrypt(su.DecodeBase64(su.DecodeUrl(Zeichenkette, "UTF8")), Password),"UTF8")
End Sub
 
Top