[PR #3329] [MERGED] Change EncodePasswd to HashPassword #16887

Closed
opened 2025-11-02 12:21:24 -06:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/go-gitea/gitea/pull/3329
Author: @thehowl
Created: 1/8/2018
Status: Merged
Merged: 1/8/2018
Merged by: @bkcsoft

Base: masterHead: clarify-encode-password


📝 Commits (2)

  • a69259f Change EncodePasswd to HashPassword
  • 9ed387a Create test+benchmark for HashPassword

📊 Changes

7 files changed (+48 additions, -9 deletions)

View changed files

📝 cmd/admin.go (+1 -1)
📝 models/user.go (+4 -4)
📝 models/user_test.go (+39 -0)
📝 routers/admin/users.go (+1 -1)
📝 routers/api/v1/admin/user.go (+1 -1)
📝 routers/user/auth.go (+1 -1)
📝 routers/user/setting.go (+1 -1)

📄 Description

Gogs used the function "EncodePasswd" - when really the function in question hashes the data, and does not encode it.

Encoding and encrypting imply that there is a way to decode or decrypt. A hashing function, instead, is by definition impossible to reverse if not by brute force - which is the case of PBKDF2, and any password-hashing function that should be used in modern applications.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/go-gitea/gitea/pull/3329 **Author:** [@thehowl](https://github.com/thehowl) **Created:** 1/8/2018 **Status:** ✅ Merged **Merged:** 1/8/2018 **Merged by:** [@bkcsoft](https://github.com/bkcsoft) **Base:** `master` ← **Head:** `clarify-encode-password` --- ### 📝 Commits (2) - [`a69259f`](https://github.com/go-gitea/gitea/commit/a69259f53f66cd2f8e46d4f7f6b43d8728cb20b6) Change EncodePasswd to HashPassword - [`9ed387a`](https://github.com/go-gitea/gitea/commit/9ed387a0a9108ce29f4a1895b32d78089958e070) Create test+benchmark for HashPassword ### 📊 Changes **7 files changed** (+48 additions, -9 deletions) <details> <summary>View changed files</summary> 📝 `cmd/admin.go` (+1 -1) 📝 `models/user.go` (+4 -4) 📝 `models/user_test.go` (+39 -0) 📝 `routers/admin/users.go` (+1 -1) 📝 `routers/api/v1/admin/user.go` (+1 -1) 📝 `routers/user/auth.go` (+1 -1) 📝 `routers/user/setting.go` (+1 -1) </details> ### 📄 Description Gogs used the function "EncodePasswd" - when really the function in question __hashes__ the data, and does not encode it. Encoding and encrypting imply that there is a way to decode or decrypt. A hashing function, instead, is by definition impossible to reverse if not by brute force - which is the case of PBKDF2, and any password-hashing function that should be used in modern applications. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2025-11-02 12:21:24 -06:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#16887