Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F97987498
PhabricatorIteratedMD5PasswordHasher.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Wed, Jan 8, 07:52
Size
958 B
Mime Type
text/x-php
Expires
Fri, Jan 10, 07:52 (2 d)
Engine
blob
Format
Raw Data
Handle
23472732
Attached To
rPH Phabricator
PhabricatorIteratedMD5PasswordHasher.php
View Options
<?php
final
class
PhabricatorIteratedMD5PasswordHasher
extends
PhabricatorPasswordHasher
{
public
function
getHumanReadableName
()
{
return
pht
(
'Iterated MD5'
);
}
public
function
getHashName
()
{
return
'md5'
;
}
public
function
getHashLength
()
{
return
32
;
}
public
function
canHashPasswords
()
{
return
function_exists
(
'md5'
);
}
public
function
getInstallInstructions
()
{
// This should always be available, but do something useful anyway.
return
pht
(
'To use iterated MD5, make the md5() function available.'
);
}
public
function
getStrength
()
{
return
1.0
;
}
public
function
getHumanReadableStrength
()
{
return
pht
(
'Okay'
);
}
protected
function
getPasswordHash
(
PhutilOpaqueEnvelope
$envelope
)
{
$raw_input
=
$envelope
->
openEnvelope
();
$hash
=
$raw_input
;
for
(
$ii
=
0
;
$ii
<
1000
;
$ii
++)
{
$hash
=
md5
(
$hash
);
}
return
new
PhutilOpaqueEnvelope
(
$hash
);
}
}
Event Timeline
Log In to Comment