Re: Non-deterministic behavior using GnuPG and a smart-card

2017-02-09 Thread Dr. Basil Becker
Hello,

On 09.02.2017 07:02, NIIBE Yutaka wrote:
> Hello,
> 
> [...]
> This should be fixed.
> 
I opened an issue for this topic: https://bugs.gnupg.org/gnupg/issue2953

Cheers,
Basil



signature.asc
Description: OpenPGP digital signature
___
Gnupg-users mailing list
Gnupg-users@gnupg.org
http://lists.gnupg.org/mailman/listinfo/gnupg-users


Re: Non-deterministic behavior using GnuPG and a smart-card

2017-02-09 Thread Dr. Basil Becker
Hi Peter et al. 

Am 9. Februar 2017 11:08:12 MEZ schrieb Peter Lebbing :
>Hello,
> I think it's interesting you encrypt
>each and every mail you receive. That exercises all components a lot,
>it
>might lead to some useful insights on how things might be improved. In
>fact, we just encountered such an insight I think!

To encrypt every mail I receive is an option, that my mail - provider offers. I 
uploaded my public key and each incoming mail becomes encrypted. In my opinion 
quite a good trade off, given the general usage of mail encryption outside of 
this list. 
>
>On 09/02/17 07:02, NIIBE Yutaka wrote:
>> This should be fixed.
>
Is there anything else I could provide in order to help with the 
bug-fix?Logs,traces anything? Of course I can offer my environment to do some 
tests. 
Should I file a bug report for this issue? 

>As a short term solution, you could revoke the encryption subkey and
>create a new one with a common keylength;

Yes, this is an option. 

>
>If I understand correctly, you already use a regular
>on-disk key on your smartphone, so this might not be a problem to you.
>
Actually, I'm using my smart-card also on my phone through an USB OTG cable. 
Nevertheless, I have an backup of my encryption key, I could facilitate to 
overcome the current limitations. 

>Changing subkey stuff has no effect on certifications; if people signed
>your key, that signature will still be valid since it is on the primary
>key (and an UID), subkeys are not involved in the process.
>
Thanks for pointing out. I'll consider using a more standard encryption key. 

>I'm curious how you ended up with 3104-bits RSA keys on your smartcard
>in the first place, by the way!
>
I decided for this unusual key length more or less for the reason of obscurity. 
I had the unproven hope that using an unusual key length would make attacks 
harder. However, I did not expect it to complicate the general usage :) 

Cheers 
Basil 


signature.asc
Description: PGP signature
___
Gnupg-users mailing list
Gnupg-users@gnupg.org
http://lists.gnupg.org/mailman/listinfo/gnupg-users


Re: Non-deterministic behavior using GnuPG and a smart-card

2017-02-09 Thread Peter Lebbing
Hello,

BTW, welcome to the list, Basil! I think it's interesting you encrypt
each and every mail you receive. That exercises all components a lot, it
might lead to some useful insights on how things might be improved. In
fact, we just encountered such an insight I think!

On 09/02/17 07:02, NIIBE Yutaka wrote:
> This should be fixed.

As a short term solution, you could revoke the encryption subkey and
create a new one with a common keylength; your current subkey is 3104
bits long for some reason, but the common keylength closest would be
3072 bits.

*However*, since you still want to decrypt mail already encrypted to the
revoked key, you would have to store an on-disk regular copy of that
subkey on your PC. If I understand correctly, you already use a regular
on-disk key on your smartphone, so this might not be a problem to you.

Changing subkey stuff has no effect on certifications; if people signed
your key, that signature will still be valid since it is on the primary
key (and an UID), subkeys are not involved in the process.

I'm curious how you ended up with 3104-bits RSA keys on your smartcard
in the first place, by the way!

HTH,

Peter.

-- 
I use the GNU Privacy Guard (GnuPG) in combination with Enigmail.
You can send me encrypted mail if you want some privacy.
My key is available at 



signature.asc
Description: OpenPGP digital signature
___
Gnupg-users mailing list
Gnupg-users@gnupg.org
http://lists.gnupg.org/mailman/listinfo/gnupg-users


Re: Non-deterministic behavior using GnuPG and a smart-card

2017-02-08 Thread NIIBE Yutaka
Hello,

