Since the Shoutcast server protocol Ultravox2.1 requires the XTEA encryption for clients and sources to log in to password protected servers , i decided to write a little lib to make it easier to encrypt and decrypt those strings.
The usage is pretty easy!
The usage is pretty easy!
B4X:
Sub Process_Globals
Dim XT As XTEA
End Sub
Sub CryptSomeStuff()
Dim s As String
'crypt
s=XT.Crypt("lolkey","lolpassword",False)
'decrypt
s=XT.Crypt("lolkey",s,True)
's should be "lolpassword"again
End Sub
Sub XTEACrypt(key As String , s As String )As String
Return XT.Crypt(s,key,False)
End Sub
Sub XTEADecrypt(key As String , s As String )As String
Return XT.Crypt(s,key,True).Trim
End Sub