Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Password encryption-decryption logic in SQL Server 2005


Password encryption-decryption logic in SQL Server 2005

Author
Message
Manish Sinha
Manish Sinha
SSC-Enthusiastic
SSC-Enthusiastic (101 reputation)SSC-Enthusiastic (101 reputation)SSC-Enthusiastic (101 reputation)SSC-Enthusiastic (101 reputation)SSC-Enthusiastic (101 reputation)SSC-Enthusiastic (101 reputation)SSC-Enthusiastic (101 reputation)SSC-Enthusiastic (101 reputation)

Group: General Forum Members
Points: 101 Visits: 98
I have passed the encrypted password in the connection string from my VB or VB.Net code.How to tackle this is SQL Server.I mean,how I define the decryption logic in SQL Server 2005?What should be the password of the login I passed in connection string (I hope it should be decrypted one only!!!).
In short I want all the ways of implementing encryption-decryption in SQL Server 2005 interacting with VB6 or dotnet.
Thanks i advance for your help!!!!
Steve Jones
Steve Jones
SSC-Forever
SSC-Forever (40K reputation)SSC-Forever (40K reputation)SSC-Forever (40K reputation)SSC-Forever (40K reputation)SSC-Forever (40K reputation)SSC-Forever (40K reputation)SSC-Forever (40K reputation)SSC-Forever (40K reputation)

Group: Administrators
Points: 40817 Visits: 18861
How are you encrypting things? Really you need the same algorithm on the server to provide the decrpytion. You could use one-way encryption, like MD5, and then just compare the encrypted versions. That might be the easiest way to do this. However then someone could send the encrypted value through.

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
JamieX
JamieX
Old Hand
Old Hand (393 reputation)Old Hand (393 reputation)Old Hand (393 reputation)Old Hand (393 reputation)Old Hand (393 reputation)Old Hand (393 reputation)Old Hand (393 reputation)Old Hand (393 reputation)

Group: General Forum Members
Points: 393 Visits: 437
You need to be a bit more clear on this..

Encrypted string in an application and building a connection string?
- decrypt password, build unencrypted connection string use that to connect.

Connection string is encrypted in config file and you need to use it?
- read encrypted data, unencrypt and use it.

Either way, you need to build a class to handle your encryption requests, and your connection string you use needs to be clear text. Ado and OLE drivers cannot handle encrypted strings. There are new methods in .net2 to keep your connection string encrypted in your config file.
Manish Sinha
Manish Sinha
SSC-Enthusiastic
SSC-Enthusiastic (101 reputation)SSC-Enthusiastic (101 reputation)SSC-Enthusiastic (101 reputation)SSC-Enthusiastic (101 reputation)SSC-Enthusiastic (101 reputation)SSC-Enthusiastic (101 reputation)SSC-Enthusiastic (101 reputation)SSC-Enthusiastic (101 reputation)

Group: General Forum Members
Points: 101 Visits: 98
Hi Jamie,

I will tell u the exact scenario....
suppose the password of SQL Server Login is sqltest.I encrypted the password (to suppose "#[)^%#" based on my own logic) and made the conn string in VB6.........
Now sql server login has password sqltest.Where will I define this encryption logic in SQL so that it can decrypt "#[)^%#" to sqltest for login success.
JamieX
JamieX
Old Hand
Old Hand (393 reputation)Old Hand (393 reputation)Old Hand (393 reputation)Old Hand (393 reputation)Old Hand (393 reputation)Old Hand (393 reputation)Old Hand (393 reputation)Old Hand (393 reputation)

Group: General Forum Members
Points: 393 Visits: 437
from what i understand, what you are trying to do isnt supported by any OLE/ODBC provider I know of. Usually you encrypt a password when saved in a file (like web.config or whatever), read it in your application, decrypt it, build connection string, connect to server.

If you are concerned about plain text, etc, you need to encrypt your connection, or use integrated authentication instead (as integrated stores no password, its windows auth)

secure connection:
http://technet.microsoft.com/en-us/library/ms189067.aspx
Manish Sinha
Manish Sinha
SSC-Enthusiastic
SSC-Enthusiastic (101 reputation)SSC-Enthusiastic (101 reputation)SSC-Enthusiastic (101 reputation)SSC-Enthusiastic (101 reputation)SSC-Enthusiastic (101 reputation)SSC-Enthusiastic (101 reputation)SSC-Enthusiastic (101 reputation)SSC-Enthusiastic (101 reputation)

Group: General Forum Members
Points: 101 Visits: 98
Thanks Jamie!!!Smile
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