C# - Securely storing a password locally

前端 未结 6 1257
终归单人心
终归单人心 2020-12-17 00:58

I\'m creating a C# application that will lock out functionality (key combinations, windows task bar, etc.) in a Kiosk-style environment. One of the requirements is that some

6条回答
  •  無奈伤痛
    2020-12-17 01:28

    Store a secure hash of the password, it doesn't need to be reversible.

    When someone enters a password you hash that by the same algorithm and check it matches the hash.

    Because you never store the actual password it's secure.

    I recommend using a key stretching algorithm like PBKDF2. .Net has support for this using Rfc2898DeriveBytes or you can use System.Web.Helpers.Crypto.

提交回复
热议问题