How do I encrypt text to an MD5 hash in VB.NET? -
this question has answer here:
- hash md5 in vb.net 3 answers
i want calculate md5 hash of richtextbox1.text
. i've added line of code @ top can use md5 encryption method: imports system.security.cryptography
. how go calculating hash?
the process described here.
the basic code link is:
dim bytes() byte dim sb new stringbuilder() bytes = encoding.default.getbytes(richtextbox1.text) 'get md5 hash bytes = md5.create().computehash(bytes) 'loop though byte array , convert each byte hex. x integer = 0 bytes.length - 1 sb.append(bytes(x).tostring("x2")) next 'return md5 hash. return sb.tostring()
Comments
Post a Comment