SHA-256 is actually a hashing algorithm, not Encryption. I think i have SHA256 method in my Encryption.bas in Web API 2 optional modules. In future I will rename my module as Hashing.
B4X:
Public Sub SHA256 (str As String) As String
Dim data() As Byte
Dim MD As MessageDigest
Dim BC As ByteConverter
data = BC.StringToBytes(str, "UTF8")
data = MD.GetMessageDigest(data, "SHA-256")
Return BC.HexFromBytes(data).ToLowerCase
End Sub
SHA-256 is actually a hashing algorithm, not Encryption. I think i have SHA256 method in my Encryption.bas in Web API 2 optional modules. In future I will rename my module as Hashing.
B4X:
Public Sub SHA256 (str As String) As String
Dim data() As Byte
Dim MD As MessageDigest
Dim BC As ByteConverter
data = BC.StringToBytes(str, "UTF8")
data = MD.GetMessageDigest(data, "SHA-256")
Return BC.HexFromBytes(data).ToLowerCase
End Sub
Here's a library that, for the moment, can perform Base64 encoding and decoding and symmetric algorithm encryption and decryption. Tested symmetric algorithms are DES, Triple DES and AES (Rijndael). As the Java encryption rountines are all byte array oriented you will need my ByteConverter...
Public Sub Encryption (Text As String, Algorithm As String) As String
Dim MD As MessageDigest, BC As ByteConverter
Dim Data() As Byte = MD.GetMessageDigest(BC.StringToBytes(Text, "UTF8"), Algorithm)
Return BC.HexFromBytes(Data).ToLowerCase
End Sub
Online MD5 Encrypt/Decrypt is a free tool for encrypting and decrypting MD5 hashes. MD5 encryption function is irreversible, that means there is no direct method for MD5 decryption. Trial & error method is used for MD5 decryption. Millions of trials are made for cracking MD5 hashes.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.