搜尋套件、儲存庫與 APP 分類

套件詳情v2.0.0

dbcrypt

jBCrypt 移植到 Dart。它允許使用可設定的工作因子以 BCrypt 加密密碼,並驗證密碼。

AndroidiOSWebmacOSWindowsLinux
近 30 天下載
1.8萬
喜歡數
47
Pub 分數
140

安裝套件

flutter pub add dbcrypt

套件介紹

根據套件公開資料產生的選型評估,僅供參考。

dbcrypt 是 jBCrypt 的 Dart 實作,提供使用 BCrypt 算法的安全密碼雜湊。支援可設定的工作因子,以平衡安全性與效能,實現密碼的安全儲存。此套件允許使用者在註冊時雜湊密碼,並在驗證時核對密碼。專為跨平台使用設計,可在 Android、iOS、Web、macOS、Windows 與 Linux 上順暢運作。適用於需要強大密碼保護且設定簡單的應用程式。

適用情境

  • 安全密碼存儲
  • 使用者身分驗證
  • Web 應用中的密碼哈希
  • 跨平台應用安全
  • API 後端密碼驗證
  • 行動應用程式登入系統

主要特色

  • BCrypt 密碼哈希
  • 可設定的工作因子
  • 跨平台相容性
  • 簡單的雜湊和驗證 API
  • 開源且持續維護
  • 支援所有主要平台

適合對象

  • 需要安全認證的網頁和移動應用
  • 處理用戶憑證的後端服務
  • 需要符合安全標準的應用程式
  • 使用 Dart 進行安全密碼管理的開發者
  • 優先考慮密碼學最佳實務的專案

使用建議

  • 需要仔細選擇工作因子以平衡效能與安全性
  • 不適合用於加密密碼以外的敏感資料
  • 依賴外部庫的穩定性
  • 僅限與密碼相關的使用場景
  • 無內建鹽管理(內部處理)

原始 README

以下為關聯原始碼儲存庫的 README 原文快照,最新內容請造訪原始碼儲存庫。

DBCrypt

Port of jBCrypt to Dart.

This system hashes passwords using a version of Bruce Schneier's Blowfish block cipher with modifications designed to raise the cost of off-line password cracking. The computation cost of the algorithm is parameterised, so it can be increased as computers and Dart VM get faster.

Build Status

Installation

Add to your pubspec.yaml the following:

dependencies:
  dbcrypt: ^2.0.0

Usage

Hashing a password is easy:

import 'package:dbcrypt/dbcrypt.dart'

main() {
  var plainPassword = "P@55w0rd";
  var hashedPassword = new DBCrypt().hashpw(plainPassword, new DBCrypt().gensalt());
}

Comparing a plain and a hashed password is even easier:

var isCorrect = new DBCrypt().checkpw(plain, hashed);

Running Tests

Dependencies are installed using the Pub Package Manager.

# For running the tests it needs the 'dart' executable on your path. 
# Execute the next command if it isn't already on your path:
export DART_SDK=path/to/dart/sdk

pub install

test/run.sh

所屬分類

原始碼儲存庫

使用此套件的專案

暫無相關資料。