"Dr. Basil Becker"  writes:
> Authentication and signatures work like a charme. I'm only having
> problems concerning the decryption of mails I received.
[...]
> Some messages, however, fail to decrypt:
> bb@melmac:~$ gpg2 -vv --output /dev/null -d /tmp/message-fail.txt
> gpg: armor: BEGIN PGP MESSAGE
> gpg: armor header: Version: GnuPG v2
> # off=0 ctb=85 tag=1 hlen=3 plen=400
> :pubkey enc packet: version 3, algo 1, keyid DBC1D85BA9D1D189
>   data: [3104 bits]
> gpg: public key is 0xDBC1D85BA9D1D189
> gpg: using subkey 0xDBC1D85BA9D1D189 instead of primary key
> 0x8501968486DF0281
> # off=403 ctb=d2 tag=18 hlen=2 plen=0 partial new-ctb
> :encrypted data packet:
>   length: unknown
>   mdc_method: 2
> gpg: using subkey 0xDBC1D85BA9D1D189 instead of primary key
> 0x8501968486DF0281
> gpg: encrypted with 3104-bit RSA key, ID 0xDBC1D85BA9D1D189, created
> 2017-01-10
>   "Dr. Basil Becker "
> gpg: public key decryption failed: Hardware problem
> gpg: decryption failed: No secret key
[...]
> The only difference I see, is that the pubkey data is 3103 bits vs 3104
> bits. Unfortunately, I have no idea, whether this is a meaningful
> difference and if this

I think that it is deterministic; The cause is that the RSA keysize is
not the one in the set of: 1024, 1536, 2048, 3072, 4096.  When data to
be decrypted is padded, scdaemon can't decrypt, I suppose.

I am not sure the exact reason why scdaemon only supports limited set of
keysize for encryption.   But we have this handling of padding in the
current code:


https://git.gnupg.org/cgi-bin/gitweb.cgi?p=gnupg.git;a=blob;f=scd/app-openpgp.c;h=71c9e1b83003af07b0984688ba1ec5e9013b877c;hb=refs/heads/master#l4334

   /* We might encounter a couple of leading zeroes in the
  cryptogram.  Due to internal use of MPIs these leading zeroes
  are stripped.  However the OpenPGP card expects exactly 128
  bytes for the cryptogram (for a 1k key).  Thus we need to fix
  it up.  We do this for up to 16 leading zero bytes; a
  cryptogram with more than this is with a very high
  probability anyway broken.  If a signed conversion was used
  we may also encounter one leading zero followed by the correct
  length.  We fix that as well.  */
   if (indatalen >= (128-16) && indatalen < 128)  /* 1024 bit key.  */
 fixuplen = 128 - indatalen;
   else if (indatalen >= (192-16) && indatalen < 192) /* 1536 bit key.  */
 fixuplen = 192 - indatalen;
   else if (indatalen >= (256-16) && indatalen < 256) /* 2048 bit key.  */
 fixuplen = 256 - indatalen;
   else if (indatalen >= (384-16) && indatalen < 384) /* 3072 bit key.  */
 fixuplen = 384 - indatalen;
   else if (indatalen >= (512-16) && indatalen < 512) /* 4096 bit key.  */
 fixuplen = 512 - indatalen;
   else if (!*(const char *)indata && (indatalen == 129
   || indatalen == 193
   || indatalen == 257
   || indatalen == 385
   || indatalen == 513))
 fixuplen = -1;
   else
 fixuplen = 0;

Perhaps, it was due to support all existing OpenPGP card
implementations, I mean, somehow historical, and it was easier to list
up specific keysizes.

This should be fixed.
-- 

___
Gnupg-users mailing list
Gnupg-users@gnupg.org
http://lists.gnupg.org/mailman/listinfo/gnupg-users


Re: Non-deterministic behavior using GnuPG and a smart-card

2017-02-08 Thread Adam Sherman
Is it always the same files that aren't decrypting, or is it truly random?

On Wed, Feb 8, 2017 at 16:22 Dr. Basil Becker  wrote:

> Hello,
>
> Peter, thanks for the clarification. I understand your point ;)
>
> On 08.02.2017 20:05, Peter Lebbing wrote:
> > Hello,
> >
> >> I wrote about the problem in more detail at launchpad.net
> >> https://answers.launchpad.net/ubuntu/+source/gnupg/+question/452490
> >
> > I think it is appreciated if you actually describe the problem on the
> > mailing list itself rather than only linking to a website.
> >
> I'm having a setup consisting of a main key, and three sub-keys for
> encryption, authorization and signature. The three sub-keys are stored
> on  a Yubikey 4 smart-card.
>
> Authentication and signatures work like a charme. I'm only having
> problems concerning the decryption of mails I received. I'm using
> thunderbird together with enigmail to read my mails, but as the problem
> also occurrs at the CLI, I assume that enigmail is not part of the puzzle.
>
> Well, some messages could be successfully decrypted:
> bb@melmac:~$ gpg2 -vv --output /dev/null -d /tmp/message.txt
> gpg: armor: BEGIN PGP MESSAGE
> gpg: armor header: Version: GnuPG v2
> # off=0 ctb=85 tag=1 hlen=3 plen=400
> :pubkey enc packet: version 3, algo 1, keyid DBC1D85BA9D1D189
> data: [3103 bits]
> gpg: public key is 0xDBC1D85BA9D1D189
> gpg: using subkey 0xDBC1D85BA9D1D189 instead of primary key
> 0x8501968486DF0281
> gpg: public key encrypted data: good DEK
> # off=403 ctb=d2 tag=18 hlen=2 plen=0 partial new-ctb
> :encrypted data packet:
> length: unknown
> mdc_method: 2
> gpg: using subkey 0xDBC1D85BA9D1D189 instead of primary key
> 0x8501968486DF0281
> gpg: encrypted with 3104-bit RSA key, ID 0xDBC1D85BA9D1D189, created
> 2017-01-10
>   "Dr. Basil Becker "
> gpg: AES256 encrypted data
> # off=424 ctb=a3 tag=8 hlen=1 plen=0 indeterminate
> :compressed packet: algo=2
> # off=426 ctb=cb tag=11 hlen=2 plen=0 partial new-ctb
> :literal data packet:
> mode b (62), created 1486478293, name="",
> raw data: unknown length
> gpg: original file name=''
> gpg: decryption okay
>
>
> Some messages, however, fail to decrypt:
> bb@melmac:~$ gpg2 -vv --output /dev/null -d /tmp/message-fail.txt
> gpg: armor: BEGIN PGP MESSAGE
> gpg: armor header: Version: GnuPG v2
> # off=0 ctb=85 tag=1 hlen=3 plen=400
> :pubkey enc packet: version 3, algo 1, keyid DBC1D85BA9D1D189
> data: [3104 bits]
> gpg: public key is 0xDBC1D85BA9D1D189
> gpg: using subkey 0xDBC1D85BA9D1D189 instead of primary key
> 0x8501968486DF0281
> # off=403 ctb=d2 tag=18 hlen=2 plen=0 partial new-ctb
> :encrypted data packet:
> length: unknown
> mdc_method: 2
> gpg: using subkey 0xDBC1D85BA9D1D189 instead of primary key
> 0x8501968486DF0281
> gpg: encrypted with 3104-bit RSA key, ID 0xDBC1D85BA9D1D189, created
> 2017-01-10
>   "Dr. Basil Becker "
> gpg: public key decryption failed: Hardware problem
> gpg: decryption failed: No secret key
>
> The only difference I see, is that the pubkey data is 3103 bits vs 3104
> bits. Unfortunately, I have no idea, whether this is a meaningful
> difference and if this
>
> If anyone could help me identifying what my problem is or even to solve
> it, I'd appreciate it :) If you need any additional information or
> dedicated log-output, I'm happy to provide it.
>
> Cheers,
> Basil
>
>
> ___
> Gnupg-users mailing list
> Gnupg-users@gnupg.org
> http://lists.gnupg.org/mailman/listinfo/gnupg-users
>
-- 
Adam Sherman
Directeur des opérations, Sauvetage bénévole Outaouais
Director of Operations, Ottawa Volunteer SAR
CTO, Versature Corp.
+1 613 797 6819
___
Gnupg-users mailing list
Gnupg-users@gnupg.org
http://lists.gnupg.org/mailman/listinfo/gnupg-users


Re: Non-deterministic behavior using GnuPG and a smart-card

2017-02-08 Thread Adam Sherman
Maybe there is an algorithm that the Yubukey can't handle?

Or, maybe Enigmail is calling "gpg" instead of "gpg2"?

I'm just brainstorming.

A.

On Wed, Feb 8, 2017 at 17:06 Dr. Basil Becker  wrote:

>
>
> On 08.02.2017 23:03, Adam Sherman wrote:
> > Is it always the same files that aren't decrypting, or is it truly
> random?
> >
> Yes, if I'm able to decrypt a mail, I'm always able to it. Unfortunately
> this holds also true for those mails, I can't decrypt.
>
> I should also add, that I don't have any problems, when I read the mails
> on my smartphone using K9 and Openkeychain.
>
>
> > On Wed, Feb 8, 2017 at 16:22 Dr. Basil Becker  > > wrote:
> >
> > Hello,
> >
> > Peter, thanks for the clarification. I understand your point ;)
> >
> > On 08.02.2017 20:05, Peter Lebbing wrote:
> > > Hello,
> > >
> > >> I wrote about the problem in more detail at launchpad.net
> > 
> > >>
> https://answers.launchpad.net/ubuntu/+source/gnupg/+question/452490
> > >
> > > I think it is appreciated if you actually describe the problem on
> the
> > > mailing list itself rather than only linking to a website.
> > >
> > I'm having a setup consisting of a main key, and three sub-keys for
> > encryption, authorization and signature. The three sub-keys are
> stored
> > on  a Yubikey 4 smart-card.
> >
> > Authentication and signatures work like a charme. I'm only having
> > problems concerning the decryption of mails I received. I'm using
> > thunderbird together with enigmail to read my mails, but as the
> problem
> > also occurrs at the CLI, I assume that enigmail is not part of the
> > puzzle.
> >
> > Well, some messages could be successfully decrypted:
> > bb@melmac:~$ gpg2 -vv --output /dev/null -d /tmp/message.txt
> > gpg: armor: BEGIN PGP MESSAGE
> > gpg: armor header: Version: GnuPG v2
> > # off=0 ctb=85 tag=1 hlen=3 plen=400
> > :pubkey enc packet: version 3, algo 1, keyid DBC1D85BA9D1D189
> > data: [3103 bits]
> > gpg: public key is 0xDBC1D85BA9D1D189
> > gpg: using subkey 0xDBC1D85BA9D1D189 instead of primary key
> > 0x8501968486DF0281
> > gpg: public key encrypted data: good DEK
> > # off=403 ctb=d2 tag=18 hlen=2 plen=0 partial new-ctb
> > :encrypted data packet:
> > length: unknown
> > mdc_method: 2
> > gpg: using subkey 0xDBC1D85BA9D1D189 instead of primary key
> > 0x8501968486DF0281
> > gpg: encrypted with 3104-bit RSA key, ID 0xDBC1D85BA9D1D189, created
> > 2017-01-10
> >   "Dr. Basil Becker  > >"
> > gpg: AES256 encrypted data
> > # off=424 ctb=a3 tag=8 hlen=1 plen=0 indeterminate
> > :compressed packet: algo=2
> > # off=426 ctb=cb tag=11 hlen=2 plen=0 partial new-ctb
> > :literal data packet:
> > mode b (62), created 1486478293, name="",
> > raw data: unknown length
> > gpg: original file name=''
> > gpg: decryption okay
> >
> >
> > Some messages, however, fail to decrypt:
> > bb@melmac:~$ gpg2 -vv --output /dev/null -d /tmp/message-fail.txt
> > gpg: armor: BEGIN PGP MESSAGE
> > gpg: armor header: Version: GnuPG v2
> > # off=0 ctb=85 tag=1 hlen=3 plen=400
> > :pubkey enc packet: version 3, algo 1, keyid DBC1D85BA9D1D189
> > data: [3104 bits]
> > gpg: public key is 0xDBC1D85BA9D1D189
> > gpg: using subkey 0xDBC1D85BA9D1D189 instead of primary key
> > 0x8501968486DF0281
> > # off=403 ctb=d2 tag=18 hlen=2 plen=0 partial new-ctb
> > :encrypted data packet:
> > length: unknown
> > mdc_method: 2
> > gpg: using subkey 0xDBC1D85BA9D1D189 instead of primary key
> > 0x8501968486DF0281
> > gpg: encrypted with 3104-bit RSA key, ID 0xDBC1D85BA9D1D189, created
> > 2017-01-10
> >   "Dr. Basil Becker  > >"
> > gpg: public key decryption failed: Hardware problem
> > gpg: decryption failed: No secret key
> >
> > The only difference I see, is that the pubkey data is 3103 bits vs
> 3104
> > bits. Unfortunately, I have no idea, whether this is a meaningful
> > difference and if this
> >
> > If anyone could help me identifying what my problem is or even to
> solve
> > it, I'd appreciate it :) If you need any additional information or
> > dedicated log-output, I'm happy to provide it.
> >
> > Cheers,
> > Basil
> >
> >
> > ___
> > Gnupg-users mailing list
> > Gnupg-users@gnupg.org 
> > http://lists.gnupg.org/mailman/listinfo/gnupg-users
> >
> > --
> > Adam Sherman
> > Directeur des opérations, Sauvetage bénévole Outaouais
> > Director of Operations, Ottawa Volunteer SAR
> > CTO, Versature Corp.
> > +1 613 797 6819
>
> --
> Dr. Basil Beckerm: ba...@bas

Re: Non-deterministic behavior using GnuPG and a smart-card

2017-02-08 Thread Dr. Basil Becker


On 08.02.2017 23:25, Adam Sherman wrote:
> Maybe there is an algorithm that the Yubukey can't handle?
> 
Eventually, but I'm a) pretty sure that always the same software has
been used to encrypt the mails (it is done by my mail provider). And I'm
using the Yubikey on my smartphone, too.

> Or, maybe Enigmail is calling "gpg" instead of "gpg2"?
>
gpg is set to be an alias for gpg2 and enigmail states in its settings,
that it is running /usr/bin/gpg2 And some of my mails could be decrypted...

> I'm just brainstorming.
> 
I appreciate it :)

Cheers,
Basil

> A.
> 
> On Wed, Feb 8, 2017 at 17:06 Dr. Basil Becker  > wrote:
> 
> 
> 
> On 08.02.2017 23:03, Adam Sherman wrote:
> > Is it always the same files that aren't decrypting, or is it truly
> random?
> >
> Yes, if I'm able to decrypt a mail, I'm always able to it. Unfortunately
> this holds also true for those mails, I can't decrypt.
> 
> I should also add, that I don't have any problems, when I read the mails
> on my smartphone using K9 and Openkeychain.
> 
> 
> > On Wed, Feb 8, 2017 at 16:22 Dr. Basil Becker
> mailto:ba...@basilbecker.de>
> > >> wrote:
> >
> > Hello,
> >
> > Peter, thanks for the clarification. I understand your point ;)
> >
> > On 08.02.2017 20:05, Peter Lebbing wrote:
> > > Hello,
> > >
> > >> I wrote about the problem in more detail at launchpad.net
> 
> > 
> > >>
> https://answers.launchpad.net/ubuntu/+source/gnupg/+question/452490
> > >
> > > I think it is appreciated if you actually describe the
> problem on the
> > > mailing list itself rather than only linking to a website.
> > >
> > I'm having a setup consisting of a main key, and three
> sub-keys for
> > encryption, authorization and signature. The three sub-keys
> are stored
> > on  a Yubikey 4 smart-card.
> >
> > Authentication and signatures work like a charme. I'm only having
> > problems concerning the decryption of mails I received. I'm using
> > thunderbird together with enigmail to read my mails, but as
> the problem
> > also occurrs at the CLI, I assume that enigmail is not part of the
> > puzzle.
> >
> > Well, some messages could be successfully decrypted:
> > bb@melmac:~$ gpg2 -vv --output /dev/null -d /tmp/message.txt
> > gpg: armor: BEGIN PGP MESSAGE
> > gpg: armor header: Version: GnuPG v2
> > # off=0 ctb=85 tag=1 hlen=3 plen=400
> > :pubkey enc packet: version 3, algo 1, keyid DBC1D85BA9D1D189
> > data: [3103 bits]
> > gpg: public key is 0xDBC1D85BA9D1D189
> > gpg: using subkey 0xDBC1D85BA9D1D189 instead of primary key
> > 0x8501968486DF0281
> > gpg: public key encrypted data: good DEK
> > # off=403 ctb=d2 tag=18 hlen=2 plen=0 partial new-ctb
> > :encrypted data packet:
> > length: unknown
> > mdc_method: 2
> > gpg: using subkey 0xDBC1D85BA9D1D189 instead of primary key
> > 0x8501968486DF0281
> > gpg: encrypted with 3104-bit RSA key, ID 0xDBC1D85BA9D1D189,
> created
> > 2017-01-10
> >   "Dr. Basil Becker  
> > >>"
> > gpg: AES256 encrypted data
> > # off=424 ctb=a3 tag=8 hlen=1 plen=0 indeterminate
> > :compressed packet: algo=2
> > # off=426 ctb=cb tag=11 hlen=2 plen=0 partial new-ctb
> > :literal data packet:
> > mode b (62), created 1486478293, name="",
> > raw data: unknown length
> > gpg: original file name=''
> > gpg: decryption okay
> >
> >
> > Some messages, however, fail to decrypt:
> > bb@melmac:~$ gpg2 -vv --output /dev/null -d /tmp/message-fail.txt
> > gpg: armor: BEGIN PGP MESSAGE
> > gpg: armor header: Version: GnuPG v2
> > # off=0 ctb=85 tag=1 hlen=3 plen=400
> > :pubkey enc packet: version 3, algo 1, keyid DBC1D85BA9D1D189
> > data: [3104 bits]
> > gpg: public key is 0xDBC1D85BA9D1D189
> > gpg: using subkey 0xDBC1D85BA9D1D189 instead of primary key
> > 0x8501968486DF0281
> > # off=403 ctb=d2 tag=18 hlen=2 plen=0 partial new-ctb
> > :encrypted data packet:
> > length: unknown
> > mdc_method: 2
> > gpg: using subkey 0xDBC1D85BA9D1D189 instead of primary key
> > 0x8501968486DF0281
> > gpg: encrypted with 3104-bit RSA key, ID 0xDBC1D85BA9D1D189,
> created
> > 2017-01-10
> >   "Dr. Basil Becker  

