You can use this B4J program (non-UI) to encrypt the string:
B4X:
#Region Project Attributes
#AdditionalJar: bcprov-jdk15on-150
#End Region
Sub Process_Globals
End Sub
Sub AppStart (Args() As String)
ObfuscateString("innocent looking string", "string that you want to obfuscate")
End Sub
Sub ObfuscateString(key As String, str As String)
Dim e As B4XCipher
Dim bc As ByteConverter
Log(bc.HexFromBytes(e.Encrypt(str.GetBytes("UTF8"), key)))
End Sub
It will log the output. Right click on it and copy it to your B4i program. You can decrypt it with:
B4X:
Public Sub ds(key As String, raw As String) As String
Dim c As Cipher
Dim bc As ByteConverter
Return bc.StringFromBytes(c.Decrypt(bc.HexToBytes(raw), key), "utf8")
End Sub
You can use this B4J program (non-UI) to encrypt the string:
B4X:
#Region Project Attributes
#AdditionalJar: bcprov-jdk15on-150
#End Region
Sub Process_Globals
End Sub
Sub AppStart (Args() As String)
ObfuscateString("innocent looking string", "string that you want to obfuscate")
End Sub
Sub ObfuscateString(key As String, str As String)
Dim e As B4XCipher
Dim bc As ByteConverter
Log(bc.HexFromBytes(e.Encrypt(str.GetBytes("UTF8"), key)))
End Sub
It will log the output. Right click on it and copy it to your B4i program. You can decrypt it with:
B4X:
Public Sub ds(key As String, raw As String) As String
Dim c As Cipher
Dim bc As ByteConverter
Return bc.StringFromBytes(c.Decrypt(bc.HexToBytes(raw), key), "utf8")
End Sub
when I paste my encrypted string with key into b4i , I get in the logs some squares at the end of the url and it gives unspported url error at httpjob.
Public Sub ds(key As String, raw As String) As String
Dim c As Cipher
Dim b() As Byte = c.Decrypt(bc.HexToBytes(raw), key)
Dim s As String = BytesToString(b, 0, b.Length, "utf8")
Dim i As Int = s.IndexOf(Chr(0))
If i > -1 Then s = s.SubString2(0, i)
Return s
End Sub
Public Sub ds(key As String, raw As String) As String
Dim c As Cipher
Dim b() As Byte = c.Decrypt(bc.HexToBytes(raw), key)
Dim s As String = BytesToString(b, 0, b.Length, "utf8")
Dim i As Int = s.IndexOf(Chr(0))
If i > -1 Then s = s.SubString2(0, i)
Return s
End Sub