forked from dryphp/openpgp.php
-
-
Notifications
You must be signed in to change notification settings - Fork 69
Open
Description
Hi,
When trying to decrypt the output of this lib using gpg cli tool I get this:
$ gpg --decrypt test.enc
gpg: assuming IDEA encrypted data
gpg: [don't know]: indeterminate length for invalid packet type 2
gpg: WARNING: encrypted message has been manipulated!
gpg: [don't know]: invalid packet (ctb=40)
This is the PHP code
$pk = OpenPGP_Message::parse(file_get_contents('public.asc'));
$data = new OpenPGP_LiteralDataPacket("some text\n", ['format' => 'u']);
$encrypted = OpenPGP_Crypt_Symmetric::encrypt([$pk], new OpenPGP_Message([$data]));
echo OpenPGP::enarmor($encrypted->to_bytes(), 'PGP MESSAGE');
Metadata
Metadata
Assignees
Labels
No labels