on 2011 Jul 27 2:33 PM
Hi,
I have a file dsn containing encrypted password. I need to get the decrypted password and perform the steps). We are not storing password anywhere else.
Is there any way to get the PWD using some routine or sybase tool?
We are using Sybase version 9.0.2 (DBODBC9.DLL)..pretty old
Any help is highly appreciated.
Thanks
Request clarification before answering.
Thanks all for giving attention to this.
As i said earlier, retrieving plain text password(PWD) from ENP is possible but steps need to perform manually.
There is alternate way to do it:
My concern was to do it through some script or executible.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Ok, I have researched this topic some more and as a result I have completed redacted my previous response because it is completely bogus and I want to make sure that I correct my mistakes. It turns out that there isn't much point in "encrypting" your password using ENP - see below.
The correct answer is that it is easy to get back your plain text password from the "encrypted password" (ENP) value. I have quoted "encrypted password" because, even though the password value is mangled to be something that is not easily remembered, there is no key required to get the original text back. Therefore the ENP value should be treated as a way of obfuscating the password text rather than encrypting it.
Here is how you can get your original plain text from the ENP value on Windows:
So a note to all users: do not use ENP as a method to secure your passwords. Storing your password anywhere on your computer is not a good idea. This warning is given in the SQL Anywhere documentation for the ENP parameter:
Caution
When creating a data source, it is recommended that you do not include the encrypted password as part of the definition. Although both the ODBC Configuration For SQL Anywhere window in the Windows ODBC Data Source Administrator and the SQL Anywhere Data Source utility (dbdsn) have this capability, including this information poses a security risk.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks Mark for quick response.
Problem in hand: 1. I have database created with password A. created file dsn. 2. password gets changed to B. 3. B is known to me. I need to reset password A into database which is in encrypted form.
Can I either decrypt the encrypted password and then reset it into the DB or reset using encrypted password (if possible)?
Mark, does your explanation only work for file DSNs?
For regular DSNs on Windows, my impression is a totally different one:
In case you set "No" to the "Encrypt password" option in the ODBC administrator, it's easy to get this password in plain sight, even if it has been stored encrypted before. Works for all SA versions I have used so far. (I won't tell the details.)
AFAIK, the ENP parameter is primarily useful to prevent eaves-dropping - it's obfuscation, not encryption. Besides that, you can still connect with the encrypted form when using a connection string with "UID=...;ENP=...".
@Volker: You are correct, you will not be able to save/store a plain text password in a File DSN using the ODBC Administrator tool... but you can store a plain text password in a User DSN or System DSN. Of course this is not recommended... and FWIW it is not recommended storing of ENP passwords in a DSN either (see warning in my revised answer).
Besides Mark's corrected answer, there's one more caveat to note (as I already wrote in a comment):
Unless you use a tool that only allows an UID and a PWD to connect (e.g. MS Access/Jet with ODBCDirect mode, IIRC), you can usually connect with the obfuscated form directly by replacing the PWD with ENP in the connection string.
So you would be able to connect to a SQL Anywhere demo database with both connection strings just as well:
-c "UID=DBA;PWD=sql;ENG=..." -c "UID=DBA;ENP=39f2ce6e;ENG=..."
(I have not tested the exact values but taken them from Mark's answer.)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
There's no way to get the value of an encrypted password, but you can use the ODBC administrator to create a new one. Use the ODBC administrator (odbcad32.exe) to create a user DSN and enter the new password in plaintext. Make sure the "encrypt password" checkbox is checked before saving it. Then use dbdsn -g to read the DSN, which will display the ENP= value. Then you can edit your FileDSN with the new value.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks Graeme. Is there a way to toggle between check and un-check the "encrypt password" check box using some tool or programmatically? I have to reset pwd back to original value.
I can do this manually and decrypt the password but am looking for some tool or API which can do it for me.
will SQLConfigDataSource or ConfigDSN API be able to help?
User | Count |
---|---|
60 | |
8 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.