ARTICLE

Implementation of SHA-256 Cryptography algorithm in VB.NET

Posted by Dea Saddler Articles | Cryptography in VB.NET May 19, 2011
In this article you will learn that how to implement SHA-256 Algorithm for a Login form
Download Files:
 
Reader Level:

Introduction

Here in this article I am explaining that how to implement a login form with the help of SHA-256 Cryptography algorithm. SHA-256 is a standard method for generating digital signature. It is a one way algorithm. The SHA256 algorithm is known as one way encryption, hash or checksum, digest and digital signature algorithm. The SHA core provide implementation of cryptographic Hashes SHA-1, SHA-2, SHA-256, SHA-512.


Getting Started

  • Simply create a new windows application. 
  • Drag two TextBox, two Label and one Button control on your form. Your form will look like below.

    SHA256.gif
     
  • Then add the below code.

       
    Private Sub userLogin_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles
            userLogin.Click
            If txtUsername.Text.ToUpper <> "SHALINI" Then
                MessageBox.Show(" showing Error: Username doesn't exists.")
                Exit Sub
            End If
            Dim shaM As New SHA256Managed()
            If shaM.ComputeHash(txtvalidpassword.Text) <> "JUNEJA" Then
                MessageBox.Show("Error: Password doesn't match.")
                Exit Sub
            Else
                MessageBox.Show("Welcome users you are now logged in to the data page.Now you can see all
            information about data!"
    )
            End If
        End
    Sub

     
  • Now run your application.


Output:-

SHA256-1.gif

SHA256-2.gif

SHA256-3.gif

SHA256-4.gif

SHA256-5.gif


Summary

In this article you learned that how to implement SHA-256 algorithm.

Login to add your contents and source code to this article
share this article :
post comment
 
Become a Sponsor
PREMIUM SPONSORS
  • ceTE software specializes in components for dynamic PDF generation and manipulation. The DynamicPDF™ product line allows you to dynamically generate PDF documents, merge PDF documents and new content to existing PDF documents from within your applications.
    ceTE software specializes in components for dynamic PDF generation and manipulation. The DynamicPDF™ product line allows you to dynamically generate PDF documents, merge PDF documents and new content to existing PDF documents from within your applications. Visit DynamicPDF here
Team Foundation Server Hosting
Become a Sponsor