Re: Non-deterministic behavior using GnuPG and a smart-card

2017-02-08 Thread Dr. Basil Becker


On 08.02.2017 23:03, Adam Sherman wrote:
> Is it always the same files that aren't decrypting, or is it truly random?
> 
Yes, if I'm able to decrypt a mail, I'm always able to it. Unfortunately
this holds also true for those mails, I can't decrypt.

I should also add, that I don't have any problems, when I read the mails
on my smartphone using K9 and Openkeychain.


> On Wed, Feb 8, 2017 at 16:22 Dr. Basil Becker  > wrote:
> 
> Hello,
> 
> Peter, thanks for the clarification. I understand your point ;)
> 
> On 08.02.2017 20:05, Peter Lebbing wrote:
> > Hello,
> >
> >> I wrote about the problem in more detail at launchpad.net
> 
> >> https://answers.launchpad.net/ubuntu/+source/gnupg/+question/452490
> >
> > I think it is appreciated if you actually describe the problem on the
> > mailing list itself rather than only linking to a website.
> >
> I'm having a setup consisting of a main key, and three sub-keys for
> encryption, authorization and signature. The three sub-keys are stored
> on  a Yubikey 4 smart-card.
> 
> Authentication and signatures work like a charme. I'm only having
> problems concerning the decryption of mails I received. I'm using
> thunderbird together with enigmail to read my mails, but as the problem
> also occurrs at the CLI, I assume that enigmail is not part of the
> puzzle.
> 
> Well, some messages could be successfully decrypted:
> bb@melmac:~$ gpg2 -vv --output /dev/null -d /tmp/message.txt
> gpg: armor: BEGIN PGP MESSAGE
> gpg: armor header: Version: GnuPG v2
> # off=0 ctb=85 tag=1 hlen=3 plen=400
> :pubkey enc packet: version 3, algo 1, keyid DBC1D85BA9D1D189
> data: [3103 bits]
> gpg: public key is 0xDBC1D85BA9D1D189
> gpg: using subkey 0xDBC1D85BA9D1D189 instead of primary key
> 0x8501968486DF0281
> gpg: public key encrypted data: good DEK
> # off=403 ctb=d2 tag=18 hlen=2 plen=0 partial new-ctb
> :encrypted data packet:
> length: unknown
> mdc_method: 2
> gpg: using subkey 0xDBC1D85BA9D1D189 instead of primary key
> 0x8501968486DF0281
> gpg: encrypted with 3104-bit RSA key, ID 0xDBC1D85BA9D1D189, created
> 2017-01-10
>   "Dr. Basil Becker  >"
> gpg: AES256 encrypted data
> # off=424 ctb=a3 tag=8 hlen=1 plen=0 indeterminate
> :compressed packet: algo=2
> # off=426 ctb=cb tag=11 hlen=2 plen=0 partial new-ctb
> :literal data packet:
> mode b (62), created 1486478293, name="",
> raw data: unknown length
> gpg: original file name=''
> gpg: decryption okay
> 
> 
> Some messages, however, fail to decrypt:
> bb@melmac:~$ gpg2 -vv --output /dev/null -d /tmp/message-fail.txt
> gpg: armor: BEGIN PGP MESSAGE
> gpg: armor header: Version: GnuPG v2
> # off=0 ctb=85 tag=1 hlen=3 plen=400
> :pubkey enc packet: version 3, algo 1, keyid DBC1D85BA9D1D189
> data: [3104 bits]
> gpg: public key is 0xDBC1D85BA9D1D189
> gpg: using subkey 0xDBC1D85BA9D1D189 instead of primary key
> 0x8501968486DF0281
> # off=403 ctb=d2 tag=18 hlen=2 plen=0 partial new-ctb
> :encrypted data packet:
> length: unknown
> mdc_method: 2
> gpg: using subkey 0xDBC1D85BA9D1D189 instead of primary key
> 0x8501968486DF0281
> gpg: encrypted with 3104-bit RSA key, ID 0xDBC1D85BA9D1D189, created
> 2017-01-10
>   "Dr. Basil Becker  >"
> gpg: public key decryption failed: Hardware problem
> gpg: decryption failed: No secret key
> 
> The only difference I see, is that the pubkey data is 3103 bits vs 3104
> bits. Unfortunately, I have no idea, whether this is a meaningful
> difference and if this
> 
> If anyone could help me identifying what my problem is or even to solve
> it, I'd appreciate it :) If you need any additional information or
> dedicated log-output, I'm happy to provide it.
> 
> Cheers,
> Basil
> 
> 
> ___
> Gnupg-users mailing list
> Gnupg-users@gnupg.org 
> http://lists.gnupg.org/mailman/listinfo/gnupg-users
> 
> -- 
> Adam Sherman
> Directeur des opérations, Sauvetage bénévole Outaouais
> Director of Operations, Ottawa Volunteer SAR
> CTO, Versature Corp.
> +1 613 797 6819

