We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c09b8e2 commit 606aff4Copy full SHA for 606aff4
src/Encryption.php
@@ -65,7 +65,7 @@ public static function encrypt(string $payload, string $userPublicKey, string $u
65
66
// get shared secret from user public key and local private key
67
$sharedSecret = $curve->mul($userPublicKeyObject->getPoint(), $localPrivateKeyObject->getSecret())->getX();
68
- $sharedSecret = hex2bin(gmp_strval($sharedSecret, 16));
+ $sharedSecret = hex2bin(str_pad(gmp_strval($sharedSecret, 16), 64, '0', STR_PAD_LEFT));
69
70
// generate salt
71
$salt = random_bytes(16);
0 commit comments