migratetoflarum / old-passwords

Re-hash passwords from an old platform on the fly
https://discuss.flarum.org/d/8631
MIT License
8 stars 4 forks source link

Support UNB Type hashes #4

Closed splitbrain closed 4 years ago

splitbrain commented 4 years ago

Hi, I'm in the process of migrating a Forum from Unclassified Newsboard to Flarum. They rolled their own MD5 based hashing and it would be awesome if your extension could support it.

I implemented their hashing method for DokuWiki here: https://github.com/splitbrain/dokuwiki/blob/fe5b5b2a3afab46acfb4124abcb9cc73412ee07a/inc/PassHash.php#L348-L367

clarkwinkelmann commented 4 years ago

Hi! Thanks for the report.

Would you be interested in submitting a PR yourself ?

Otherwise I'll happily add the support when I find some time, hopefully next week. Could you provide me with some example data for tests ? Is the salt stored in a separate column, or it it always part of the hashed value ? Could you provide me with an example for the password correcthorsebatterystaple and a given salt like 12345678 ?

clarkwinkelmann commented 4 years ago

I have implemented the hasher and tagged version 0.5.0.

Let me know how it works! Thanks for the help with the example code and test!

splitbrain commented 4 years ago

Thanks for merging. Any chance you could update the version for composer?

clarkwinkelmann commented 4 years ago

It's tagged as version 0.5.0. You should be able to install it with composer require migratetoflarum/old-passwords.

Let me know if that's not working.

splitbrain commented 4 years ago

worked. Thanks a lot!