-- 
Dr. Basil Beckerm: ba...@basilbecker.de
Haeckelstr. 12  t: 0163 6538837
14471 Potsdam



signature.asc
Description: OpenPGP digital signature
___
Gnupg-users mailing list
Gnupg-users@gnupg.org
http://lists.gnupg.org/mailman/listinfo/gnupg-users


Re: Non-deterministic behavior using GnuPG and a smart-card

2017-02-08 Thread Dr. Basil Becker
Hello,

Peter, thanks for the clarification. I understand your point ;)

On 08.02.2017 20:05, Peter Lebbing wrote:
> Hello,
> 
>> I wrote about the problem in more detail at launchpad.net 
>> https://answers.launchpad.net/ubuntu/+source/gnupg/+question/452490
> 
> I think it is appreciated if you actually describe the problem on the
> mailing list itself rather than only linking to a website.
> 
I'm having a setup consisting of a main key, and three sub-keys for
encryption, authorization and signature. The three sub-keys are stored
on  a Yubikey 4 smart-card.

Authentication and signatures work like a charme. I'm only having
problems concerning the decryption of mails I received. I'm using
thunderbird together with enigmail to read my mails, but as the problem
also occurrs at the CLI, I assume that enigmail is not part of the puzzle.

Well, some messages could be successfully decrypted:
bb@melmac:~$ gpg2 -vv --output /dev/null -d /tmp/message.txt
gpg: armor: BEGIN PGP MESSAGE
gpg: armor header: Version: GnuPG v2
# off=0 ctb=85 tag=1 hlen=3 plen=400
:pubkey enc packet: version 3, algo 1, keyid DBC1D85BA9D1D189
data: [3103 bits]
gpg: public key is 0xDBC1D85BA9D1D189
gpg: using subkey 0xDBC1D85BA9D1D189 instead of primary key
0x8501968486DF0281
gpg: public key encrypted data: good DEK
# off=403 ctb=d2 tag=18 hlen=2 plen=0 partial new-ctb
:encrypted data packet:
length: unknown
mdc_method: 2
gpg: using subkey 0xDBC1D85BA9D1D189 instead of primary key
0x8501968486DF0281
gpg: encrypted with 3104-bit RSA key, ID 0xDBC1D85BA9D1D189, created
2017-01-10
  "Dr. Basil Becker "
