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 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.
answered 29 Jul '11, 04:57
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:
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.)
answered 28 Jul '11, 16:55
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.