Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Salt passwords #54

Open
kthchew opened this issue Feb 28, 2023 · 0 comments · May be fixed by #70
Open

Salt passwords #54

kthchew opened this issue Feb 28, 2023 · 0 comments · May be fixed by #70

Comments

@kthchew
Copy link
Contributor

kthchew commented Feb 28, 2023

Problem To Be Solved

Passwords are currently hashed with SHA256, which is good. However, they should also be salted.

Motivation

This is a commonly used security measure that protects accounts from attacks involving rainbow tables, etc.

Proposed Solution

Append a salt randomly generated by the server to the end of the password before hashing upon account creation, and store the salt in the database.

result, err := database.Execute(fmt.Sprintf("INSERT INTO Accounts (email, password) VALUES ('%s', SHA2('%s', 256))", acc.Email, acc.Password))

@kthchew kthchew linked a pull request Apr 20, 2023 that will close this issue
12 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant