gpt4 book ai didi

delphi - 如何使用 Delphi 创建视觉挑战/响应以恢复对应用程序的访问?

转载 作者:行者123 更新时间:2023-12-03 15:04:19 25 4
gpt4 key购买 nike

我有兴趣在 Delphi 中创建质询/响应类型流程。场景是这样的...我们有 2 台计算机...1 台属于用户,1 台属于支持技术人员。

用户被某个程序锁定,为了获得 1 次访问权限,我想要:

  1. 向用户显示挑战短语,例如“28394LDJA9281DHQ”或某种类型的相当独特的值
  2. 用户将调用支持人员并阅读此挑战(在支持人员验证其身份后)
  3. 支持人员会将此质询值输入到其系统上的程序中,该程序将生成响应,该响应与响应同样独特,例如“9232KLSDF92SD”
  4. 用户输入响应,程序会确定这是否是有效响应。
  5. 如果是,则授予用户 1 次访问该应用程序的权限。

现在,我的问题是如何做到这一点?我将拥有 2 个应用程序,它们无法相互进行网络访问。 Windows 中是否有任何功能可以帮助我完成此任务?

我相信我可以使用 CryptoAPI 中的一些功能,但我真的不知道从哪里开始。如果您能提供任何帮助,我将不胜感激。

最佳答案

我将实现基于 MD5 的质询-响应身份验证。

来自维基百科 http://en.wikipedia.org/wiki/CRAM-MD5

Protocol

  1. Challenge: In CRAM-MD5 authentication, the server first sends a challenge string to the client.
  2. Response: The client responds with a username followed by a space character and then a 16-byte digest in hexadecimal notation. The digest is the output of HMAC-MD5 with the user's password as the secret key, and the server's original challenge as the message.
  3. Comparison: The server uses the same method to compute the expected response. If the given response and the expected response match then authentication was successful.

This provides three important types of security.

  1. First, others cannot duplicate the hash without knowing the password. This provides authentication.
  2. Second, others cannot replay the hash—it is dependent on the unpredictable challenge. This is variously called freshness or replay prevention.
  3. Third, observers do not learn the password. This is called secrecy.

The two important features of this protocol that provide these three security benefits are the one-way hash and the fresh random challenge.

此外,您可以在质询字符串中添加一些应用程序标识,以便对质询的发送者进行双重检查。

重要提示:它有一些弱点,请仔细评估它们可能如何影响您。

关于delphi - 如何使用 Delphi 创建视觉挑战/响应以恢复对应用程序的访问?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4249160/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com