2 Replies - 127 Views - Last Post: 30 November 2018 - 10:31 AM Rate Topic: -----

#1 aspfun   User is offline

  • D.I.C Head

Reputation: 1
  • View blog
  • Posts: 103
  • Joined: 16-January 13

Input key to hash password

Posted 30 November 2018 - 09:52 AM

I used code below to hash password.

How to input key to hash, using letter or number?

Public Shared Function Encrypt(ByVal stringToEncrypt As String, ByVal key As String) As String
DES.Key = MD5Hash(key)
DES.Mode = CipherMode.ECB
Dim Buffer As Byte() = ASCIIEncoding.ASCII.GetBytes(stringToEncrypt)
Return Convert.ToBase64String(DES.CreateEncryptor().TransformFinalBlock(Buffer, 0, Buffer.Length))
End Function


Is This A Good Question/Topic? 0
  • +

Replies To: Input key to hash password

#2 andrewsw   User is offline

  • dependency injected
  • member icon

Reputation: 6668
  • View blog
  • Posts: 27,308
  • Joined: 12-December 12

Re: Input key to hash password

Posted 30 November 2018 - 09:54 AM

Do what? Please take an extra minute or two to clarify your question.
Was This Post Helpful? 0
  • +
  • -

#3 Sheepings   User is offline

  • Senior Programmer
  • member icon

Reputation: 171
  • View blog
  • Posts: 1,025
  • Joined: 05-December 13

Re: Input key to hash password

Posted 30 November 2018 - 10:31 AM

Why are you opting for ECB?

I'm not sure I understand you. If you asking how to run the function

Encrypt("EncryptMe", "IAmTheKey")
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1