https://github.com/karenpayneoregon/sql-server-password-secure
Securely storing passwords in SQL-Server for C# and verifying
https://github.com/karenpayneoregon/sql-server-password-secure
csharp csharp-core passwords sqlserver
Last synced: 3 months ago
JSON representation
Securely storing passwords in SQL-Server for C# and verifying
- Host: GitHub
- URL: https://github.com/karenpayneoregon/sql-server-password-secure
- Owner: karenpayneoregon
- Created: 2022-12-18T11:51:07.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2023-02-07T18:27:51.000Z (over 3 years ago)
- Last Synced: 2025-06-10T02:07:31.452Z (about 1 year ago)
- Topics: csharp, csharp-core, passwords, sqlserver
- Language: TSQL
- Homepage: https://dev.to/karenpayneoregon/passwords-in-sql-server-c-1fhf
- Size: 120 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
# Storing passwords in SQL-Server database
Developers just starting working with Windows Forms, WPF or Console applications tend to use plain text to store passwords in a database which is not wise as anyone that can open the database can see these passwords stored in plain text.
Presented are two ways to keep passwords secure. The first [PWDENCRYPT](https://learn.microsoft.com/en-us/sql/t-sql/functions/pwdencrypt-transact-sql?view=sql-server-ver16) is easy but is marked as `obsolete` while the second, [HASHBYTES](https://learn.microsoft.com/en-us/sql/t-sql/functions/hashbytes-transact-sql?view=sql-server-ver16) is recommended.
Code sample are provided for both `PWDENCRYPT` and `HASHBYTES`
:heavy_check_mark: Make sure to read instructions in the readme file in the project for setting up the database.
:heavy_check_mark: Requires Visual Studio 2022, version 17.4.x