-
Notifications
You must be signed in to change notification settings - Fork 53
New issue
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
unknown packet type encountered: 20 error is coming when decrypt #64
Comments
Hi @chanurahemal, Was there a solution for this bug ?? |
Actually I regenerated keys and tested, then it worked. That's why i closed the ticket. If you are having the same issue, try with generating keys on a linux machine and try. I used to generate keys on a mac and i got above error. But when i tried with keys generated on linux, it worked. Hope this helps. Good luck |
Hi @chanurahemal, I was able to resolve it as well. I was generating key using Mac too. I was getting error because the file had to be encrypted using option —openpgp Once I used above options while encrypting, the error was gone |
Awesome, thanks!
…On Mon, 6 Sep 2021 at 7:59 pm, SPE-ALath ***@***.***> wrote:
Hi @chanurahemal <https://github.com/chanurahemal>,
I was able to resolve it as well. I was generating key using Mac too. I
was getting error because the file had to be encrypted using option —openpgp
Once I used above options while encrypting, the error was gone
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#64 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACV6EBV2BLGEEDZQQ7QUXQLUASGIVANCNFSM47C7PEJQ>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
|
Hi All, I'm currently running into the same issue. Was there anything else that needed to be done? BTW: I'm on version 2.3.0 from Maven (https://mvnrepository.com/artifact/name.neuhalfen.projects.crypto.bouncycastle.openpgp/bouncy-gpg/2.3.0) |
Describe the bug
I created gpg keys(public/private) and managed to successfully encrypt/decrypt files using keys in command line.
Encrypt : gpg --batch --armor --passphrase "PASSWORD" -se --recipient "RECIPIENT" FILE.txt
it generated .asc file and i managed to decrypt it using bellow command
Decrypt: gpg --yes --batch --passphrase "PASSWORD" FILE.txt.asc
But when i try to decrypt the same file in code, I am getting "unknown packet type encountered: 20" error
Sample Code:
{
System.out.println("Initializing Bouncy Castle");
//I am providing pub/keys as strings
final InMemoryKeyring keyring = KeyringConfigs
.forGpgExportedKeys(KeyringConfigCallbacks.withPassword("passwod"));
keyring.addSecretKey(BPAY_PRIVATE.getBytes());
keyring.addPublicKey(BPAY_PUBLIC.getBytes());
}
The text was updated successfully, but these errors were encountered: