FLUTTER ECOSYSTEM

Erly/dbcrypt

JBCrypt 的 Dart 版本

dbcrypt 项目封面
Stars
20
Forks
7
最近推送(UTC)
2021年3月29日
项目状态
未归档
Erlantz Oniga GitHub avatar
GITHUB User

Erlantz Oniga ↗

Plain ConceptsBilbao, Spain
语言DartShell

技术话题

此仓库发布的插件

使用的依赖

依赖清单 2 项

原始 README

以下为英文项目原文快照,最新内容请访问 GitHub。

展开 / 收起项目 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