July 24, 2009 at 6:45 am
Hi All,
How do we encrypt a date datatype field. Please help.
If poss with an example
regards
krishna
July 25, 2009 at 4:43 am
encrypted fields have to be nvarchar or sometimes varbinary data types for any encryption to work, depending on the encryption method. they also have to typically be much larger than the original field.
from there, you'd have to decrypt to back to nvarchar, and then convert the results to datetime.
the same thing would have to happen to any field you want to encrypt, whether int or any other datatype...you store the encrypted values as nvarchar, usually.
there is a great example of using the SQL 2005 encryption techniques here:
it took me all of 2 minutes to read the article and get the example to work, and i had to create the master key as well.
Lowell
July 25, 2009 at 8:26 am
Please see my reply to your other question about encryption.
Your basic error is trying to store the encrypted data as the original datatype rather than using VARBINARY.
Paul
Paul White
SQLPerformance.com
SQLkiwi blog
@SQL_Kiwi
July 25, 2009 at 10:31 am
You pay a price with encryption. Are you sure that you need to encrypt dates?
July 27, 2009 at 1:07 am
Hi All,
Thank you so much for your inputs and it has helped me immensely. The requirement is such. Our client needs data encryption to be done on date data type.
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply