以编程方式加密ODBC DSN登录密码 [英] Encrypting ODBC DSN login password programmatically
问题描述
我正在使用文件DSN连接到Sybase数据库.登录密码已加密,并使用EncryptedPassword
关键字存储在.dsn文件中.我有要求来更改数据库密码并相应地更新DSN.
I am using file DSN for connecting to Sybase database. Login password is encrypted and is stored with EncryptedPassword
keyword in the .dsn file. I have the requirement to change the database password and update the DSN accordingly.
我正在使用SQLDriverConnect
连接到数据库,并使用SQLWriteFileDSN
修改.dsn文件.
I am using SQLDriverConnect
to connect to the database and SQLWriteFileDSN
to modify the .dsn file.
有什么方法可以像Sybase一样对新的给定密码进行加密(关键字或特殊标签还是其他东西?).
一些限制:
-
我知道不建议在DSN中存储密码/加密的重低音单词,但是我无法在运行时提供密码以连接呼叫.我必须使用DSN(系统/用户/文件DSN).文件DSN优于其他文件的原因仅仅是因为如果未加密,它不会在.dsn文件中显示密码.
I know its not recommended to store password/encrypted bassword in DSN, but I can not provide the password on the run to connect call. I have to use DSN(System/User/File DSN). File DSN over others is just because it doesn't show password in a .dsn file if not encrypted.
驱动程序使用的是iAnywhere Solutions,inc.的Adaptive Server Anywhere 9.0. DBODBC9.DLL
.我猜它是很老的版本.
Driver using is Adaptive Server Anywhere 9.0 from iAnywhere Solutions, inc. DBODBC9.DLL
. I guess its the pretty old version.
推荐答案
看看SQL Anywhere附带的dbdsn
实用程序.如果使用-pe
开关,则保存DSN时将加密您指定的密码.
Take a look at the dbdsn
utility that is shipped with SQL Anywhere. If you use the -pe
switch, the password you specify will be encrypted when the DSN is saved.
这篇关于以编程方式加密ODBC DSN登录密码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!