We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
can please someone help me with decripting message error? it throw "Ciphertext representative out of range"
Fatal error: Uncaught OutOfRangeException: Ciphertext representative out of range in /pgp/vendor/phpseclib/phpseclib/phpseclib/Crypt/RSA/PrivateKey.php:68 Stack trace: #0 /pgp/vendor/phpseclib/phpseclib/phpseclib/Crypt/RSA/PrivateKey.php(320): phpseclib3\Crypt\RSA\PrivateKey->rsadp() #1 /pgp/vendor/phpseclib/phpseclib/phpseclib/Crypt/RSA/PrivateKey.php(441): phpseclib3\Crypt\RSA\PrivateKey->rsaes_pkcs1_v1_5_decrypt() #2 /pgp/lib/openpgp_crypt_rsa.php(218): phpseclib3\Crypt\RSA\PrivateKey->decrypt() #3 /pgp/lib/openpgp_crypt_rsa.php(200): OpenPGP_Crypt_RSA::try_decrypt_session()
my code:
$keyEncrypted = OpenPGP_Message::parse(OpenPGP::unarmor(file_get_contents(private.asc'), 'PGP PRIVATE KEY BLOCK')); // try each secret key packet foreach($keyEncrypted as $p) { if(!($p instanceof OpenPGP_SecretKeyPacket)) continue; $key = OpenPGP_Crypt_Symmetric::decryptSecretKey('secret', $p); $msg = OpenPGP_Message::parse(OpenPGP::unarmor($msgEncrypted, 'PGP MESSAGE')); $decryptor = new OpenPGP_Crypt_RSA($key); $decrypted = $decryptor->decrypt($msg); // if i call this get that error }
thanks <3
The text was updated successfully, but these errors were encountered:
i think its fixed by replace this line:
if(!($p instanceof OpenPGP_SecretKeyPacket)) continue;
by:
if(!(get_class($p) == 'OpenPGP_SecretKeyPacket')) continue;
there was "OpenPGP_SecretSubkeyPacket" what is also instanceof "OpenPGP_SecretKeyPacket", change skipped that subkey
Sorry, something went wrong.
No branches or pull requests
can please someone help me with decripting message error? it throw "Ciphertext representative out of range"
my code:
thanks <3
The text was updated successfully, but these errors were encountered: