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 

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
> 
> > >> 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
> > 

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


Re: content of private-keys-v1.d

2017-02-08 Thread Marko Bauhardt

> 
> I don't think it has really been documented. I guess the source code *is* the 
> documentation.

;). Understand hehe.

Thanks a lot for all your answers!


Marko




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


Re: content of private-keys-v1.d

2017-02-08 Thread Werner Koch
On Wed,  8 Feb 2017 13:31, dgouttegat...@incenp.org said:

> I don't think it has really been documented. I guess the source code
> *is* the documentation.

The format of the private key files is documented in

gnupg/agent/keyformat.txt


Salam-Shalom,

   Werner

-- 
Die Gedanken sind frei.  Ausnahmen regelt ein Bundesgesetz.


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


Re: content of private-keys-v1.d

2017-02-08 Thread Damien Goutte-Gattat

On 02/08/2017 06:25 PM, Werner Koch wrote:

The format of the private key files is documented in

gnupg/agent/keyformat.txt


Obviously I had completely overlooked this file, my bad.

Sorry for the disinformation. It's good to know that the documentation 
is there.



Damien



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


Problems with GPGME1.8 and Python 3.5 bindings

2017-02-08 Thread Jean-François Schaff
Hi,

I'm new to gpg, and trying to use the Python bindings included in
PGPME. I'm using Ubuntu 16.04 LTS.

I have done the following things:
- compiled and installed libgpg-error-1.26
- compiled and installed libassuan-2.4.3
- installed swig2.0 (sudo apt-get install swig2.0)
- installed python3-dev package (sudo apt-get install python3-dev)
- compiled and installed gpgme-1.8.0

Everything seems to build and install as expected, but when I finally
try to use the python package (import gpg) I get the following error:

(venv) jfs@Danube-linux:~/webdev/mms$ python
Python 3.5.2 (default, Nov 17 2016, 17:05:23)
[GCC 5.4.0 20160609] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import gpg
Traceback (most recent call last):
  File "", line 1, in 
  File 
"/home/jfs/webdev/mms/venv/local/lib/python3.5/site-packages/gpg/__init__.py",
line 101, in 
from . import core
  File 
"/home/jfs/webdev/mms/venv/local/lib/python3.5/site-packages/gpg/core.py",
line 34, in 
from . import gpgme
  File 
"/home/jfs/webdev/mms/venv/local/lib/python3.5/site-packages/gpg/gpgme.py",
line 28, in 
_gpgme = swig_import_helper()
  File 
"/home/jfs/webdev/mms/venv/local/lib/python3.5/site-packages/gpg/gpgme.py",
line 24, in swig_import_helper
_mod = imp.load_module('_gpgme', fp, pathname, description)
  File "/home/jfs/webdev/mms/venv/lib/python3.5/imp.py", line 242, in
load_module
return load_dynamic(name, filename, file)
  File "/home/jfs/webdev/mms/venv/lib/python3.5/imp.py", line 342, in
load_dynamic
return _load(spec)
ImportError: 
/home/jfs/webdev/mms/venv/local/lib/python3.5/site-packages/gpg/_gpgme.cpython-35m-x86_64-linux-gnu.so:
symbol gpgme_pubkey_algo_string, version GPGME_1.1 not defined in file
libgpgme.so.11 with link time reference
>>>

Am I doing something wrong?

Note that I'm running that in the virtual environment, not sure if
that could be related...

Any help would be greatly appreciated :-)

Jean-François Schaff

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


Re: content of private-keys-v1.d

2017-02-08 Thread Damien Goutte-Gattat

On 02/08/2017 12:13 PM, Marko Bauhardt wrote:

You mean that this “stub” contains no information which can be use to
sign/decrypt/authenticate?


Yes. The stub contains only the serial number of the smartcard on which
the private key is stored.



Or in other words in case someone steal this key, he/she can nothing
do with that particular key, only in case the GPG key is located on
a smartcard?


The stub is completely useless without the corresponding smartcard, yes.



But if the key is not on the smart card this corresponding key can
be use to sign/enc/auth?


If the key is not on a smartcard, then the file contains the whole
private key. Note, however, that the key is stored in an encrypted form,
which means that stealing the file is not enough: your attacker would
also need to know your passphrase to make any use of the key.



I can not really find some detailed documentation of the
`private-keys-v1.d` folder. Do you have some docu?


I don't think it has really been documented. I guess the source code 
*is* the documentation.



Damien



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


Re: content of private-keys-v1.d

2017-02-08 Thread Marko Bauhardt

> On 08 Feb 2017, at 10:17, Damien Goutte-Gattat  > wrote:
> 
> Even when your private keys are stored on a smartcard, you would still have a 
> corresponding file in the private-keys-v1.d directory. But this file is only 
> a "stub", that is, it only tells GnuPG that the actual key material is stored 
> on a smart card.


