Encrypting - Decryption Password SQL Table (1 Viewer)

aron.ridgway

Registered User.
Local time
Today, 22:08
Joined
Apr 1, 2014
Messages
148
Hi There

Just wondering what the best way is to Encrypt and decipher a field in SQL.

Basically i have a User table that has a Password. I want to make this encrypted so the password cannot be viewed.

What is the best way to achieve this?

any help/pointers would be great.
 

CJ_London

Super Moderator
Staff member
Local time
Today, 22:08
Joined
Feb 19, 2013
Messages
16,553
not sure you can encrypt a single field or what the benefit would be.

What you can do is format the field as 'password' which replaces characters with dots as you type.
 

aron.ridgway

Registered User.
Local time
Today, 22:08
Joined
Apr 1, 2014
Messages
148
Its not a single field i want to encrypt all entries made the Password column.

I have the format on text boxes already, but currently if i open the Table in SQL Server management and open the User table the passwords are all visible.

I think what i need is a function that encrypts to hide the value and then deciphers before a password entry to check its correct?
 

aron.ridgway

Registered User.
Local time
Today, 22:08
Joined
Apr 1, 2014
Messages
148
How could i use SQL security by a stored procedure?

After more thought i only want to encrypt the password and when a user types there password it encrypts before checking they match?
 

CJ_London

Super Moderator
Staff member
Local time
Today, 22:08
Joined
Feb 19, 2013
Messages
16,553
Regret I am out of time - need to leave to catch a plane.

I would google 'encryption' to find some solutions
 

gemma-the-husky

Super Moderator
Staff member
Local time
Today, 22:08
Joined
Sep 12, 2006
Messages
15,614
for a password, I would investigate xor encryption

password xor yourkey = secret
secret xor yourkey = password
 

ButtonMoon

Registered User.
Local time
Today, 22:08
Joined
Jun 4, 2012
Messages
304
Its not a single field i want to encrypt all entries made the Password column.
It's not generally good practice to store passwords, either plain or encrypted. Best practice is usually to store a secure hash of the password so that it's not possible to recover the password by snooping in the database. You can do that quite simply in SQL Server by using the HASHBYTES function.
 

Users who are viewing this thread

Top Bottom