Hello!
I have used the following code (crypt.dll) to encrpt and decrypt the items of a csv-file in my basic4ppc app. Is it possible to crypt under b4a with the same algorithmus? Because i want to get both apps (b4ppc and b4a) compatible.
I have used the following code (crypt.dll) to encrpt and decrypt the items of a csv-file in my basic4ppc app. Is it possible to crypt under b4a with the same algorithmus? Because i want to get both apps (b4ppc and b4a) compatible.
B4X:
Sub Encrypt(String1)
PasswortByte()=bitPW.StringToBytes(String1,0,StrLength, String1))
SchluesselByte()=Crypto.Encrypt(Schluessel,PasswortByte())
For i=0 To ArrayLen(SchluesselByte())-1
ss=bitPW.DecToHex(SchluesselByte(i))
If StrLength(ss)<2 Then ss="0" & ss
s=s & ss
Next
PWString=s
End Sub
Sub Decrypt(String1)
y=StrLength(String1)/2
Dim NewArray(y) As Byte
For z=0 To (StrLength(String1)-1
NewArray(z)=bitPW.HexToDec(StrAt(String1,z*2) & StrAt(String1,z*2)+1))
Next
If ArrayLen(NewArray())=0 Then Return
PasswortByte()=Crypto.Decrypt(Schluessel,NewArray())
SchluesselSpeicher=bitPW.BytesToString(PasswortByte(),0,ArrayLen(PasswortByte()))
End Sub