If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > Provider=ibmdadb2... UID/PWD Question

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 08-06-07, 13:23
myBoo myBoo is offline
Registered User
 
Join Date: May 2007
Posts: 27
Provider=ibmdadb2... UID/PWD Question

I use the following to set up my connection string to DB2:

Set objConn = Server.CreateObject("ADODB.Connection")
Connstr = "Provider=ibmdadb2; DSN=DbName; UID=hardcoded; PWD=hardcoded"
objConn.Open Connstr


This works only if UID and PWD are hardcoded which seems like a security violation to me. Anyone who gets access to this code would then be able to connect to DB2 using the suppled ID/PWD.

How can I prevent this and/or hide the UID and PWD? More to the point - What is the most common or preferred method to accomplish this?

Code is being used to allow users access to specific data from db via an internal website which is menu driven.
Reply With Quote
  #2 (permalink)  
Old 08-07-07, 09:28
jsharon1248 jsharon1248 is offline
Registered User
 
Join Date: Apr 2007
Location: Chicago
Posts: 57
I've run into this problem too. I resolved it by passing the connection string to the script with an encrypted password. The script looks for the 'password=' text and decrypts the text following it. The string with the decrypted password would be sent to the DB, but never seen by anyone snooping around. If you're looking for a simple encryption method you could use a bar delimited ordinal string. Each character would be replaced by its position in the collating sequence. Using this method "password=97|49|98|50|" would be passed to the DB as "password=a1b2".
Reply With Quote
  #3 (permalink)  
Old 08-10-07, 16:40
myBoo myBoo is offline
Registered User
 
Join Date: May 2007
Posts: 27
Not sure how I can make that work. I have ASP scripts that access the dB and the userID and PWD are coded in these scripts. Scripts were created via NotePad and I don't see how I can encrypt anything with the current tools available.

To address this for the time being, I created a local user and gave that user SELECT rights only from within DB2. This should allow me to pass an audit for the time being.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On