Android Question sha1(md5(string))

sorex

Expert
Licensed User
sha1 is also common, especially in data connection encryptions.

worst case you send as MD5 and do the extra SHA1 on the php side
 

sorex

Expert
Licensed User
I don't know if B4A supports both of them, you'll need to search for it.
 

Douglas Farias

Expert
Licensed User
Done i made it. if help someone its here xD
B4X:
    Private pi As String
    pi = "laleqwe"
    Dim md As MessageDigest
    Dim ByteCon As ByteConverter
    Dim passwordhash() As Byte
    Dim passwordhash2() As Byte
    passwordhash = md.GetMessageDigest(pi.GetBytes("UTF8"),"MD5")
    Dim md5string As String
    md5string = ByteCon.HexFromBytes(passwordhash)
    Log(md5string)
    passwordhash2 = md.GetMessageDigest(md5string.GetBytes("UTF8"),"SHA-1")
    Dim SHA1string As String
    SHA1string = ByteCon.HexFromBytes(passwordhash2)
    Log(SHA1string)
 

sorex

Expert
Licensed User
you see that the search is powerfull enough to find what you need (in most case)
 

Douglas Farias

Expert
Licensed User
opss
B4X:
    Private pi As String
    pi = "laleqwe"
    Dim md As MessageDigest
    Dim ByteCon As ByteConverter
    Dim passwordhash() As Byte
    Dim passwordhash2() As Byte
    passwordhash = md.GetMessageDigest(pi.GetBytes("UTF8"),"MD5")
    Dim md5string As String
    md5string = ByteCon.HexFromBytes(passwordhash)
    md5string = md5string.ToLowerCase
    Log(md5string)
    passwordhash2 = md.GetMessageDigest(md5string.GetBytes("UTF8"),"SHA-1")
    Dim SHA1string As String
    SHA1string = ByteCon.HexFromBytes(passwordhash2)
    SHA1string = SHA1string.ToLowerCase
    Log(SHA1string)
here is the code correct need convert to lower case *-*
 
Top