Delphi中的密码加密 [英] Password encryption in Delphi

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

问题描述

我需要在配置文件中存储数据库密码。由于显而易见的原因,我想加密它们(最好用AES)。有没有人知道一个德尔福实现,很容易引入一个现有的项目,有> 10,000行历史上成长(URGH!)源代码?

I need to store database passwords in a config file. For obvious reasons, I want to encrypt them (preferably with AES). Does anyone know a Delphi implementation that is easy to introduce into an existing project with > 10,000 lines of historically grown (URGH!) source code?

澄清:单位到项目,添加最大。 5行代码,其中配置文件被读取并完成它。不应超过15分钟。

Clarification: Easy means adding the unit to the project, adding max. 5 lines of code where the config file is read and be done with it. Should not take more than 15 minutes.

另一个澄清:需要密码才能创建与数据库的连接,而不支持应用程序的用户管理方案。所以使用哈希不帮助。数据库引擎检查密码是否有效,而不是应用程序。

Another clarification: The password is needed in order to create a connection to the db, not to support a user management scheme for the application. So using hashes does not help. The db engine checks if the password is valid, not the app.

推荐答案

我第二次推荐David Barton的 DCPCrypt library 。我已经在几个项目中成功使用它,并且它不会超过15分钟后,你阅读了使用示例。它使用MIT许可证,因此您可以在商业项目中使用它,否则。 DCPCrypt实现了许多算法,包括Rijndael,这是AES。

I second the recommendation for David Barton's DCPCrypt library. I've used it successfuly in several projects, and it won't take more than 15 minutes after you've read the usage examples. It uses MIT license, so you can use it freely in commercial projects and otherwise. DCPCrypt implements a number of algorithms, including Rijndael, which is AES.

有很多googlable独立(单个单元)实现 - 问题是哪一个信任,除非你准备自己验证特定图书馆的正确性。

There are many googlable stand-alone (single-unit) implementations too - the question is which one you trust, unless you are prepared to verify the correctedness of a particular library yourself.

这篇关于Delphi中的密码加密的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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