Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 14 additions & 12 deletions Bcrypt.pas
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,8 @@ TBlowfishData= record

const
CP_UTF8 = 65001;

{$EXTERNALSYM CP_UTF8}

type
TBCrypt = class(TObject)
private
Expand Down Expand Up @@ -501,7 +502,7 @@ implementation
{
TODO: bcrypt with SHA256 pre-hashing

passlib.hash.bcrypt_sha256 - BCrypt+SHA256
passlib.hash.bcrypt_sha256 - BCrypt+SHA256
https://passlib.readthedocs.io/en/stable/lib/passlib.hash.bcrypt_sha256.html

BCrypt was developed to replace md5_crypt for BSD systems. It uses a modified version of the Blowfish stream cipher.
Expand Down Expand Up @@ -2104,8 +2105,8 @@ class function TBCrypt.PasswordStringPrep(const Source: UnicodeString): TBytes;

SASLprep (rfc4013), like StringPrep (rfc3454) both specified NFKC:

Before: Noel
After: No�l
Before: Noe¨l
After: Noël

Spaces
======
Expand Down Expand Up @@ -2610,20 +2611,20 @@ class function TBCrypt.SelfTestI: Boolean;
//http://stackoverflow.com/a/7031942/12597
begin
{
Before: A + + fi + n
Before: A + ¨ + fi + n
A: U+0041
: U+0308 Combining Diaeresis
¨: U+0308 Combining Diaeresis
fi: U+FB01 Latin Small Ligature Fi
n: U+006E

Normalized: + f + i + n
: U+00C4 Latin Capital Letter A with Diaeresis
Normalized: Ä + f + i + n
Ä: U+00C4 Latin Capital Letter A with Diaeresis
f: U+0066
i: U+0069
n: U+006E

Final UTF-8:
: 0xC3 0x84
Ä: 0xC3 0x84
f: 0x66
i: 0x69
n: 0x6E
Expand Down Expand Up @@ -2673,12 +2674,12 @@ class function TBCrypt.SelfTestJ: Boolean;

Original
A: U+0041
: U+0308 Combining Diaeresis
¨: U+0308 Combining Diaeresis
fi: U+FB01 Latin Small Ligature Fi
n: U+006E

Normalized: + f + i + n
: U+00C4 Latin Capital Letter A with Diaeresis
Normalized: Ä + f + i + n
Ä: U+00C4 Latin Capital Letter A with Diaeresis
f: U+0066
i: U+0069
n: U+006E
Expand Down Expand Up @@ -3304,3 +3305,4 @@ initialization
For more information, please refer to <http://unlicense.org/>
}
end.