Android Question Encrypt a URL php link

yiankos1

Well-Known Member
Licensed User
Longtime User
Hello my friends,
I use at my code a URL php link that is connected to MySQL database at my server.
B4X:
http://xxx.com/test.php?secret=password&id=add&name=test
If someone decompile (dex2jar) my app, he will see that link and the "secret" password and he can use it at bad way. What do you suggest me to do?
 

Siam

Active Member
Licensed User
Longtime User
Hello,

i use this sub:
B4X:
Sub crypt (job As String, data As String) As String
    Dim crypter As Crypter
    Dim crypted As String
    crypter.Initialize("a5d7g8s6a5a6s7d","2342571231")
    If job="crypt" Then
        crypted=crypter.encrypt(data)
     End If
    If job="decrypt" Then
         crypted=crypter.decrypt(data)
    End If
Return crypted

End Sub

to crypt and decrypt the server url this make it harder to find the right url.
but don't forget that a simple sniffer shows the decryptet url.
If you have the option to use a Secure https connection,
then i have mybe a small Library to Protect your app from a Man in The middle Attack.

i Think the better way is :
The other Way is that you build a Php Script who contains the secret Passwort and manage the connection to the MySql DB with this you can filter the the data from the connection.



andy
 
Last edited:
Upvote 0
Top