Hi there,
I'm now getting to some of the meatier parts of my app... and some of the 'dark arts' of encryption and passing passwords from an app to the web server...
In order to login, I hope to replicate what I do in the PHP part of the application - Post to a login page with the username and password pair, and then get a token to use through the life of the app.
The password is passed SHA1 encrypted, and I never decrypt it so that the raw value is never transmitted over an open link ... it's only transmitted over an SSL connection (in case you're wondering, the login page is http, however the login will not work if the server detects the login is not on SSL)
I've seen this post, and adapted it by adding in my own custom salt, and only SHA1, however get a different result to the results to the sha1 routine I have on my PHP web app.
Any ideas??
Many thanks,
I'm now getting to some of the meatier parts of my app... and some of the 'dark arts' of encryption and passing passwords from an app to the web server...
In order to login, I hope to replicate what I do in the PHP part of the application - Post to a login page with the username and password pair, and then get a token to use through the life of the app.
The password is passed SHA1 encrypted, and I never decrypt it so that the raw value is never transmitted over an open link ... it's only transmitted over an SSL connection (in case you're wondering, the login page is http, however the login will not work if the server detects the login is not on SSL)
I've seen this post, and adapted it by adding in my own custom salt, and only SHA1, however get a different result to the results to the sha1 routine I have on my PHP web app.
Any ideas??
B4X:
Private pi As String
Dim MyPwdHash() As Byte
Dim MyHash As String
pi = "<<mysalt>>" & "<<users password>>"
MyPwdHash = md.GetMessageDigest(md5string.GetBytes("UTF8"),"SHA-1")
MyHash = ByteCon.HexFromBytes(MyPwdHash)
MyHash = MyHash.ToLowerCase
Log("SHA1: " & MyHash)
Many thanks,