| 1 | package Net::YahooMessenger::CRAM; | ||||||||||||||||||||||||||||||||||||||||||||
| 2 | |||||||||||||||||||||||||||||||||||||||||||||
| 3 | 2 | ▶ | use Digest::MD5 qw(md5); | ||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||
| 4 | 2 | ▶ | use vars qw($VERSION); | ||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||
| 5 | 2 | $VERSION = '0.02'; | |||||||||||||||||||||||||||||||||||||||||||
| 6 | 2 | ▶ | use strict; | ||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||
| 7 | |||||||||||||||||||||||||||||||||||||||||||||
| 8 | 2 | ▶ | use constant MD5_CRYPT_MAGIC_STRING => '$1$'; | ||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||
| 9 | 2 | ▶ | use constant I_TO_A64 => | ||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||
| 10 | 2 | './0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'; | |||||||||||||||||||||||||||||||||||||||||||
| 11 | |||||||||||||||||||||||||||||||||||||||||||||
| 12 | 1 | ▶ | sub new { | ||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
new: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||
| 13 | 1 | my $class = shift; | |||||||||||||||||||||||||||||||||||||||||||
| 14 | 1 | bless { | |||||||||||||||||||||||||||||||||||||||||||
| 15 | challenge_string => '', | ||||||||||||||||||||||||||||||||||||||||||||
| 16 | id => '', | ||||||||||||||||||||||||||||||||||||||||||||
| 17 | password => '', | ||||||||||||||||||||||||||||||||||||||||||||
| 18 | }, $class; | ||||||||||||||||||||||||||||||||||||||||||||
| 19 | } | ||||||||||||||||||||||||||||||||||||||||||||
| 20 | |||||||||||||||||||||||||||||||||||||||||||||
| 21 | 2 | ▶ | sub set_challenge_string { | ||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
set_challenge_string: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||
| 22 | 2 | my $self = shift; | |||||||||||||||||||||||||||||||||||||||||||
| 23 | 2 | $self->{challenge_string} = shift; | |||||||||||||||||||||||||||||||||||||||||||
| 24 | } | ||||||||||||||||||||||||||||||||||||||||||||
| 25 | |||||||||||||||||||||||||||||||||||||||||||||
| 26 | 2 | ▶ | sub set_id { | ||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
set_id: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||
| 27 | 2 | my $self = shift; | |||||||||||||||||||||||||||||||||||||||||||
| 28 | 2 | $self->{id} = shift; | |||||||||||||||||||||||||||||||||||||||||||
| 29 | } | ||||||||||||||||||||||||||||||||||||||||||||
| 30 | |||||||||||||||||||||||||||||||||||||||||||||
| 31 | 2 | ▶ | sub set_password { | ||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
set_password: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||
| 32 | 2 | my $self = shift; | |||||||||||||||||||||||||||||||||||||||||||
| 33 | 2 | $self->{password} = shift; | |||||||||||||||||||||||||||||||||||||||||||
| 34 | } | ||||||||||||||||||||||||||||||||||||||||||||
| 35 | |||||||||||||||||||||||||||||||||||||||||||||
| 36 | 2 | ▶ | sub get_response_strings { | ||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
get_response_strings: called CC=10 SCAR=30.1
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||
| 37 | 2 | my $self = shift; | |||||||||||||||||||||||||||||||||||||||||||
| 38 | 2 | my $id = $self->{id}; | |||||||||||||||||||||||||||||||||||||||||||
| 39 | 2 | my $password = $self->{password}; | |||||||||||||||||||||||||||||||||||||||||||
| 40 | 2 | my @challenge_string = split //, $self->{challenge_string}; | |||||||||||||||||||||||||||||||||||||||||||
| 41 | |||||||||||||||||||||||||||||||||||||||||||||
| 42 | 2 | ▶ | return undef unless scalar @challenge_string; | ||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||
| 43 | |||||||||||||||||||||||||||||||||||||||||||||
| 44 | 2 | my $password_hash = _to_yahoo_base64( md5($password) ); | |||||||||||||||||||||||||||||||||||||||||||
| 45 | 2 | my $crypt_hash = | |||||||||||||||||||||||||||||||||||||||||||
| 46 | _to_yahoo_base64( md5( _md5_crypt( $password, '_2S43d5f' ) ) ); | ||||||||||||||||||||||||||||||||||||||||||||
| 47 | |||||||||||||||||||||||||||||||||||||||||||||
| 48 | 2 | my $hash_string_p; | |||||||||||||||||||||||||||||||||||||||||||
| 49 | my $hash_string_c; | ||||||||||||||||||||||||||||||||||||||||||||
| 50 | |||||||||||||||||||||||||||||||||||||||||||||
| 51 | 2 | my $sv = ord( $challenge_string[15] ) % 8; | |||||||||||||||||||||||||||||||||||||||||||
| 52 | 2 | ▶ | if ( $sv == 1 || $sv == 6 ) { | ||||||||||||||||||||||||||||||||||||||||||
|
Branch: 5 branches
Condition66%2/3
$sv == 1 or $sv == 6
MC/DC50%1/2
$sv == 1 or $sv == 6
$sv == 1
$sv == 6
Truth table66%2/3
A or B
A= $sv == 1B= $sv == 6
| |||||||||||||||||||||||||||||||||||||||||||||
| 53 | 1 | my $checksum = $challenge_string[ ord( $challenge_string[9] ) % 16 ]; | |||||||||||||||||||||||||||||||||||||||||||
| 54 | 1 | $hash_string_p = sprintf '%s%s%s%s', | |||||||||||||||||||||||||||||||||||||||||||
| 55 | $checksum, $id, join( '', @challenge_string ), $password_hash; | ||||||||||||||||||||||||||||||||||||||||||||
| 56 | 1 | $hash_string_c = sprintf '%s%s%s%s', | |||||||||||||||||||||||||||||||||||||||||||
| 57 | $checksum, $id, join( '', @challenge_string ), $crypt_hash; | ||||||||||||||||||||||||||||||||||||||||||||
| 58 | } | ||||||||||||||||||||||||||||||||||||||||||||
| 59 | ▶ | elsif ( $sv == 2 || $sv == 7 ) { | |||||||||||||||||||||||||||||||||||||||||||
|
Condition33%1/3
$sv == 2 or $sv == 7
MC/DC0%0/2
$sv == 2 or $sv == 7
$sv == 2
$sv == 7
Truth table33%1/3
A or B
A= $sv == 2B= $sv == 7
| |||||||||||||||||||||||||||||||||||||||||||||
| 60 | 1 | my $checksum = $challenge_string[ ord( $challenge_string[15] ) % 16 ]; | |||||||||||||||||||||||||||||||||||||||||||
| 61 | 1 | $hash_string_p = sprintf '%s%s%s%s', | |||||||||||||||||||||||||||||||||||||||||||
| 62 | $checksum, join( '', @challenge_string ), $password_hash, $id; | ||||||||||||||||||||||||||||||||||||||||||||
| 63 | 1 | $hash_string_c = sprintf '%s%s%s%s', | |||||||||||||||||||||||||||||||||||||||||||
| 64 | $checksum, join( '', @challenge_string ), $crypt_hash, $id; | ||||||||||||||||||||||||||||||||||||||||||||
| 65 | } | ||||||||||||||||||||||||||||||||||||||||||||
| 66 | elsif ( $sv == 3 ) { | ||||||||||||||||||||||||||||||||||||||||||||
| 67 | 0 | my $checksum = $challenge_string[ ord( $challenge_string[1] ) % 16 ]; | |||||||||||||||||||||||||||||||||||||||||||
| 68 | 0 | $hash_string_p = sprintf '%s%s%s%s', | |||||||||||||||||||||||||||||||||||||||||||
| 69 | $checksum, $id, $password_hash, join( '', @challenge_string ); | ||||||||||||||||||||||||||||||||||||||||||||
| 70 | 0 | $hash_string_c = sprintf '%s%s%s%s', | |||||||||||||||||||||||||||||||||||||||||||
| 71 | $checksum, $id, $crypt_hash, join( '', @challenge_string ); | ||||||||||||||||||||||||||||||||||||||||||||
| 72 | } | ||||||||||||||||||||||||||||||||||||||||||||
| 73 | elsif ( $sv == 4 ) { | ||||||||||||||||||||||||||||||||||||||||||||
| 74 | 0 | my $checksum = $challenge_string[ ord( $challenge_string[3] ) % 16 ]; | |||||||||||||||||||||||||||||||||||||||||||
| 75 | 0 | $hash_string_p = sprintf '%s%s%s%s', | |||||||||||||||||||||||||||||||||||||||||||
| 76 | $checksum, $password_hash, join( '', @challenge_string ), $id; | ||||||||||||||||||||||||||||||||||||||||||||
| 77 | 0 | $hash_string_c = sprintf '%s%s%s%s', | |||||||||||||||||||||||||||||||||||||||||||
| 78 | $checksum, $crypt_hash, join( '', @challenge_string ), $id; | ||||||||||||||||||||||||||||||||||||||||||||
| 79 | } | ||||||||||||||||||||||||||||||||||||||||||||
| 80 | ▶ | elsif ( $sv == 0 || $sv == 5 ) { | |||||||||||||||||||||||||||||||||||||||||||
|
Condition0%0/3
$sv == 0 or $sv == 5
MC/DC0%0/2
$sv == 0 or $sv == 5
$sv == 0
$sv == 5
Truth table0%0/3
A or B
A= $sv == 0B= $sv == 5
| |||||||||||||||||||||||||||||||||||||||||||||
| 81 | 0 | my $checksum = $challenge_string[ ord( $challenge_string[7] ) % 16 ]; | |||||||||||||||||||||||||||||||||||||||||||
| 82 | 0 | $hash_string_p = sprintf '%s%s%s%s', | |||||||||||||||||||||||||||||||||||||||||||
| 83 | $checksum, $password_hash, $id, join( '', @challenge_string ); | ||||||||||||||||||||||||||||||||||||||||||||
| 84 | 0 | $hash_string_c = sprintf '%s%s%s%s', | |||||||||||||||||||||||||||||||||||||||||||
| 85 | $checksum, $crypt_hash, $id, join( '', @challenge_string ); | ||||||||||||||||||||||||||||||||||||||||||||
| 86 | } | ||||||||||||||||||||||||||||||||||||||||||||
| 87 | |||||||||||||||||||||||||||||||||||||||||||||
| 88 | 2 | my $result6 = _to_yahoo_base64( md5($hash_string_p) ); | |||||||||||||||||||||||||||||||||||||||||||
| 89 | 2 | my $result96 = _to_yahoo_base64( md5($hash_string_c) ); | |||||||||||||||||||||||||||||||||||||||||||
| 90 | 2 | return ( $result6, $result96 ); | |||||||||||||||||||||||||||||||||||||||||||
| 91 | } | ||||||||||||||||||||||||||||||||||||||||||||
| 92 | |||||||||||||||||||||||||||||||||||||||||||||
| 93 | 8 | ▶ | sub _to_yahoo_base64 { | ||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_to_yahoo_base64: called CC=2 SCAR=7.0
| |||||||||||||||||||||||||||||||||||||||||||||
| 94 | 8 | pos( $_[0] ) = 0; | |||||||||||||||||||||||||||||||||||||||||||
| 95 | |||||||||||||||||||||||||||||||||||||||||||||
| 96 | 8 | my $res = join '', | |||||||||||||||||||||||||||||||||||||||||||
| 97 | map( pack( 'u', $_ ) =~ /^.(\S*)/, ( $_[0] =~ /(.{1,45})/gs ) ); | ||||||||||||||||||||||||||||||||||||||||||||
| 98 | 8 | $res =~ tr{` -_}{AA-Za-z0-9\._}; | |||||||||||||||||||||||||||||||||||||||||||
| 99 | |||||||||||||||||||||||||||||||||||||||||||||
| 100 | 8 | my $padding = ( 3 - length( $_[0] ) % 3 ) % 3; | |||||||||||||||||||||||||||||||||||||||||||
| 101 | 8 | ▶ | $res =~ s/.{$padding}$/'-' x $padding/e if $padding; | ||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||
| 102 | 8 | return $res; | |||||||||||||||||||||||||||||||||||||||||||
| 103 | } | ||||||||||||||||||||||||||||||||||||||||||||
| 104 | |||||||||||||||||||||||||||||||||||||||||||||
| 105 | 12 | ▶ | sub _to64 { | ||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_to64: called CC=2 SCAR=6.9
| |||||||||||||||||||||||||||||||||||||||||||||
| 106 | 12 | my ( $v, $n ) = @_; | |||||||||||||||||||||||||||||||||||||||||||
| 107 | 12 | my $ret = ''; | |||||||||||||||||||||||||||||||||||||||||||
| 108 | 12 | ▶ | while ( --$n >= 0 ) { | ||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||
| 109 | 44 | $ret .= substr( I_TO_A64, $v & 0x3f, 1 ); | |||||||||||||||||||||||||||||||||||||||||||
| 110 | 44 | $v >>= 6; | |||||||||||||||||||||||||||||||||||||||||||
| 111 | } | ||||||||||||||||||||||||||||||||||||||||||||
| 112 | 12 | $ret; | |||||||||||||||||||||||||||||||||||||||||||
| 113 | } | ||||||||||||||||||||||||||||||||||||||||||||
| 114 | |||||||||||||||||||||||||||||||||||||||||||||
| 115 | 2 | ▶ | sub _md5_crypt { | ||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_md5_crypt: called CC=10 SCAR=23.0
| |||||||||||||||||||||||||||||||||||||||||||||
| 116 | 2 | my $pw = shift; | |||||||||||||||||||||||||||||||||||||||||||
| 117 | 2 | my $salt = shift; | |||||||||||||||||||||||||||||||||||||||||||
| 118 | |||||||||||||||||||||||||||||||||||||||||||||
| 119 | 2 | my $Magic = MD5_CRYPT_MAGIC_STRING; | |||||||||||||||||||||||||||||||||||||||||||
| 120 | 2 | $salt =~ s/^\Q$Magic//; | |||||||||||||||||||||||||||||||||||||||||||
| 121 | 2 | $salt =~ s/^(.*)\$.*$/$1/; | |||||||||||||||||||||||||||||||||||||||||||
| 122 | 2 | $salt = substr $salt, 0, 8; | |||||||||||||||||||||||||||||||||||||||||||
| 123 | |||||||||||||||||||||||||||||||||||||||||||||
| 124 | 2 | my $ctx = new Digest::MD5; | |||||||||||||||||||||||||||||||||||||||||||
| 125 | 2 | $ctx->add($pw); | |||||||||||||||||||||||||||||||||||||||||||
| 126 | 2 | $ctx->add($Magic); | |||||||||||||||||||||||||||||||||||||||||||
| 127 | 2 | $ctx->add($salt); | |||||||||||||||||||||||||||||||||||||||||||
| 128 | |||||||||||||||||||||||||||||||||||||||||||||
| 129 | 2 | my $final = new Digest::MD5; | |||||||||||||||||||||||||||||||||||||||||||
| 130 | 2 | $final->add($pw); | |||||||||||||||||||||||||||||||||||||||||||
| 131 | 2 | $final->add($salt); | |||||||||||||||||||||||||||||||||||||||||||
| 132 | 2 | $final->add($pw); | |||||||||||||||||||||||||||||||||||||||||||
| 133 | 2 | $final = $final->digest; | |||||||||||||||||||||||||||||||||||||||||||
| 134 | |||||||||||||||||||||||||||||||||||||||||||||
| 135 | 2 | ▶ | for ( my $pl = length($pw) ; $pl > 0 ; $pl -= 16 ) { | ||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||
| 136 | 2 | ▶ | $ctx->add( substr( $final, 0, $pl > 16 ? 16 : $pl ) ); | ||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||
| 137 | } | ||||||||||||||||||||||||||||||||||||||||||||
| 138 | |||||||||||||||||||||||||||||||||||||||||||||
| 139 | 2 | ▶ | for ( my $i = length($pw) ; $i ; $i >>= 1 ) { | ||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||
| 140 | 7 | ▶ | if ( $i & 1 ) { | ||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||
| 141 | 3 | $ctx->add( pack( "C", 0 ) ); | |||||||||||||||||||||||||||||||||||||||||||
| 142 | } | ||||||||||||||||||||||||||||||||||||||||||||
| 143 | else { | ||||||||||||||||||||||||||||||||||||||||||||
| 144 | 4 | $ctx->add( substr( $pw, 0, 1 ) ); | |||||||||||||||||||||||||||||||||||||||||||
| 145 | } | ||||||||||||||||||||||||||||||||||||||||||||
| 146 | } | ||||||||||||||||||||||||||||||||||||||||||||
| 147 | |||||||||||||||||||||||||||||||||||||||||||||
| 148 | 2 | $final = $ctx->digest; | |||||||||||||||||||||||||||||||||||||||||||
| 149 | |||||||||||||||||||||||||||||||||||||||||||||
| 150 | 2 | ▶ | for ( my $i = 0 ; $i < 1000 ; $i++ ) { | ||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||
| 151 | 2000 | my $ctx1 = new Digest::MD5; | |||||||||||||||||||||||||||||||||||||||||||
| 152 | 2000 | ▶ | if ( $i & 1 ) { | ||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||
| 153 | 1000 | $ctx1->add($pw); | |||||||||||||||||||||||||||||||||||||||||||
| 154 | } | ||||||||||||||||||||||||||||||||||||||||||||
| 155 | else { | ||||||||||||||||||||||||||||||||||||||||||||
| 156 | 1000 | $ctx1->add( substr( $final, 0, 16 ) ); | |||||||||||||||||||||||||||||||||||||||||||
| 157 | } | ||||||||||||||||||||||||||||||||||||||||||||
| 158 | 2000 | ▶ | if ( $i % 3 ) { | ||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||
| 159 | 1332 | $ctx1->add($salt); | |||||||||||||||||||||||||||||||||||||||||||
| 160 | } | ||||||||||||||||||||||||||||||||||||||||||||
| 161 | 2000 | ▶ | if ( $i % 7 ) { | ||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||
| 162 | 1714 | $ctx1->add($pw); | |||||||||||||||||||||||||||||||||||||||||||
| 163 | } | ||||||||||||||||||||||||||||||||||||||||||||
| 164 | 2000 | ▶ | if ( $i & 1 ) { | ||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||
| 165 | 1000 | $ctx1->add( substr( $final, 0, 16 ) ); | |||||||||||||||||||||||||||||||||||||||||||
| 166 | } | ||||||||||||||||||||||||||||||||||||||||||||
| 167 | else { | ||||||||||||||||||||||||||||||||||||||||||||
| 168 | 1000 | $ctx1->add($pw); | |||||||||||||||||||||||||||||||||||||||||||
| 169 | } | ||||||||||||||||||||||||||||||||||||||||||||
| 170 | 2000 | $final = $ctx1->digest; | |||||||||||||||||||||||||||||||||||||||||||
| 171 | } | ||||||||||||||||||||||||||||||||||||||||||||
| 172 | |||||||||||||||||||||||||||||||||||||||||||||
| 173 | 2 | my $passwd = ''; | |||||||||||||||||||||||||||||||||||||||||||
| 174 | 2 | $passwd .= _to64( | |||||||||||||||||||||||||||||||||||||||||||
| 175 | int( unpack( "C", ( substr( $final, 0, 1 ) ) ) << 16 ) | | ||||||||||||||||||||||||||||||||||||||||||||
| 176 | int( unpack( "C", ( substr( $final, 6, 1 ) ) ) << 8 ) | | ||||||||||||||||||||||||||||||||||||||||||||
| 177 | int( unpack( "C", ( substr( $final, 12, 1 ) ) ) ), | ||||||||||||||||||||||||||||||||||||||||||||
| 178 | 4 | ||||||||||||||||||||||||||||||||||||||||||||
| 179 | ); | ||||||||||||||||||||||||||||||||||||||||||||
| 180 | 2 | $passwd .= _to64( | |||||||||||||||||||||||||||||||||||||||||||
| 181 | int( unpack( "C", ( substr( $final, 1, 1 ) ) ) << 16 ) | | ||||||||||||||||||||||||||||||||||||||||||||
| 182 | int( unpack( "C", ( substr( $final, 7, 1 ) ) ) << 8 ) | | ||||||||||||||||||||||||||||||||||||||||||||
| 183 | int( unpack( "C", ( substr( $final, 13, 1 ) ) ) ), | ||||||||||||||||||||||||||||||||||||||||||||
| 184 | 4 | ||||||||||||||||||||||||||||||||||||||||||||
| 185 | ); | ||||||||||||||||||||||||||||||||||||||||||||
| 186 | 2 | $passwd .= _to64( | |||||||||||||||||||||||||||||||||||||||||||
| 187 | int( unpack( "C", ( substr( $final, 2, 1 ) ) ) << 16 ) | | ||||||||||||||||||||||||||||||||||||||||||||
| 188 | int( unpack( "C", ( substr( $final, 8, 1 ) ) ) << 8 ) | | ||||||||||||||||||||||||||||||||||||||||||||
| 189 | int( unpack( "C", ( substr( $final, 14, 1 ) ) ) ), | ||||||||||||||||||||||||||||||||||||||||||||
| 190 | 4 | ||||||||||||||||||||||||||||||||||||||||||||
| 191 | ); | ||||||||||||||||||||||||||||||||||||||||||||
| 192 | 2 | $passwd .= _to64( | |||||||||||||||||||||||||||||||||||||||||||
| 193 | int( unpack( "C", ( substr( $final, 3, 1 ) ) ) << 16 ) | | ||||||||||||||||||||||||||||||||||||||||||||
| 194 | int( unpack( "C", ( substr( $final, 9, 1 ) ) ) << 8 ) | | ||||||||||||||||||||||||||||||||||||||||||||
| 195 | int( unpack( "C", ( substr( $final, 15, 1 ) ) ) ), | ||||||||||||||||||||||||||||||||||||||||||||
| 196 | 4 | ||||||||||||||||||||||||||||||||||||||||||||
| 197 | ); | ||||||||||||||||||||||||||||||||||||||||||||
| 198 | 2 | $passwd .= _to64( | |||||||||||||||||||||||||||||||||||||||||||
| 199 | int( unpack( "C", ( substr( $final, 4, 1 ) ) ) << 16 ) | | ||||||||||||||||||||||||||||||||||||||||||||
| 200 | int( unpack( "C", ( substr( $final, 10, 1 ) ) ) << 8 ) | | ||||||||||||||||||||||||||||||||||||||||||||
| 201 | int( unpack( "C", ( substr( $final, 5, 1 ) ) ) ), | ||||||||||||||||||||||||||||||||||||||||||||
| 202 | 4 | ||||||||||||||||||||||||||||||||||||||||||||
| 203 | ); | ||||||||||||||||||||||||||||||||||||||||||||
| 204 | 2 | $passwd .= _to64( int( unpack( "C", substr( $final, 11, 1 ) ) ), 2 ); | |||||||||||||||||||||||||||||||||||||||||||
| 205 | |||||||||||||||||||||||||||||||||||||||||||||
| 206 | 2 | return $Magic . $salt . '$' . $passwd; | |||||||||||||||||||||||||||||||||||||||||||
| 207 | } | ||||||||||||||||||||||||||||||||||||||||||||
| 208 | |||||||||||||||||||||||||||||||||||||||||||||
| 209 | 2 | 1; | |||||||||||||||||||||||||||||||||||||||||||
| 210 | __END__ | ||||||||||||||||||||||||||||||||||||||||||||