@@ -41,7 +41,7 @@ |
||
41 | 41 | $pad = self::paddingString(Str::strlen($input), $blocksize); |
42 | 42 | |
43 | 43 | // Return input + padding |
44 | - return $input . $pad; |
|
44 | + return $input.$pad; |
|
45 | 45 | } |
46 | 46 | |
47 | 47 | /** |
@@ -1,6 +1,6 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | -require __DIR__ . '/vendor/autoload.php'; |
|
3 | +require __DIR__.'/vendor/autoload.php'; |
|
4 | 4 | |
5 | 5 | // backward compatibility |
6 | 6 | if (!class_exists('\PHPUnit\Framework\TestCase')) { |
@@ -53,7 +53,7 @@ |
||
53 | 53 | $length = Str::strlen($input); |
54 | 54 | |
55 | 55 | foreach ($chunks as $i => &$chunk) { |
56 | - $chunk = $chunk ^ \hash_hmac($algo, $password . $length, $i, true); |
|
56 | + $chunk = $chunk ^ \hash_hmac($algo, $password.$length, $i, true); |
|
57 | 57 | } |
58 | 58 | |
59 | 59 | return \implode($chunks); |
@@ -53,7 +53,7 @@ discard block |
||
53 | 53 | $hash = \hash_pbkdf2('sha256', $password, $salt, $cost, 0, true); |
54 | 54 | |
55 | 55 | // Return the salt + cost blob + hmac |
56 | - return $salt . self::costEncrypt($cost, $salt, $password) . $hash; |
|
56 | + return $salt.self::costEncrypt($cost, $salt, $password).$hash; |
|
57 | 57 | } |
58 | 58 | |
59 | 59 | /** |
@@ -68,7 +68,7 @@ discard block |
||
68 | 68 | { |
69 | 69 | $packed = pack('L*', $cost); |
70 | 70 | |
71 | - return Otp::crypt($packed, ($password . $salt), 'sha256'); |
|
71 | + return Otp::crypt($packed, ($password.$salt), 'sha256'); |
|
72 | 72 | } |
73 | 73 | |
74 | 74 | /** |
@@ -99,7 +99,7 @@ discard block |
||
99 | 99 | |
100 | 100 | // Get the encrypted cost bytes |
101 | 101 | $cost = Str::substr($hash, 16, 4); |
102 | - $cost = Otp::crypt($cost, ($password . $salt), 'sha256'); |
|
102 | + $cost = Otp::crypt($cost, ($password.$salt), 'sha256'); |
|
103 | 103 | $cost = unpack('L*', $cost)[1]; |
104 | 104 | |
105 | 105 | // Return the boolean equivalence |
@@ -57,7 +57,7 @@ discard block |
||
57 | 57 | $cost = \unpack('L*', $itr ^ \hash_hmac(static::CHKSUM, $ivr, $pass, true))[1]; |
58 | 58 | |
59 | 59 | // Derive key from password |
60 | - $key = \hash_pbkdf2(static::CHKSUM, ($pass . static::CIPHER), $ivr, $cost, 0, true); |
|
60 | + $key = \hash_pbkdf2(static::CHKSUM, ($pass.static::CIPHER), $ivr, $cost, 0, true); |
|
61 | 61 | |
62 | 62 | // Calculate verification checksum |
63 | 63 | $chk = \hash_hmac(static::CHKSUM, $msg, $key, true); |
@@ -86,7 +86,7 @@ discard block |
||
86 | 86 | |
87 | 87 | // Derive key from password with hash_pbkdf2 function. |
88 | 88 | // Append CIPHER to password beforehand so that cross-method decryptions will fail at checksum step |
89 | - $key = \hash_pbkdf2(static::CHKSUM, ($pass . static::CIPHER), $ivr, $cost, 0, true); |
|
89 | + $key = \hash_pbkdf2(static::CHKSUM, ($pass.static::CIPHER), $ivr, $cost, 0, true); |
|
90 | 90 | |
91 | 91 | // Encrypt the plaintext data |
92 | 92 | $msg = OpensslWrapper::encrypt($data, static::CIPHER, $key, $ivr); |
@@ -98,6 +98,6 @@ discard block |
||
98 | 98 | $chk = \hash_hmac(static::CHKSUM, $msg, $key, true); |
99 | 99 | |
100 | 100 | // Return iv + checksum + iterations + cyphertext |
101 | - return $ivr . $chk . $itr . $msg; |
|
101 | + return $ivr.$chk.$itr.$msg; |
|
102 | 102 | } |
103 | 103 | } |