Download the PHP package migratetoflarum/old-passwords without Composer
On this page you can find all versions of the php package migratetoflarum/old-passwords. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download migratetoflarum/old-passwords
More information about migratetoflarum/old-passwords
Files in migratetoflarum/old-passwords
Package old-passwords
Short Description Re-hash passwords from an old platform on the fly
License MIT
Informations about the package old-passwords
Old Passwords extension by MigrateToFlarum
This extension allows your users to continue to login with their passwords from a previous platform that was using a different hashing algorithm than Flarum.
Installation
Updating
Documentation
This extension is meant to be used alongside a migration script. There are no settings accessible from the UI (you still need to keep the extension enabled for it to work !)
The migrations add a migratetoflarum_old_password
column to your users
table, which can contain old credentials hashed with different algorithms than bcrypt.
This column must contain a valid JSON-serialized object as described below or null
to not provide an old password.
Once a user was correctly identified via an old password, the password is re-hashed with bcrypt, stored in Flarum password
field and the migratetoflarum_old_password
column is set to null
.
If you somehow manage to have both a bcrypt-hashed password
and migratetoflarum_old_password
value in the database for a user, then the user will be able to login with either password. The password used will override the value of password
and migratetoflarum_old_password
will be set to null
.
Compatible hashings
Don't hesitate to open an issue or a PR to suggest a new hashing method. More will be added soon.
While some of these options might be convenient for testing purposes or other shenanigans, some can put your old password's users at risk in case of a breach. These options are labelled with /!\ Insecure. Just as the whole extension, use these at your own risks !
Plain
/!\ Insecure: you can directly salt and hash plain text passwords with bcrypt and store them in password
instead.
Example:
Bcrypt
It probably doesn't make sense to store a bcrypt hash here instead of the password
column, but it is possible.
Example (password = bcrypt(correcthorsebatterystaple)
):
Phpass
Reads portable and bcrypt hashes created with Phpass.
In order to use this type you need to install the hautelook/phpass
package:
Example (password = portablehash(correcthorsebatterystaple)
):
MD5
/!\ Insecure: with or without a salt MD5 stays weak. Consider using the md5-bcrypt
option below.
Example (password = md5(correcthorsebatterystaple)
):
Example with salt before the password (password = md5(12345678correcthorsebatterystaple)
):
Example with salt after the password (password = md5(correcthorsebatterystaple12345678)
):
MD5-Bcrypt
This is the preferred method to import MD5 hashes. You have to run every old MD5 password hash through bcrypt and store the resulting value in Flarum.
Example (password = bcrypt(md5(correcthorsebatterystaple))
):
Example (password = bcrypt(md5(12345678correcthorsebatterystaple))
):
You can use salts the same way as described for MD5.
MD5-Double
/!\ Insecure: consider using the md5-double-bcrypt
option below.
Same as MD5, but the password is hashed a first time before the salt is added.
Example (password = md5(12345678 + md5(correcthorsebatterystaple))
):
You can use salts the same way as described for MD5.
MD5-Double-Bcrypt
Same as MD5-Double, with an extra bcrypt layer.
Example (password = bcrypt(md5(12345678 + md5(correcthorsebatterystaple)))
):
SHA1
/!\ Insecure: with or without a salt SHA1 stays weak. Consider using the sha1-bcrypt
option below.
Example (password = sha1(correcthorsebatterystaple)
):
You can use salts the same way as described for MD5.
SHA1-Bcrypt
This is the preferred method to import SHA1 hashes. You have to run every old SHA1 password hash through bcrypt and store the resulting value in Flarum.
Example (password = bcrypt(sha1(correcthorsebatterystaple))
):
You can use salts the same way as described for MD5.
SHA1-Double
/!\ Insecure: consider using the sha1-double-bcrypt
option below.
Same as md5-double
for sha1.
Example (password = sha1(12345678 + sha1(correcthorsebatterystaple))
):
SHA1-Double-Bcrypt
Same as md5-double-bcrypt
for sha1.
Example (password = bcrypt(sha1(12345678 + sha1(correcthorsebatterystaple)))
):
KMD5
MD5-based hash used by Unclassified NewsBoard.
Example (password = first16bytes(md5(correcthorsebatterystaple)) + 12 + last16bytes(md5(correcthorsebatterystaple))
):
A MigrateToFlarum extension
This is a free extension by MigrateToFlarum, an online forum migration tool (launching soon). Follow us on Twitter for updates https://twitter.com/MigrateToFlarum
Need a custom Flarum extension ? Contact Clark Winkelmann !