Hello all,
I'm new to this forum and very excited to be here. I hope to learn as much as I can, and share my knowledge with you all as well
.
My question is:
I have been developing a small console applications with a very simple purpose.
To avoid a lengthy explanation I have included a screen shot to make it easier for everyone.
http://www.4rhymes.com/app1.jpg
As you can see, what I'm trying to do is allow a user to specify a username they want, followed by a password of their choice. Upon clicking "Encrypt Password", I want the program to hash the txtPassword string using SHA1 and then encode that using base 64. Once it has done so, clicking on "Write To File" will simply store both the username and password to an external file. I have no problem with the write button, but the encrypt button is giving me a very hard time. I would appreciate anyone's help!!
Here's what I got so far. I don't know if this is even remotely correct. But it's a start I guess.....
Dim myString As String = txtPassword.Text
Dim Data As Byte()
Data = Encoding.ASCII.GetBytes(myString)
Dim shaM As New SHA1Managed()
Dim resultHash As Byte() = shaM.ComputeHash(Data)
Dim resultHexString = txtPassword.Text
Dim b As Byte
For Each b In resultHash
resultHexString += Hex(b)
Next
Thank you all for your help! I really appreciate it!!
I'm new to this forum and very excited to be here. I hope to learn as much as I can, and share my knowledge with you all as well
My question is:
I have been developing a small console applications with a very simple purpose.
To avoid a lengthy explanation I have included a screen shot to make it easier for everyone.
http://www.4rhymes.com/app1.jpg
As you can see, what I'm trying to do is allow a user to specify a username they want, followed by a password of their choice. Upon clicking "Encrypt Password", I want the program to hash the txtPassword string using SHA1 and then encode that using base 64. Once it has done so, clicking on "Write To File" will simply store both the username and password to an external file. I have no problem with the write button, but the encrypt button is giving me a very hard time. I would appreciate anyone's help!!
Here's what I got so far. I don't know if this is even remotely correct. But it's a start I guess.....
Dim myString As String = txtPassword.Text
Dim Data As Byte()
Data = Encoding.ASCII.GetBytes(myString)
Dim shaM As New SHA1Managed()
Dim resultHash As Byte() = shaM.ComputeHash(Data)
Dim resultHexString = txtPassword.Text
Dim b As Byte
For Each b In resultHash
resultHexString += Hex(b)
Next
Thank you all for your help! I really appreciate it!!