配置文件 怎样把 mysql密码去掉,如何在配置文件中隐藏数据库密码

I am working on a C++ project that needs to access database for reading its input.

So far, we used a default username(postgres) and a 'fixed clear text' password stored , along with many other settings, in a xml based configuration file.

Now what I need is to hide password from users when I supply the configuration file.

FYI: the development area is linux, database is postgresql. we would like to give users the config file to connect to database and use it without knowing the password

I will appreciate if you suggest a quick and easy reference.(a small reading material will also be great)

thank you

解决方案

You cannot prevent a ill-intentioned user from obtaining this password one way or another if you ship him the program containing it in any form.

But there are two potential solutions:

The user and password that ship with the program have a read-only access to the database;

The program don't connect directly to the database. It requests the data to a server application that can not only fetch this data from the actual database without need to give the user any password, but also can do the proper security checks to ensure this user is accessing only data he is meant to etc.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值