SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


How to Hide/Encrypt/Password a Table


How to Hide/Encrypt/Password a Table

Author
Message
EddieN1
EddieN1
SSC Rookie
SSC Rookie (46 reputation)SSC Rookie (46 reputation)SSC Rookie (46 reputation)SSC Rookie (46 reputation)SSC Rookie (46 reputation)SSC Rookie (46 reputation)SSC Rookie (46 reputation)SSC Rookie (46 reputation)

Group: General Forum Members
Points: 46 Visits: 45
I have some sensitive, Executive payroll tables that I would like to restrict access to, including from the System Administrator. I can't restrict by User Groups because the SA could add himself to the Group and gain access. Is there a way to password protect or encrypt or hide or explicitly use DENY to these tables to keep the SA, and any other unauthorized users, from seeing the data? I have security in the application, but I need a way to keep users from connecting to the server and accessing these tables with Crystal Reports, Excel, etc.
Steve Jones
Steve Jones
SSC Guru
SSC Guru (62K reputation)SSC Guru (62K reputation)SSC Guru (62K reputation)SSC Guru (62K reputation)SSC Guru (62K reputation)SSC Guru (62K reputation)SSC Guru (62K reputation)SSC Guru (62K reputation)

Group: Administrators
Points: 62497 Visits: 19104
Only if you can change the code that accesses the tables. If you can control the code, and have users enter a password, you can use symmetric/asymmetric encryption to secure this data and prevent sysadmins from viewing the data.

Follow me on Twitter: @way0utwest
Forum Etiquette: How to post data/code on a forum to get the best help
My Blog: www.voiceofthedba.com
GilaMonster
GilaMonster
SSC Guru
SSC Guru (87K reputation)SSC Guru (87K reputation)SSC Guru (87K reputation)SSC Guru (87K reputation)SSC Guru (87K reputation)SSC Guru (87K reputation)SSC Guru (87K reputation)SSC Guru (87K reputation)

Group: General Forum Members
Points: 87253 Visits: 45272
Passwords should not be stored encrypted, they should be stored hashed. One-way cryptographic hash. There is no need to ever unencrypt a password. Hash whatever is entered and compare, don't decrypt what is stored and compare.

Of course, that requires changing the code that checks the passwords and the table design. If you can't do both, there's little to nothing you can effectively do.

Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

We walk in the dark places no others will enter
We stand on the bridge and no one may pass


EddieN1
EddieN1
SSC Rookie
SSC Rookie (46 reputation)SSC Rookie (46 reputation)SSC Rookie (46 reputation)SSC Rookie (46 reputation)SSC Rookie (46 reputation)SSC Rookie (46 reputation)SSC Rookie (46 reputation)SSC Rookie (46 reputation)

Group: General Forum Members
Points: 46 Visits: 45
Thanks for the responses. Yes, as the Developer, I can control the code. With this in mind, do you have any other suggestions? I would like to be able to do this to the entire table, not just selected columns. Does that make a difference in your thoughts?
Steve Jones
Steve Jones
SSC Guru
SSC Guru (62K reputation)SSC Guru (62K reputation)SSC Guru (62K reputation)SSC Guru (62K reputation)SSC Guru (62K reputation)SSC Guru (62K reputation)SSC Guru (62K reputation)SSC Guru (62K reputation)

Group: Administrators
Points: 62497 Visits: 19104
First, encrypting the entire table means that access is going to be slow since you have to decrypt. Indexing doesn't help, and that can be an issue. If you always perform access for just a row or two and the table isn't large, then that's fine. However, I'm not sure why you'd encrypt key columns. Usually you want to encrypt the data only that's sensitive.

The password can't ever be stored anywhere in the database or it can be compromised by the sysadmin. That's why I say this has to be controlled from the front end. You'd set this up, have the user enter a password, encrypt the data and then send it on the wire.

You could use temp keys in SQL Server as well. This isn't simple, but it's not too hard either.

Follow me on Twitter: @way0utwest
Forum Etiquette: How to post data/code on a forum to get the best help
My Blog: www.voiceofthedba.com
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search