All Projects → JamesBroadberry → deno-bcrypt

JamesBroadberry / deno-bcrypt

Licence: ISC license
A port of jBCrypt to TypeScript for use as a Deno module

Programming Languages

typescript
32286 projects

Projects that are alternatives of or similar to deno-bcrypt

crypthash-net
CryptHash.NET is a .NET multi-target library to encrypt/decrypt/hash/encode/decode strings and files, with an optional .NET Core multiplatform console utility.
Stars: ✭ 33 (-41.07%)
Mutual labels:  hash, bcrypt
Bcrypt.net
BCrypt.Net - Bringing updates to the original bcrypt package
Stars: ✭ 422 (+653.57%)
Mutual labels:  hash, bcrypt
hash-wasm
Lightning fast hash functions using hand-tuned WebAssembly binaries
Stars: ✭ 382 (+582.14%)
Mutual labels:  hash, bcrypt
Password4j
Password4j is a user-friendly cryptographic library that supports Argon2, Bcrypt, Scrypt, PBKDF2 and various cryptographic hash functions.
Stars: ✭ 124 (+121.43%)
Mutual labels:  hash, bcrypt
bcrypt
BCrypt is a password hashing function
Stars: ✭ 138 (+146.43%)
Mutual labels:  hash, bcrypt
BruteForce
A simple brute forcer written in GO for SHA1, SHA256, SHA512, MD5 and bcrypt
Stars: ✭ 49 (-12.5%)
Mutual labels:  hash, bcrypt
bcrypt
Swift implementation of the BCrypt password hashing function
Stars: ✭ 30 (-46.43%)
Mutual labels:  hash, bcrypt
Bcrypt
A Java standalone implementation of the bcrypt password hash function. Based on the Blowfish cipher it is the default password hash algorithm for OpenBSD and other systems including some Linux distributions. Includes a CLI Tool.
Stars: ✭ 207 (+269.64%)
Mutual labels:  hash, bcrypt
Scrypt
A .NET implementation of scrypt password hash algorithm.
Stars: ✭ 90 (+60.71%)
Mutual labels:  hash, bcrypt
bookshelf-secure-password
A Bookshelf.js plugin for handling secure passwords
Stars: ✭ 24 (-57.14%)
Mutual labels:  hash, bcrypt
phc-crypto
Hashing algorithms simplified (supports Argon2, Bcrypt, Scrypt, and PBKDF2)
Stars: ✭ 22 (-60.71%)
Mutual labels:  hash, bcrypt
sirdez
Glorious Binary Serialization and Deserialization for TypeScript.
Stars: ✭ 20 (-64.29%)
Mutual labels:  deno
rust-sthash
Very fast cryptographic hashing for large messages.
Stars: ✭ 61 (+8.93%)
Mutual labels:  hash
spring-mvc-ex
SpringMVC 게시판 구현 : 연습예제
Stars: ✭ 17 (-69.64%)
Mutual labels:  bcrypt
create-xc-app
⚡️ Create a project in seconds!
Stars: ✭ 15 (-73.21%)
Mutual labels:  deno
metrohash-rs
Rust MetroHash
Stars: ✭ 45 (-19.64%)
Mutual labels:  hash
deno doc
Documentation generator for Deno
Stars: ✭ 162 (+189.29%)
Mutual labels:  deno
monkey-master
A deno tool for buying hot GPUs in JD, such as RTX3080 rx6800, a thick-skinned orange!
Stars: ✭ 180 (+221.43%)
Mutual labels:  deno
wasm
fast wasm modules
Stars: ✭ 37 (-33.93%)
Mutual labels:  deno
postgres-deno
A PostgreSQL extension for Deno: run Typescript in PostgreSQL functions and triggers.
Stars: ✭ 87 (+55.36%)
Mutual labels:  deno

BCrypt

deno doc release ci

This is a port from jBCrypt to TypeScript for use in Deno.

It has zero third-party dependencies.

Running in sync requires no permissions. Running in async functionality requires --allow-net

Import

If you don't want to specify a specific version and are happy to work with breaking changes, you can import this module like so:

import * as bcrypt from "https://deno.land/x/bcrypt/mod.ts";

To ensure that you've got a specific version, it's recommend to import this module specifying a specific release like so:

import * as bcrypt from "https://deno.land/x/[email protected]/mod.ts";

Usage

Async

The Async implementation requires WebWorkers which require --allow-net to import Deno standard modules from inside the Worker.

const hash = await bcrypt.hash("test");

To check a password:

const result = await bcrypt.compare("test", hash);

To hash a password with a manually generated salt:

const salt = await bcrypt.genSalt(8);
const hash = await bcrypt.hash("test", salt);

Sync/Blocking

It is not recommended to use this unless you're running a quick script since the BCrypt algorithm is computationally quite expensive. For example, if you're running a server and make multiple calls to it, other requests will be blocked. Using the Async methods are recommended.

To hash a password (with auto-generated salt):

const hash = bcrypt.hashSync("test");

To check a password:

const result = bcrypt.compareSync("test", hash);

To hash a password with a manually generated salt:

const salt = bcrypt.genSaltSync(8);
const hash = bcrypt.hashSync("test", salt);

Older versions of Deno and/or BCrypt

Older versions of Deno will require an older version of this library (specifically < 0.3.0) because of the introduction of TextEncoder. However, older version of this library require the --unstable flag when running.

Warnings

BCrypt v0.3.0 and below should NOT be used with Deno 1.23.0 or later since there's been a breaking change in how Deno interprets the code and completely bypasses the cipher. Ensure that if you're running Deno 1.23.0 or later that you're using the latest version of BCrypt.

Issues

For any bug reports or feature requests, please create an issue on GitHub.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].