User Tag List

Results 1 to 3 of 3

Thread: [VB.net] MD5 Encryption

  1. #1
    [VB.net] MD5 Encryption

    User Info Menu

    [VB.net] MD5 Encryption

    Well I have been working on a project for work and I realized that I had to use some sort of encryption for passwords when an administrator creates an account. So I turned to MD5 since it was really the first thing that popped into my head.

    Funny thing is it's so simple to do and in this topic I'll cover encrypting and authenticating.

    So you need to make an import statement for cryptography:

    Code:
    Imports System.Security.Cryptography
    Next we need to Dimension some variables:

    Code:
    Dim md5Hasher As New MD5CryptoServiceProvider()
    
    Dim hashedPassword As Byte()
    
    Dim encoder As New UTF8Encoding()
    This next chunk will actually salt the password. Now I used a static string for salting, normally you would using something like a login or even their ID

    Code:
    hashedBytes = md5Hasher.ComputeHash(encoder.GetBytes(txt_password.Text & "idk"))
    And that's all there is to encrypting a password. Now to authenticate it you basically run through the encryption again and do a string comparison. If they are the same you can continue on, if not go back and start over. This was mainly done for a web app I am doing and alot of it I can't exactly post.

  2. #2
    [VB.net] MD5 Encryption

    User Info Menu

    Re: [VB.net] MD5 Encryption

    Sha1 ftw

    Rules are HERE. They have been updated as of May 30th 2013 at 5:00 A.M.
    If you see a topic that a link is broken, the information is no longer correct, the content has been patched, or a rule is being broken please use the button. Thanks.

  3. #3
    [VB.net] MD5 Encryption

    User Info Menu

    Re: [VB.net] MD5 Encryption

    md5 is not a encryption it's a hash

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •