Thuật toán băm mật khẩu yescrypt cũng có rounds như sha512 rounds

Cây xả được băm ra để cho vào đồ ăn làm gia vị.

Gà kho sả ớt nghệ – Món ăn quen thuộc của người Việt Nam.

Để học an toàn thông tin thực chiến bạn hãy mua khóa học Ansible LAB 01 – Ansible triển khai ứng dụng tự động 100% để học và cũng là ủng hộ chúng tôi tiếp tục làm thêm những thứ hay ho khác.

Nội dung an toàn thông tin gồm video giải thích thuật toán yescrypt, sha512 + mã nguồn chương trình dò mật khẩu trên Linux đang được tặng miễn phí tới ngày 30/05/2024.

Chúng tôi lồng ghép nội dung an toàn thông tin vào để chứng minh cho việc khi bạn hiểu sâu hiểu rõ nhiều thứ trong công nghệ thông tin tự nhiên bạn học được an toàn thông tin.

yescrypt được chọn làm thuật toán băm mật khẩu mặc định thay cho sha512 trên Ubuntu 22.04 trở đi.

yescrypt cũng có số rounds như sha512 rounds.

Số rounds của yescrypt càng lớn thì thời gian tính toán càng lâu để băm ra được mật khẩu nên yescrypt rounds được gọi là cost-based password hashing.

time echo "DevSecOps.Edu.VN" | mkpasswd -m yescrypt -s -R 9
$y$jDT$GtQ1I09aqeTqfk351eTQ2/$ORRQJisFlJMzFRyFQs0v5JPH1be/hC2hcy.9XxkF808

real	0m0.217s
user	0m0.006s
sys	0m0.209s

time echo "DevSecOps.Edu.VN" | mkpasswd -m yescrypt -s -R 10
$y$jET$4g5YgER5.evDE8yaIJ51u.$53kZHLk2FDoXUxUuArP8uBK4ikin1Qg.KmtOBBcLmGA

real	0m0.452s
user	0m0.035s
sys	0m0.416s

time echo "DevSecOps.Edu.VN" | mkpasswd -m yescrypt -s -R 11
$y$jFT$o3gEfhL0INW.E8lCoLphp.$WmGXFhVaZA7oaNWwVHmS.8NGbJoyffF/J3ufJoyBd89

real	0m1.282s
user	0m0.086s
sys	0m1.194s

Cấu hình Linux PAM trong /etc/pam.d/common-password như sau để chỉ định yescrypt rounds.

cat /etc/pam.d/common-password
#
# /etc/pam.d/common-password - password-related modules common to all services
#
# This file is included from other service-specific PAM config files,
# and should contain a list of modules that define the services to be
# used to change user passwords.  The default is pam_unix.

# Explanation of pam_unix options:
# The "yescrypt" option enables
#hashed passwords using the yescrypt algorithm, introduced in Debian
#11.  Without this option, the default is Unix crypt.  Prior releases
#used the option "sha512"; if a shadow password hash will be shared
#between Debian 11 and older releases replace "yescrypt" with "sha512"
#for compatibility .  The "obscure" option replaces the old
#`OBSCURE_CHECKS_ENAB' option in login.defs.  See the pam_unix manpage
#for other options.

# As of pam 1.0.1-6, this file is managed by pam-auth-update by default.
# To take advantage of this, it is recommended that you configure any
# local modules either before or after the default block, and use
# pam-auth-update to manage selection of other modules.  See
# pam-auth-update(8) for details.

# here are the per-package modules (the "Primary" block)
password	requisite			pam_pwquality.so retry=3
password	[success=2 default=ignore]	pam_unix.so obscure use_authtok try_first_pass yescrypt rounds=11
password	sufficient			pam_sss.so use_authtok
# here's the fallback if no module succeeds
password	requisite			pam_deny.so
# prime the stack with a positive return value if there isn't one already;
# this avoids us returning an error just because nothing sets a success code
# since the modules above will each just jump around
password	required			pam_permit.so
# and here are more per-package modules (the "Additional" block)
password	optional	pam_gnome_keyring.so 
# end of pam-auth-update config