MIT License

项目介绍

viniciussanchez/bcrypt 是一个托管在 GitHub 上的开源项目,主要使用 Pascal 编写,采用 MIT License 许可证,目前获得 225 个 Star、56 次 Fork。

仓库全名
viniciussanchez/bcrypt
开源许可证
MIT License
Star 数
225
Fork 数
56

README 摘要

BCrypt A library to help you hash passwords. You can read about bcrypt in Wikipedia as well as in the following article: How To Safely Store A Password Installation Via Boss For ease I recommend using the Boss (Dependency Manager for Delphi) for installation, simply by running the command below on a terminal (Windows PowerShell for example): Manual If you choose to install manually, simply add the following folders…

完整内容见 GitHub 原始 README 或本页 。

常见问题

bcrypt 用什么语言开发?

主要使用 Pascal 编写,采用 MIT License 许可证,目前有 225 个 Star。

bcrypt 可以免费商用吗?

仓库采用 MIT License 许可证,可免费使用与修改,商业使用请遵守许可证条款(例如保留版权声明与许可声明)。

如何获取 bcrypt 的源码?

可以直接克隆仓库:git clone https://github.com/viniciussanchez/bcrypt.git,默认分支为 master;安装与运行步骤见仓库 README。

bcrypt 最近还在维护吗?

仓库最近一次更新为 2025年11月17日,当前没有未关闭的 Issue;Star 数为 225,可作为社区活跃度的参考。

关于

BCrypt is a password hashing function

描述取自 GitHub 官方 API,中文内容由 GitRead 中文社区 编辑团队整理。

简要分析

热度分
347
价值分
152
活跃状态
活跃

语言占比

Pascal

Release

README

BCrypt

Platforms

A library to help you hash passwords. You can read about bcrypt in Wikipedia as well as in the following article: How To Safely Store A Password

bcrypt

Installation

Via Boss

For ease I recommend using the Boss (Dependency Manager for Delphi) for installation, simply by running the command below on a terminal (Windows PowerShell for example):

boss install https://github.com/viniciussanchez/bcrypt

Manual

If you choose to install manually, simply add the following folders to your project, in Project > Options > Resource Compiler > Directories and Conditionals > Include file search path

../bcrypt/src

Usage

Generate hash

var
  LHash: string;
begin
  LHash := TBCrypt.GenerateHash(password, cost, type);
end;

Where

  • password is the password to be hashed
  • type is one of THashType.PHP, THashType.BSD, or THashType.Default, THashType.BSD is the default $2a$
  • cost is a number between 10 and 30, default is 10

Compare hash

var
  LVerify : Boolean;
begin
  LVerify := TBCrypt.CompareHash(password, hash);
end;

Where

  • password is the password to be verified
  • hash is a hash generated, similar to $2y$12$GuC.Gk2YDsp8Yvga.IuSNOWM0fxEIsAEaWC1hqEI14Wa.7Ps3iYFq

Get hash info

var
  LHashInfo: THashInfo;
  LSalt, LHash: string;
  LHashType: THashType;
  LCost: Word;
begin
  LHashInfo := TBCrypt.GetHashInfo(hash);
  LCost := LHashInfo.Cost;
  LSalt := LHashInfo.Salt;
  LHash := LHashInfo.Hash;
  LHashType := LHashInfo.&Type;

Where

  • hash is a hash generated

Needs rehash

var
  LNeeds : Boolean;
begin
  LNeeds := TBCrypt.NeedsRehash(hash, cost);
end;

Where

  • hash is a hash, similar to $2y$12$GuC.Gk2YDsp8Yvga.IuSNOWM0fxEIsAEaWC1hqEI14Wa.7Ps3iYFq
  • cost is a number between 10 and 30, default is 10

Hash Info

The characters that comprise the resultant hash are:

./ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789

Resultant hashes will be 60 characters long.

bcrypt-calculation-time

Credits

The code for this comes from a few sources:

评论

暂无评论