Dim keyBytes As Byte() = System.Text.Encoding.UTF8.GetBytes(SecretKey)
Dim hashBytes As Byte() = System.Convert.FromBase64String(InputHash)
Dim aes As System.Security.Cryptography.Aes = System.Security.Cryptography.Aes.Create()
aes.Key = keyBytes
aes.GenerateIV()
Dim decryptor As System.Security.Cryptography.ICryptoTransform = aes.CreateDecryptor()
Dim plainTextBytes As Byte() = New Byte(hashBytes.Length - 1) {}
Using ms As New System.IO.MemoryStream(hashBytes)
Using cs As New System.Security.Cryptography.CryptoStream(ms, decryptor, System.Security.Cryptography.CryptoStreamMode.Read)
cs.Read(plainTextBytes, 0, plainTextBytes.Length)
End Using
End Using
plainText = System.Text.Encoding.UTF8.GetString(plainTextBytes)
Hi @Anil_G can you provide me sample input that needs to be given for input hash argument
because whatever the hash code i am giving is throwing below error. As i cannot provide my organization data here, requesting you to provide me sample input if possible.
First of confirm which encoding is being used I am using UTF-8 as you can see…while generating if the encoding is different for that then we need to change that parameter accordingly
I am not pretty sure which encoding they’ve used because it is directly coming from a website when we download the particular file. So giving you sample hash code may be if you can analyze which encoding they’ve did.
Note: I’ve removed some of the length of this below string for security purposes, it was somewhat lengthy hash string than shown image.
Let me know if you can able to identify else i will have a word with my team.