Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Encrypting a column

Status
Not open for further replies.

achick

Programmer
May 23, 2007
66
US
I am trying to encrypt a column in SQL server 08.
I am using AES, certificate and symmetric key.
Can I change the data type and length of the encrypted column from varbinary(128) to a smaller length and also change it to varchar?
Is there a way to prefix the encrypted column data?
Is there a way to encrypt so that same value gets same encrypted ID?
For example, if the table has the same ID in different rows- can I get the same encryptedID for that ID wherever it is used?

 
Every time a value is encrypted it returns a different represntation value. What you see in the column as VARBINARY is a representation of the value not the actual value so you should not convert to VARCHAR.
We went with a HASH stratagy for comparing two rows (see HASHBYTES). We use a seed that we rotate monthly (all values rehashed) so it is harder to use a rainbow table.

djj
The Lord is my shepherd (Psalm 23) - I need someone to lead me!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top