ademarre / binary-mcf Goto Github PK
View Code? Open in Web Editor NEWSpecification of the binary modular crypt format for password hashes.
Specification of the binary modular crypt format for password hashes.
In README.md I speculated that Modular Crypt Format may have been named by the authors of the Passlib Python library (Eli Collins), but that's probably not true.
I happened upon this commit in the FreeBSD codebase by Brandon Gillespie dated 21 January 1999: freebsd/freebsd-src@0cb1c5b
That may be the introduction of the term (not the format) to the FreeBSD code, but it's not clear if it was coined by Brandon or if it was already in use elsewhere.
I don't know where the name came from, and it is probably not important to anyone, but Passlib wasn't around back then.
Hey, what about the 2b
variant as used e.g. by https://www.npmjs.com/package/bcrypt ? Are you interested in keeping your specification up to date? I'd imagine that this variant is probably not the last time that changes are introduced.
I am currently in the process of implementing BMCF in TypeScript/JavaScript and I would like to conform to a consensually formed specification before publishing it.
My current crude implementation is https://github.com/Miladiir/simple-bcrypt/blob/2ca0440962eb3f6619f9020874f99c94dcd8565e/src/BMCF.ts#L30. The codes do not match yours currently and the order is also off, since b is the newest variant.
Just let me know what you think.
0x24
is the ASCII code for $
, which is the first character of textual MCF hashes. We can use the 0x2
three-bit scheme identifier to identify unmodified textual MCF hashes. This way, schemes which don't have proper BMCF definitions can still be stored as valid BMCF data, albeit not compactly. And it enables the usage of compact BMCF representations in scenarios where not all schemes have BMCF definitions.
This has the side effect of introducing non-canonical encodings; for schemes with BMCF definitions there would be two legal representations: (1) BMCF and (2) MCF as BMCF. Stored hashes would need to be normalized to MCF before being compared. Lookup by hash would likewise be more complicated. But are these common use cases?
0x2
is currently defined for the original $2$
Bcrypt identifier. As far as I know, this is not in use in any modern systems.
Apparently related to the Password Hashing Competition that selected Argon2 as the winner in 2015, PHC string format can be considered a subset or profile of MCF. It is more thoroughly specified than MCF. It has nice properties that enable the creation of a BMCF definition that could be reused for all PCH string format–compatible schemes:
$<id>[$<param>=<value>(,<param>=<value>)*][$<salt>[$<hash>]]
id
, param
, and value
id
and param
=
padding) as the encoding to use for the hash digestA declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.