Skip to content
This repository was archived by the owner on Oct 5, 2022. It is now read-only.

Commit e02f4c4

Browse files
committed
There is no value in a high work order here. An HMAC-SHA256 is used in a single run in most other protocols. If there is a need for a work order, it should be used on the key.
Completion of previous commit
1 parent 62c323b commit e02f4c4

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/phpSec/Crypt/Crypto.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ public function encrypt($data, $key) {
111111
$encrypted['iv'] = base64_encode($iv); /* Initialization vector, just a bunch of randomness. */
112112
$encrypted['cdata'] = base64_encode(mcrypt_generic($td, $serializedData)); /* The encrypted data. */
113113
$encrypted['mac'] = base64_encode( /* The message authentication code. Used to make sure the */
114-
$this->pbkdf2($encrypted['cdata'], $key, 1000, 32) /* message is valid when decrypted. */
114+
$this->pbkdf2($encrypted['cdata'], $key, 1, 32) /* message is valid when decrypted. */
115115
);
116116
return json_encode($encrypted);
117117
}
@@ -149,7 +149,7 @@ public function decrypt($data, $key) {
149149
$block = mcrypt_enc_get_block_size($td);
150150

151151
/* Check MAC. */
152-
if(base64_decode($data['mac']) != $this->pbkdf2($data['cdata'], $key, 1000, 32)) {
152+
if(base64_decode($data['mac']) != $this->pbkdf2($data['cdata'], $key, 1, 32)) {
153153
throw new \phpSec\Exception\GeneralSecurityException('Message authentication code invalid');
154154
return false;
155155
}

0 commit comments

Comments
 (0)