Skip to content
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

gpg / gnupg decrypt failure #1335

Closed
cruftex opened this issue Aug 31, 2017 · 12 comments
Closed

gpg / gnupg decrypt failure #1335

cruftex opened this issue Aug 31, 2017 · 12 comments
Labels
bug report Something is not working properly

Comments

@cruftex
Copy link

cruftex commented Aug 31, 2017

I am encountering issues where gpg in termux is producing strange errors when
trying to decrypt a file that was produced on a Ubuntu 16.04 / AMD64 machine.

gpg: encrypted with 2048-bit ELG-E key, ID 4778A353, created 2004-10-19
      "Jens Wilke <[email protected]>"
gpg: fatal: zlib inflate problem: invalid distance too far back
secmem usage: 2304/7296 bytes in 5/19 blocks of pool 8992/32768
decryption failed

Things that I have checked:

  • the file is transferred correctly, checked sha256 checksums
  • using zip compression results in partially decrypted file
  • using no compression results in segmentation fault
  • some other test files seem to work => the behavior depends on the original file content!
  • encrypting on android/termux and decrypting on Ubuntu works

Versions Desktop / Ubuntu:

  • GnuPG: 1.4.20

Versions Phone:

  • Phone: Samsung Galaxy S7
  • termux: 0.53
  • GnuPG: 1.4.22
@Neo-Oli Neo-Oli added the bug report Something is not working properly label Aug 31, 2017
@Neo-Oli
Copy link
Member

Neo-Oli commented Aug 31, 2017

You could try if it works with gnupg2.

@Neo-Oli
Copy link
Member

Neo-Oli commented Aug 31, 2017

Also, can you produce a file that crashes your gnupg that you could share, so we can test this too?

@cruftex
Copy link
Author

cruftex commented Aug 31, 2017

Thanks for the quick answer.

Unfortunately, I cannot share the original file that I keep always encrypted ;)
I tried with two other files but was not able to reproduce the problem.

@cruftex
Copy link
Author

cruftex commented Aug 31, 2017

It works with gnupg2!

Very good hint.

@fornwall
Copy link
Member

Another indicator that dropping gnupg1 support and letting the gnupg binary be supplied by gnupg2 is a good idea.

@cruftex
Copy link
Author

cruftex commented Sep 1, 2017

I am currently happy with the gpg2 solution and stopped experimenting with gpg.

Maybe we can keep that open and see whether somebody else triggers the same problem.

@ghost
Copy link

ghost commented Sep 4, 2017

I have tested with symmetric, asymmetric (RSA/RSA, DSA/Elgamal) with compression set to 'zlib' or 'nocompress' and everything works without error.

On my desktop (Arch Linux amd64) installed gpg 2.1.23, on Termux - gpg 1.4.22.

@plotkin1996
Copy link

When symmetric decrypting a file with gpg1, it gets corrupted silently. I. e. just
dd if=/dev/urandom of=test bs=20k count=1
gpg --symmetric test
gpg test.gpg
The result will be different from the original if file is big enough (about 10k), with some sequential bytes randomly lost (i. e. strings of zeros instead of data). Same gpg version on desktop works flawlessly.

@Neo-Oli
Copy link
Member

Neo-Oli commented Feb 12, 2018

@plotkin1996 I just tested this and I can't reproduce this error

~ $ dd if=/dev/urandom of=test bs=20k count=1
1+0 records in
1+0 records out
20480 bytes (20 kB, 20 KiB) copied, 0.00578958 s, 3.5 MB/s
~ $ gpg --symmetric test
~ $ gpg test.gpg
gpg: AES encrypted data
gpg: encrypted with 1 passphrase
File `test' exists. Overwrite? (y/N) n
Enter new filename: test2
~ $ md5sum test test2
5b76d92d9434f704b0595c4cbfc521ab  test
5b76d92d9434f704b0595c4cbfc521ab  test2
~ $

What's the output of uname -a?

@tomty89
Copy link
Contributor

tomty89 commented Feb 12, 2018

gpg: fatal: zlib inflate problem: invalid distance too far back

Not sure if it's relevant but why don't we build zlib in Termux but make use of the one in /system? @fornwall

@plotkin1996
Copy link

plotkin1996 commented Feb 12, 2018

@Neo-Oli
Linux localhost 3.10.107-linageos-g23c3eda #1 SMP PREEMT Mon Dec 11 11:39:20 CET 2017 armv71 Android
(MSM8916 cpu)
Edit: it's not always silent. Sometimes also may print gpg: [don't know]: invalid packed (ctb=<random hex byte>) or:

gpg: fatal: zlib inflate problem: invalid block type
secmem usage: 2336/2464 in 6/7 blocks of pool 3040/32768

@Grimler91
Copy link
Member

Closing this as gnupg has been removed and gnupg2 seem to work for everyone

@ghost ghost locked and limited conversation to collaborators Oct 9, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug report Something is not working properly
Projects
None yet
Development

No branches or pull requests

6 participants