gpg: AES256 encrypted data
# off=424 ctb=a3 tag=8 hlen=1 plen=0 indeterminate
:compressed packet: algo=2
# off=426 ctb=cb tag=11 hlen=2 plen=0 partial new-ctb
:literal data packet:
mode b (62), created 1486478293, name="",
raw data: unknown length
gpg: original file name=''
gpg: decryption okay


Some messages, however, fail to decrypt:
bb@melmac:~$ gpg2 -vv --output /dev/null -d /tmp/message-fail.txt
gpg: armor: BEGIN PGP MESSAGE
gpg: armor header: Version: GnuPG v2
# off=0 ctb=85 tag=1 hlen=3 plen=400
:pubkey enc packet: version 3, algo 1, keyid DBC1D85BA9D1D189
data: [3104 bits]
gpg: public key is 0xDBC1D85BA9D1D189
gpg: using subkey 0xDBC1D85BA9D1D189 instead of primary key
0x8501968486DF0281
# off=403 ctb=d2 tag=18 hlen=2 plen=0 partial new-ctb
:encrypted data packet:
length: unknown
mdc_method: 2
gpg: using subkey 0xDBC1D85BA9D1D189 instead of primary key
0x8501968486DF0281
gpg: encrypted with 3104-bit RSA key, ID 0xDBC1D85BA9D1D189, created
2017-01-10
  "Dr. Basil Becker "
gpg: public key decryption failed: Hardware problem
gpg: decryption failed: No secret key

The only difference I see, is that the pubkey data is 3103 bits vs 3104
bits. Unfortunately, I have no idea, whether this is a meaningful
difference and if this

If anyone could help me identifying what my problem is or even to solve
it, I'd appreciate it :) If you need any additional information or
dedicated log-output, I'm happy to provide it.

Cheers,
Basil




signature.asc
Description: OpenPGP digital signature
___
Gnupg-users mailing list
Gnupg-users@gnupg.org
http://lists.gnupg.org/mailman/listinfo/gnupg-users


Re: Non-deterministic behavior using GnuPG and a smart-card

2017-02-08 Thread Peter Lebbing
Hello,

> I wrote about the problem in more detail at launchpad.net 
> https://answers.launchpad.net/ubuntu/+source/gnupg/+question/452490

I think it is appreciated if you actually describe the problem on the
mailing list itself rather than only linking to a website. And you're
also losing those people who would have read the mail and had an idea
but can't be bothered to chase the link.

> However, if anyone of you has an idea, what the problem could be, 
> I'd be pleased to hear about it.

Please provide error messages and other exact output, that gives
people more insight than "for some others no private key could be
found". And since it also happens at the command line (that's good! It
makes including everything easier), you could add -vv for verbosity or
even --debug-flags to dig deeper into the problematic encryptions.

Peter.

-- 
I use the GNU Privacy Guard (GnuPG) in combination with Enigmail.
You can send me encrypted mail if you want some privacy.
My key is available at 



signature.asc
Description: OpenPGP digital signature
___
Gnupg-users mailing list
Gnupg-users@gnupg.org
http://lists.gnupg.org/mailman/listinfo/gnupg-users


Non-deterministic behavior using GnuPG and a smart-card

2017-02-08 Thread Dr. Basil Becker
Hi everyone,

since a few days I'm observing a rather non-deterministic behavior,
where GnuPG sometimes fails to find my private key, that is located at a
smart-card and sometimes everything works.
I wrote about the problem in more detail at launchpad.net
https://answers.launchpad.net/ubuntu/+source/gnupg/+question/452490

However, if anyone of you has an idea, what the problem could be, I'd be
pleased to hear about it.

Cheers,
Basil



signature.asc
Description: OpenPGP digital signature
___
Gnupg-users mailing list
Gnupg-users@gnupg.org
http://lists.gnupg.org/mailman/listinfo/gnupg-users