Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase 12»»

Worst Practices - Encrypting Data Expand / Collapse
Author
Message
Posted Saturday, November 10, 2001 12:00 AM


SSC-Dedicated

SSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-Dedicated

Group: Administrators
Last Login: Today @ 2:41 PM
Points: 33,100, Visits: 15,208
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
Post #1605
Posted Monday, January 7, 2002 8:13 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Friday, December 13, 2002 12:00 AM
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




Post #23743
Posted Monday, January 7, 2002 8:59 AM
SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: Moderators
Last Login: Today @ 2:35 PM
Points: 6,779, Visits: 1,868
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
Post #23744
Posted Monday, January 7, 2002 10:43 AM


SSC-Dedicated

SSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-Dedicated

Group: Administrators
Last Login: Today @ 2:41 PM
Points: 33,100, Visits: 15,208
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
Post #23745
Posted Monday, January 7, 2002 11:26 PM
SSC Eights!

SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!

Group: General Forum Members
Last Login: Tuesday, July 31, 2007 8:20 AM
Points: 885, Visits: 1
In oracle there are built in obfuscation routines so no need to code your own :)

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"
Post #23746
Posted Tuesday, January 8, 2002 11:12 AM


SSC-Dedicated

SSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-Dedicated

Group: Administrators
Last Login: Today @ 2:41 PM
Points: 33,100, Visits: 15,208
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
Post #23747
Posted Tuesday, January 8, 2002 8:47 PM
SSC Eights!

SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!

Group: General Forum Members
Last Login: Tuesday, July 31, 2007 8:20 AM
Points: 885, 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"
Post #23748
Posted Wednesday, January 9, 2002 10:55 AM


SSC-Dedicated

SSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-Dedicated

Group: Administrators
Last Login: Today @ 2:41 PM
Points: 33,100, Visits: 15,208
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
Post #23749
Posted Monday, January 28, 2002 11:29 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Friday, September 5, 2003 12:00 AM
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.




Post #23750
Posted Monday, January 28, 2002 12:32 PM


SSC-Dedicated

SSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-Dedicated

Group: Administrators
Last Login: Today @ 2:41 PM
Points: 33,100, Visits: 15,208
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
Post #23751
« Prev Topic | Next Topic »

Add to briefcase 12»»

Permissions Expand / Collapse