以编程方式加密ODBC DSN登录密码 [英] Encrypting ODBC DSN login password programmatically

查看:325
本文介绍了以编程方式加密ODBC DSN登录密码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用文件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一样对新的给定密码进行加密(关键字或特殊标签还是其他东西?).

一些限制:

  1. 我知道不建议在DSN中存储密码/加密的重低音单词,但是我无法在运行时提供密码以连接呼叫.我必须使用DSN(系统/用户/文件DSN).文件DSN优于其他文件的原因仅仅是因为如果未加密,它不会在.dsn文件中显示密码.

  1. 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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