File tree Expand file tree Collapse file tree 2 files changed +99
-0
lines changed Expand file tree Collapse file tree 2 files changed +99
-0
lines changed Original file line number Diff line number Diff line change 1+ <?php
2+ /**
3+ * Nextcloud - user_sql
4+ *
5+ * @copyright 2018 Marcin Łojewski <dev@mlojewski.me>
6+ * @author Marcin Łojewski <dev@mlojewski.me>
7+ *
8+ * This program is free software: you can redistribute it and/or modify
9+ * it under the terms of the GNU Affero General Public License as
10+ * published by the Free Software Foundation, either version 3 of the
11+ * License, or (at your option) any later version.
12+ *
13+ * This program is distributed in the hope that it will be useful,
14+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
15+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16+ * GNU Affero General Public License for more details.
17+ *
18+ * You should have received a copy of the GNU Affero General Public License
19+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
20+ */
21+
22+ namespace OCA \UserSQL \Crypto ;
23+
24+ /**
25+ * MD5(MD5+salt) hash implementation.
26+ *
27+ * @author Sebijk (b1gMail.eu)
28+ */
29+ class MD5MD5Salt extends AbstractAlgorithm
30+ {
31+ /**
32+ * @inheritdoc
33+ */
34+ public function getPasswordHash ($ password , $ salt = null )
35+ {
36+ if (is_null ($ salt )) {
37+ return false ;
38+ }
39+
40+ return md5 (md5 ($ password ).$ salt );
41+ }
42+
43+ /**
44+ * @inheritdoc
45+ */
46+ protected function getAlgorithmName ()
47+ {
48+ return "MD5 (MD5+Salt) " ;
49+ }
50+ }
Original file line number Diff line number Diff line change 1+ <?php
2+ /**
3+ * Nextcloud - user_sql
4+ *
5+ * @copyright 2018 Marcin Łojewski <dev@mlojewski.me>
6+ * @author Marcin Łojewski <dev@mlojewski.me>
7+ *
8+ * This program is free software: you can redistribute it and/or modify
9+ * it under the terms of the GNU Affero General Public License as
10+ * published by the Free Software Foundation, either version 3 of the
11+ * License, or (at your option) any later version.
12+ *
13+ * This program is distributed in the hope that it will be useful,
14+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
15+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16+ * GNU Affero General Public License for more details.
17+ *
18+ * You should have received a copy of the GNU Affero General Public License
19+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
20+ */
21+
22+ namespace OCA \UserSQL \Crypto ;
23+
24+ /**
25+ * MyBB hash implementation.
26+ *
27+ * @author Sebijk
28+ */
29+ class MyBB extends AbstractAlgorithm
30+ {
31+ /**
32+ * @inheritdoc
33+ */
34+ public function getPasswordHash ($ password , $ salt = null )
35+ {
36+ if (is_null ($ salt )) {
37+ return false ;
38+ }
39+ return md5 (md5 ($ salt ).md5 ($ password ));
40+ }
41+
42+ /**
43+ * @inheritdoc
44+ */
45+ protected function getAlgorithmName ()
46+ {
47+ return "MyBB " ;
48+ }
49+ }
You can’t perform that action at this time.
0 commit comments