You mean that this “stub” contains no information which can be use to 
sign/decrypt/authenticate?
Or in other words in case someone steal this key, he/she can nothing do with 
that particular key, only in case the GPG key is located on a smartcard?
But if the key is not on the smart card this corresponding key can be use to 
sign/enc/auth?

I can not really find some detailed documentation of the `private-keys-v1.d` 
folder. Do you have some docu?

thx
Marko



---

Marko Bauhardt
marko.bauha...@mailbox.org 

GPG Key ID: 53192101
GPG Fingerprint: DC0F E851 82A3 72E3 7FE1  ACDB 970C FD47 5319 2101



signature.asc
Description: Message signed with OpenPGP using GPGMail
___
Gnupg-users mailing list
Gnupg-users@gnupg.org
http://lists.gnupg.org/mailman/listinfo/gnupg-users


Re: content of private-keys-v1.d

2017-02-08 Thread Damien Goutte-Gattat

Hi,

On 02/08/2017 08:23 AM, Marko Bauhardt wrote:

My question is. What is this for a key and for what is that key used
for? The folder name `private-keys-v1.d` sounds like to store keys
from GPG version 1.x. But i’m using 2.0.x. Any comments about his
folder?


This folder holds all the private keys. It was initially used only by 
gpgsm (for S/MIME keys), but since GnuPG 2.1 it is also used by gpg (for 
OpenPGP keys). The "v1" part in the name has nothing to do with the 
version of GnuPG.




As i said before, i want to not save any key on my machine. And for
now i’m not sure if i reach this goal because this new key sounds
like it is a private key.


Even when your private keys are stored on a smartcard, you would still 
have a corresponding file in the private-keys-v1.d directory. But this 
file is only a "stub", that is, it only tells GnuPG that the actual key 
material is stored on a smartcard.



Damien



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


Re: Estonian e-residency

2017-02-08 Thread Richard Ulrich


Am Dienstag, den 07.02.2017, 11:33 + schrieb Andrew Gallagher:
> On 06/02/17 09:37, Richard Ulrich wrote:
> > 
> > So we sometimes resort to keybase.io. There the key is verified by 
> > some social media. Sure, if the social media profile have existed 
> > for some years and have some legitimate looking interactions, it is
> > a good indicator that its not a face account. But still, I would 
> > trust a government verification more than social media.
> keybase.io is a great idea. But its main use is to tie a PGP key to a
> social media account or accounts that act as a surrogate web of trust
> (by being referenced in multiple independent places by hopefully
> reputable third parties). But if your correspondent's social network
> does not overlap with yours, again I'm not sure much value is added.
Every piece adds to the probability of the key being valid.

> > For example I bought a car last week with Bitcoin. The person that 
> > handled the payment for the seller was not present, but gave me
> > his 
> > keybase.io user name on the phone. He signed the email containing 
> > the Bitcoin address for the payments with his GPG key. He didn't 
> > have any signatures on his key.
> I'm not sure I would have the cojones to follow through with this
> deal,
> signatures or no. ;-)
> 
> > 
> > In this scenario I'm grateful for every piece of validation to give
> > the key more credibility.
> In a scenario where you do not know the intermediary, the only
> meaningful validation is whether the vendor vouches for both the
> intermediary's person and key. The fact that the intermediary
> offers you *an* identity doesn't mean you are validating the correct
> identity.
He is the business partner of the son of the seller. The son was
present and wrote the info down for me.

> If for example he had given you a key signed by a Russian government
> agency, would you have had more confidence? Granted, you like (and
> obviously trust to some extent) the Estonian e-ID system. Others
> might
> not have so much faith.
> 
> Sorry if I'm coming across as a little harsh, but you are proposing
> spending hard cash and I'd hate to see you do so and not get your
> money's worth. By all means, get an e-ID for the fun, for experiment,
> or to start up a company. But signing PGP keys with it is non-
> standard,
> and it's hard enough to convince most people to verify
> keys via standard methods.
> 
> The problem with any PKI (which we still haven't cracked) is that the
> motivation to get your key signed is "How do I prove my identity to
> others", while the motivation of the person verifying the key is "To
> what extent should I trust this person". And unfortunately, the two
> questions are far from equivalent.
Usually the prove of identity is done with government issued IDs. So
the estonian e-residency smart card is not so much different in that
regard.
Of course it would be better if every country issued something like
that to its citizens. And even better if that was compatible with GPG.
But until that happens we might have to improvise sometimes.
There is also SuisseID somehow similar, but the cost is so high that
nobody is interested. 

Rgds
Richard

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

signature.asc
Description: This is a digitally signed message part
___
Gnupg-users mailing list
Gnupg-users@gnupg.org
http://lists.gnupg.org/mailman/listinfo/gnupg-users