Click here to Skip to main content
15,886,963 members
Home / Discussions / ASP.NET
   

ASP.NET

 
QuestionHash/Salt question Pin
Member 1395350318-Aug-18 4:14
Member 1395350318-Aug-18 4:14 
AnswerRe: Hash/Salt question Pin
jkirkerx18-Aug-18 8:23
professionaljkirkerx18-Aug-18 8:23 
GeneralRe: Hash/Salt question Pin
Member 1395350318-Aug-18 11:05
Member 1395350318-Aug-18 11:05 
GeneralRe: Hash/Salt question Pin
jkirkerx18-Aug-18 12:59
professionaljkirkerx18-Aug-18 12:59 
GeneralRe: Hash/Salt question Pin
Member 1395350318-Aug-18 17:56
Member 1395350318-Aug-18 17:56 
AnswerRe: Hash/Salt question Pin
Vincent Maverick Durano21-Aug-18 10:13
professionalVincent Maverick Durano21-Aug-18 10:13 
GeneralRe: Hash/Salt question Pin
Member 1395350321-Aug-18 10:50
Member 1395350321-Aug-18 10:50 
GeneralRe: Hash/Salt question Pin
Vincent Maverick Durano21-Aug-18 11:05
professionalVincent Maverick Durano21-Aug-18 11:05 
You don't need to store the salt anymore in your database as the returned value of the Crypto.HashPassword already has a Salt on it.

VB
Dim hashedPassword = Crypto.HashPassword(password)


For example, the variable hashedPassword already contains the Hash + Salt

So your code would now be something like:

VB
Private Sub CreateAccount(ByVal username As String, ByVal password As String, ByVal email As String)
         Dim hashedPassword = Crypto.HashPassword(password)
         Using connection As New OleDbConnection("connectionString")

	 Dim Sql As String = "INSERT INTO university (username,strEmail,hashed) VALUES (@username,@strEmail,@hashed)"

            Dim cmd As New OleDbCommand(Sql)
            cmd.Connection = connection

            cmd.Parameters.AddWithValue("@username", username)
            cmd.Parameters.AddWithValue("@strEmail", email)
            cmd.Parameters.AddWithValue("@hashed", hashedPassword)
            connection.Open()
            cmd.ExecuteNonQuery()

        End Using
End Sub

Private Sub BtnReg_Click(sender As Object, e As EventArgs) Handles BtnReg.Click 
	'Do some forms validation here
	CreateAccount(username.Text,password.Text,strEmail.Text)
End Sub



PS: My apology as I'm not good at VB.NET Wink | ;)
GeneralRe: Hash/Salt question Pin
Member 1395350321-Aug-18 22:07
Member 1395350321-Aug-18 22:07 
GeneralRe: Hash/Salt question Pin
Richard Deeming22-Aug-18 3:03
mveRichard Deeming22-Aug-18 3:03 
GeneralRe: Hash/Salt question Pin
Vincent Maverick Durano22-Aug-18 3:12
professionalVincent Maverick Durano22-Aug-18 3:12 
Questionhow to hold browsing path in fileupload control(i want to choose my choice folder) & How to get uploaded file path ,while click on show in folder(Show in Folder)? Pin
BNB-GOWD16-Aug-18 7:58
BNB-GOWD16-Aug-18 7:58 
AnswerRe: how to hold browsing path in fileupload control(i want to choose my choice folder) & How to get uploaded file path ,while click on show in folder(Show in Folder)? Pin
F-ES Sitecore16-Aug-18 22:17
professionalF-ES Sitecore16-Aug-18 22:17 
Question.Net Core Dependency Injection, How to architect it, do I need it? Email Queues. Pin
jkirkerx15-Aug-18 8:11
professionaljkirkerx15-Aug-18 8:11 
AnswerRe: .Net Core Dependency Injection, How to architect it, do I need it? Email Queues. Pin
F Margueirat23-Aug-18 8:18
F Margueirat23-Aug-18 8:18 
QuestionHow to manage a combined role + organization security in MVC? Pin
F Margueirat15-Aug-18 4:34
F Margueirat15-Aug-18 4:34 
AnswerRe: How to manage a combined role + organization security in MVC? Pin
jkirkerx15-Aug-18 8:35
professionaljkirkerx15-Aug-18 8:35 
GeneralRe: How to manage a combined role + organization security in MVC? Pin
F Margueirat20-Aug-18 7:00
F Margueirat20-Aug-18 7:00 
GeneralRe: How to manage a combined role + organization security in MVC? Pin
jkirkerx20-Aug-18 7:23
professionaljkirkerx20-Aug-18 7:23 
QuestionBrowser Security Pin
saurabh.15in14-Aug-18 3:39
saurabh.15in14-Aug-18 3:39 
AnswerRe: Browser Security Pin
Richard Deeming14-Aug-18 4:15
mveRichard Deeming14-Aug-18 4:15 
GeneralRe: Browser Security Pin
saurabh.15in15-Aug-18 21:28
saurabh.15in15-Aug-18 21:28 
QuestionI am getting the following error in my Production Server: Error Message: The communication object, System.ServiceModel.Channels.ServiceChannel, cannot be used for communication because it is in the Faulted state. Pin
indian14313-Aug-18 7:59
indian14313-Aug-18 7:59 
AnswerRe: I am getting the following error in my Production Server: Error Message: The communication object, System.ServiceModel.Channels.ServiceChannel, cannot be used for communication because it is in the Faulted state. Pin
Richard Deeming13-Aug-18 8:10
mveRichard Deeming13-Aug-18 8:10 
QuestionAsp.Net Core 2.1 with Angular 6 inside, Angular 6 service adding record using .net controller, what to return?, and use of MongoDB with auto increment Pin
jkirkerx13-Aug-18 7:58
professionaljkirkerx13-Aug-18 7:58 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.