First of all, thank you for writing and maintaining this package!
I would like to decrypt an external provided file within an applicaiton.
Was starting out with a test, which is just with a simple message.txt with some text. I have encoded it on CLI with:
gpg --cipher-algo AES256 --output message.txt.gpg --encrypt -u <ID> message.txt
The key used for encrypting is has the default GPG key generate settings and has no paraphrase.
Tried to sort of reverse engineer the logic for encrypting, but it returns an exception:
Exception : Not an asymmetrically encrypted message
$content = file_get_contents($file->getPathname());
$packet = new OpenPGP_LiteralDataPacket($content, ['format' => 'b', 'filename' => $file->getFilename()]);
$message = new OpenPGP_Message([$packet]);
Guess this is because the OpenPGP_Crypt_Symmetric::encrypt() method, does quite some logic
Is there an easier way to decrypt the file contents or do I have to reverse engineer the packets generated from ::encrypt to decrypt a already encrypted file? Maybe I'm overthinking this or missing something.
Hi,
First of all, thank you for writing and maintaining this package!
I would like to decrypt an external provided file within an applicaiton.
Was starting out with a test, which is just with a simple message.txt with some text. I have encoded it on CLI with:
gpg --cipher-algo AES256 --output message.txt.gpg --encrypt -u <ID> message.txt
The key used for encrypting is has the default GPG key generate settings and has no paraphrase.
Tried to sort of reverse engineer the logic for encrypting, but it returns an exception:
Exception : Not an asymmetrically encrypted message
Guess this is because the
OpenPGP_Crypt_Symmetric::encrypt()
method, does quite some logicIs there an easier way to decrypt the file contents or do I have to reverse engineer the packets generated from ::encrypt to decrypt a already encrypted file? Maybe I'm overthinking this or missing something.
Thanks!