All New

user:thomas gists created by user

title:mygist gists with given title

filename:myfile.txt gists having files with given name

extension:yml gists having files with given extension

language:go gists having files with given language

topic:homelab gists with given topic

Login


All New Login

All gists matching topic login-system

Recently created
Least recently created
Recently updated
Least recently updated

timmy / 🔐 Python 密碼雜湊教學:用 bcrypt 安全加密與驗證

0 likes
0 forks
1 files
Last active 11 months ago
用 bcrypt 進行密碼加密與驗證,支援 salt、自動安全雜湊,保護你的使用者資料不被爆破!適合登入驗證與帳號系統 🚀
authentication bcrypt login-system password-hashing python security
1 import bcrypt
2
3
4 def encode_password(password: str) -> str:
5 salt = bcrypt.gensalt()
6 hashed = bcrypt.hashpw(password.encode(), salt)
7 return hashed.decode()
8
9
10 def check_password(password: str, hashed: str) -> bool:

timmy / 使用 Streamlit 建立使用者身份驗證系統

0 likes
0 forks
2 files
Last active 1 year ago
這段程式碼使用 Streamlit 和 streamlit-authenticator 來 管理使用者登入,透過 YAML 設定檔 儲存使用者憑證與 Cookie 配置,並提供 登入、登出 和 使用者驗證 功能。
authentication login-system python security streamlit user-management yaml
1 cookie:
2 expiry_days: 30
3 key: some_signature_key
4 name: my_auth_cookie
5 credentials:
6 usernames:
7 jsmith:
8 email: jsmith@gmail.com
9 failed_login_attempts: 0 # Will be managed automatically
10 logged_in: False # Will be managed automatically
Newer Older

Powered by Opengist ⋅ Load: 26ms⋅

日本語
Čeština Deutsch English Español Français Magyar Italiano 日本語 Polski Português Русский Türkçe Українська 中文 繁體中文