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


Worst Practices - Encrypting Data


Worst Practices - Encrypting Data

Author
Message
Steve Jones
Steve Jones
SSC Guru
SSC Guru (84K reputation)SSC Guru (84K reputation)SSC Guru (84K reputation)SSC Guru (84K reputation)SSC Guru (84K reputation)SSC Guru (84K reputation)SSC Guru (84K reputation)SSC Guru (84K reputation)

Group: Administrators
Points: 84504 Visits: 19224
Comments posted to this topic are about the content posted at http://www.sqlservercentral.com/columnists/sjones/wp_encryption.asp

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
ShaunCool
ShaunCool
Forum Newbie
Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)

Group: General Forum Members
Points: 3 Visits: 1
At my last place of employment we were an 'Oracle house' - and simply used the built-in oracle Function TRANSLATE to store passwords. This wasn't for any real encryption reasons but more so people could not look at a DBA's or developer's screen and see a password (or list of passwords).

Translate is used with a character string which simply replaces a character with another such as[SELECT user_id ... FROM table a WHERE a.user_id = @userID AND a.password = Translate(@password,'pONmlkjihgfeDCBA','abcdefghijklmnop')]

Translate can, of course, must used in reverse order to store the password. Storing the password retrieval and update sql in stored procedures kept the integrity current.

Finally.. my question...
Are there any such built-in functions for SQL Server 2000? Or, could a user-defined function be built into SQL server itself - or perhaps in a stored procedure? What is your suggestion?

Thanks

Shaun



Andy Warren
Andy Warren
SSCoach
SSCoach (15K reputation)SSCoach (15K reputation)SSCoach (15K reputation)SSCoach (15K reputation)SSCoach (15K reputation)SSCoach (15K reputation)SSCoach (15K reputation)SSCoach (15K reputation)

Group: Moderators
Points: 15293 Visits: 2730
No reason you couldnt create a user defined function to do the work. Should be fine to discourage casual snooping, just dont rely on it for anything more!

We've got an ongoing discussion about Oracle vs SQL in one of our discussion areas - maybe you could share your thoughts?


Andy

Andy
SQLAndy - My Blog!
Connect with me on LinkedIn
Follow me on Twitter
Steve Jones
Steve Jones
SSC Guru
SSC Guru (84K reputation)SSC Guru (84K reputation)SSC Guru (84K reputation)SSC Guru (84K reputation)SSC Guru (84K reputation)SSC Guru (84K reputation)SSC Guru (84K reputation)SSC Guru (84K reputation)

Group: Administrators
Points: 84504 Visits: 19224
This isn't really encryption. More obfuscation which is a really low level security item.

As Andy said, it's just for casual snooping.

Steve Jones
steve@dkranch.net

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
ckempste
ckempste
SSCommitted
SSCommitted (1.9K reputation)SSCommitted (1.9K reputation)SSCommitted (1.9K reputation)SSCommitted (1.9K reputation)SSCommitted (1.9K reputation)SSCommitted (1.9K reputation)SSCommitted (1.9K reputation)SSCommitted (1.9K reputation)

Group: General Forum Members
Points: 1859 Visits: 1
In oracle there are built in obfuscation routines so no need to code your own Smile

Anyhow, I agree that encrypting data in the DB is not the best practice in the world. More time should be spend on

a) underlying roles and access to the DB
b) DB and backup file encryption
c) securing the server and associated sql*server service users
d) encrypting t-sql code
e) auditing

the trick is always credit-card id's etc. you need to carefully analyse your routines that check and report on such data. Perhaps consider views with instead of triggers etc..

The cost of writing encryption logic into a app to crypt data that can be cracked with simple routines is tough to justify.


Chris Kempster
www.chriskempster.com
Author of "SQL Server Backup, Recovery & Troubleshooting"
Author of "SQL Server 2k for the Oracle DBA"
Steve Jones
Steve Jones
SSC Guru
SSC Guru (84K reputation)SSC Guru (84K reputation)SSC Guru (84K reputation)SSC Guru (84K reputation)SSC Guru (84K reputation)SSC Guru (84K reputation)SSC Guru (84K reputation)SSC Guru (84K reputation)

Group: Administrators
Points: 84504 Visits: 19224
Does Oracle have encryption/ decryption routines? How does it manage keys?
I think the db is a good place for encrypted data, but it is extremely difficult to manage. Plus, to be secure , it has to be encrypted when it crosses the wire.

I just with there was a way to lock out sa's. there are places where this is a good idea.

Steve Jones
steve@dkranch.net

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
ckempste
ckempste
SSCommitted
SSCommitted (1.9K reputation)SSCommitted (1.9K reputation)SSCommitted (1.9K reputation)SSCommitted (1.9K reputation)SSCommitted (1.9K reputation)SSCommitted (1.9K reputation)SSCommitted (1.9K reputation)SSCommitted (1.9K reputation)

Group: General Forum Members
Points: 1859 Visits: 1
Steve

http://download-west.oracle.com/otndoc/oracle9i/901_doc/appdev.901/a88876/adgsec04.htm

basically pl-sql stored procedure routines, ie:

dbms_obfuscation_toolkit.DESDecrypt(input_string => encrypted_string,
key => raw_key, decrypted_string => decrypted_string);

for example.

Includes:

a) Data Encryption Standard (DES) algorithm
b) encrypt and decrypt using 2-key and 3-key DES
c) require keylengths of 128 and 192 bits, respectively
d) DES algorithm itself has an effective key length of 56-bits


Chris Kempster
www.chriskempster.com
Author of "SQL Server Backup, Recovery & Troubleshooting"
Author of "SQL Server 2k for the Oracle DBA"
Steve Jones
Steve Jones
SSC Guru
SSC Guru (84K reputation)SSC Guru (84K reputation)SSC Guru (84K reputation)SSC Guru (84K reputation)SSC Guru (84K reputation)SSC Guru (84K reputation)SSC Guru (84K reputation)SSC Guru (84K reputation)

Group: Administrators
Points: 84504 Visits: 19224
Interesting, but this still doesn't solve the key issue. Transmitting the key along with the data defeats the purpose to some extent. Any tool like profiler or a network sniffer would render this useless.

Steve Jones
steve@dkranch.net

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
karhatsu
karhatsu
Forum Newbie
Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)

Group: General Forum Members
Points: 2 Visits: 1
These are valid points. Enhanced security will always have a price, and in the Database world, that equals response time. If security is that important to your organization then I would approach it like most other problems, do everything you can to tighten up the code then make up for the rest by scaling up. In this case since Disk IO is the potential bottleneck, I would consider implementing a Solid State SAN. There is no seek time to speak of and the randow reads are the same as sequential reads. As far as transmitting the data, SSL on ASP pages does pretty well, again performance is just a matter of how much you want to spend.



Steve Jones
Steve Jones
SSC Guru
SSC Guru (84K reputation)SSC Guru (84K reputation)SSC Guru (84K reputation)SSC Guru (84K reputation)SSC Guru (84K reputation)SSC Guru (84K reputation)SSC Guru (84K reputation)SSC Guru (84K reputation)

Group: Administrators
Points: 84504 Visits: 19224
I agree with your points. I'd consider encyption for non-key fields, like salary. However, I'd want to place the key management in someone else's hands. After all if I hold the keys, why bother encrypting?

Steve Jones
steve@dkranch.net

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