Search packages, repositories and app categories

Package detailsv2.0.0

dbcrypt

A port of jBCrypt to Dart. It allows to encrypt passwords using BCrypt with a configurable work factor and check passwords.

AndroidiOSWebmacOSWindowsLinux
30-day downloads
17.7K
Likes
47
Pub points
140

Install package

flutter pub add dbcrypt

Package Overview

Package selection guidance compiled from public package information, community data, and project usage.

dbcrypt is a Dart implementation of jBCrypt, providing secure password hashing using the BCrypt algorithm. It supports configurable work factors to balance security and performance, enabling safe storage of passwords. The package allows users to hash passwords during registration and verify them during authentication. Designed for cross-platform use, it works seamlessly across Android, iOS, Web, macOS, Windows, and Linux. Ideal for applications requiring robust password protection with minimal setup.

Use cases

  • Secure password storage
  • User authentication
  • Password hashing in web apps
  • Cross-platform app security
  • API backend password verification
  • Mobile app login systems

Key features

  • BCrypt password hashing
  • Configurable work factor
  • Cross-platform compatibility
  • Simple hash and verify API
  • Open-source and actively maintained
  • Supports all major platforms

Suitable for

  • Web and mobile apps needing secure auth
  • Backend services handling user credentials
  • Applications requiring compliance with security standards
  • Developers using Dart for secure password management
  • Projects prioritizing cryptographic best practices

Considerations

  • Requires careful selection of work factor for performance vs. security
  • Not suitable for encrypting sensitive data beyond passwords
  • Depends on external library stability
  • Limited to password-related use cases
  • No built-in salt management (handled internally)

Original README

Original README snapshot from the linked source repository. Visit the repository for the latest content.

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

Categories

Source repository

Projects using this package

No data available yet.