hi

i want sql query to insert encrypted passwrd ??

foreample if user password : 123456

what is the sql query to insert it incrypted

Recommended Answers

All 7 Replies

Do the encryption inside your application before insertion.

so what is the function ?? how i use it ??

so what is the function ?? how i use it ??

How would I know? You still didn't said which programming language you are using

urtrivedi

thank you i will look

peter_budo

i use asp.net with vb.net

i want vb.net code to encrypt and decrypt password

Member Avatar for Rahul47

You Can Use Base64 Encryption function as follows:

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        TextBox3.Text = Convert.ToBase64String(New System.Text.ASCIIEncoding().GetBytes(TextBox2.Text))
    End Sub

In above example the text of TextBox2 is converted to encrypted and dislayed in TextBox3.
So if you want to add it to database you can do it as follows:

1) Store it in a variable:

Dim encrypt as string
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        encrypt = Convert.ToBase64String(New System.Text.ASCIIEncoding().GetBytes(TextBox2.Text))
    End Sub

2) Now you can use encrypt variable to insert into database.

Thanks,

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.