Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Administration (2000)
 Server Variable - Encryption Key

Author  Topic 

clarkbaker1964
Constraint Violating Yak Guru

428 Posts

Posted - 2005-07-21 : 19:46:11
I would like to store a memory variable that holds an encryption key
can these be created and used accross all stored procedures.

I was going to store the key in a file on the server but it really only needs to be loaded when the servers services are restarted.

suggestions?



You can do anything at www.zombo.com

Bustaz Kool
Master Smack Fu Yak Hacker

1834 Posts

Posted - 2005-07-21 : 19:58:34
Why not store it in a table in a known database. I hate to suggest Master or MSDB (and certainly not TempDB) but a database of your creation or even Model could be used.

Another approach would be to return the value from a system function or system stored procedure that you create. This could be created on the Master or your own "DBA" database.

HTH

=================================================================
The most tyrannical of governments are those which make crimes of opinions, for everyone has an inalienable right to his thoughts. -Baruch Spinoza, philosopher (1632-1677)
Go to Top of Page

clarkbaker1964
Constraint Violating Yak Guru

428 Posts

Posted - 2005-07-22 : 00:22:08
That would be a pretty strait forward approach. But I prefer not to read from the table repetitively to get a known value. I would hard code the password but sql server sp encryption is week!!! and maintenance would be troublesome if the encryption key needed to change.

I remember someone had posted an article about creating server variables that could persist and be loaded at startup.

Help in this area would be appreciated.






You can do anything at www.zombo.com
Go to Top of Page

Thrasymachus
Constraint Violating Yak Guru

483 Posts

Posted - 2005-07-22 : 08:46:49
take a look at this thread

http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=52599

Sean Roussy

Please backup all of your databases including master, msdb and model on a regular basis. I am tired of telling people they are screwed. The job you save may be your own.

I am available for consulting work. Just email me through the forum.
Go to Top of Page

Bustaz Kool
Master Smack Fu Yak Hacker

1834 Posts

Posted - 2005-07-22 : 11:04:16
create function dbo.GetKey
returns binary(16)
with encryption
as
begin
return 0x4d79456e6372797074696f6e4b65793f
end

No table access. Encryption on functions is stronger than on sprocs, views and triggers.

HTH

=================================================================
The most tyrannical of governments are those which make crimes of opinions, for everyone has an inalienable right to his thoughts. -Baruch Spinoza, philosopher (1632-1677)
Go to Top of Page
   

- Advertisement -