プロジェクト

全般

プロフィール

Vote #78018

未完了

Use more secure hashing algorigthm

Admin Redmine さんが約4年前に追加. 約4年前に更新.

ステータス:
New
優先度:
通常
担当者:
-
カテゴリ:
Accounts / authentication_7
対象バージョン:
-
開始日:
2022/05/09
期日:
進捗率:

0%

予定工数:
category_id:
7
version_id:
0
issue_org_id:
24520
author_id:
163201
assigned_to_id:
0
comments:
1
status_id:
1
tracker_id:
2
plus1:
0
affected_version:
closed_on:
affected_version_id:
ステータス-->[New]

説明

h2. Introduction

Currently the hashing algorithm used is: @SHA1@ [0].
I suggest to use a more secure ( computationally expensive ) algorithm to store the password. Some alternative algorithms to use:

  • @bcrypt@ with reasonable iteration count.
  • @scrypt@.

h2. Drawbacks

The only drawback I can think of is the migration of the database to use the new algorithm. I'm thinking about using this approach to fix this issue:

Let's call the new secure hashing algorithm: @H@.

  • The salt will be kept in the database.
  • Foreach user in the database, replace the hashed password: @SHA1($salt.$plain_password)@ with @H(SHA1($salt.$plain_password)@.
  • The algorithm @H(SHA1($salt.$plain_password)@ will be used from now when creating a new users/resetting a new password ...

h2. Why is @SHA1@ insecure ?

When I say insecure I'm not talking about the collision ratio. I'm referencing that it's easy (fast) to compute.
Example: Using hashcat[1] v3.10 with GPU: R9 290X (+10Mhz) - AMDGPU-pro 16.40[2], It's able to compute:

  • 4,102,360,845 @sha1@ hash per second.
  • 94,960 @scrypt@ hash per second.
  • 12,070 @bcrypt@ hash per second ( cost of 10 iirc ).

Thoughts ?

[0] https://github.com/redmine/redmine/blob/master/app/models/user.rb#L840
[1] https://hashcat.net/
[2] https://docs.google.com/spreadsheets/d/1B1S_t1Z0KsqByH3pNkYUM-RCFMu860nlfSsYEqOoqco/edit#gid=1591672380


journals

--------------------------------------------------------------------------------


related_issues

relates,New,36056,Update password hash function

Admin Redmine さんが約4年前に更新

  • カテゴリAccounts / authentication_7 にセット

他の形式にエクスポート: Atom PDF

いいね!0
いいね!0