Re: Paperkey (Was: Re: )

2010-04-01 Thread john espiro




So then it looks like dmtxwrite is the issue then?

;)
John






From: john espiro john_esp...@yahoo.com
To: David Shaw ds...@jabberwocky.com
Sent: Sat, March 20, 2010 11:56:30 PM
Subject: Re: Paperkey (Was: Re: )


Hi David -

If I do:

paperkey --secret-key 
./secring.gpg --output raw.paperkey --output-type raw
paperkey 
--pubring pubring.gpg --secrets raw.paperkey --output my-secret-key.gpg

It appears to create a new secret key, no complaining or 
anything...  

John
---




What happens if you export a raw version and then import that raw version right 
back in again?  Forget dmtxwrite for now.

David


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


Re: Paperkey (Was: Re: )

2010-03-13 Thread john espiro
Hi there -

Thanks to your help, and David's, I have tried a few other things.  Using yoru 
script I found that indeed it was dtmx that was failing due to the file being 
larger than 1555 bytes.

I deleted all of the commented lines such as this, and then ran dtmxwrite:

# Secret portions of key C8093ECE9373F385DB82D721245C4CBC467F1AE1
# Base16 data extracted Sat Mar 13 10:47:10 2010
# Created with paperkey 1.2 by David Shaw
#
# File format:
# a) 1 octet:  Version of the paperkey format (currently 0).
# b) 1 octet:  OpenPGP key or subkey version (currently 4)
# c) n octets: Key fingerprint (20 octets for a version 4 key or subkey)
# d) 2 octets: 16-bit big endian length of the following secret data
# e) n octets: Secret data: a partial OpenPGP secret key or subkey packet as
#  specified in RFC 4880, starting with the string-to-key usage
#  octet and continuing until the end of the packet.
# Repeat fields b through e as needed to cover all subkeys.
# 

That worked and it successfully generated the bar code.

I found that adding in some of the commented lines still allowed the bar code 
to be generated, albeit a different bar code.  

What is the advantage of encoding the commented lines into the bar code?  I'll 
go investigate if paperkey will allow an output without the commented sections.

John



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


Re: Paperkey (Was: Re: )

2010-03-13 Thread David Shaw
On Mar 13, 2010, at 5:22 AM, john espiro wrote:

 Hi there -
 
 Thanks to your help, and David's, I have tried a few other things.  Using 
 yoru script I found that indeed it was dtmx that was failing due to the file 
 being larger than 1555 bytes.
 
 I deleted all of the commented lines such as this, and then ran dtmxwrite:
 
 # Secret portions of key C8093ECE9373F385DB82D721245C4CBC467F1AE1
 # Base16 data extracted Sat Mar 13 10:47:10 2010
 # Created with paperkey 1.2 by David Shaw
 #
 # File format:
 # a) 1 octet:  Version of the paperkey format (currently 0).
 # b) 1 octet:  OpenPGP key or subkey version (currently 4)
 # c) n octets: Key fingerprint (20 octets for a version 4 key or subkey)
 # d) 2 octets: 16-bit big endian length of the following secret data
 # e) n octets: Secret data: a partial OpenPGP secret key or subkey packet as
 #  specified in RFC 4880, starting with the string-to-key usage
 #  octet and continuing until the end of the packet.
 # Repeat fields b through e as needed to cover all subkeys.
 # 
 
 That worked and it successfully generated the bar code.
 
 I found that adding in some of the commented lines still allowed the bar code 
 to be generated, albeit a different bar code.  
 
 What is the advantage of encoding the commented lines into the bar code?  
 I'll go investigate if paperkey will allow an output without the commented 
 sections.

paperkey can generate text output (which has the comments on top) and raw 
output.  The raw output is binary (so not directly printable as text, and 
obviously no comments), but has the advantage of being significantly smaller as 
one byte is one byte, rather than the 3 bytes it takes up in text form.  If you 
are piping to something like dmtx, you should use raw output (--output-type 
raw).

David


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


Re: Paperkey (Was: Re: )

2010-03-12 Thread john espiro
Hi David -

Thanks for the quick reply.

I should note that I am on a Windows XP box.

When I run gpg --export-secret-key m...@key.com | paperkey  --output-type raw 
for both the 2048 and 4096, I note that the output for the 4096 key is about 
10% logner than that of the 2048 key.

I am not familiar with wc.exe, but will google it...

John






From: David Shaw ds...@jabberwocky.com

Paperkey doesn't care what size the key is.  Try doing that same command line, 
but use wc -c instead of the dmtxwrite part to check that the output is 
larger than with a 2048 bit key.  Perhaps dmtxwrite is having a problem?

David


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


Re: Paperkey (Was: Re: )

2010-03-12 Thread Ciprian Dorin, Craciun
I've used the `dtmx` tool to export some GPG keys (exactly a 4096
bits one) and it worked.

What I did was something like:
paperkey --secret-key ./key.gpg --output ./key.paperkey
--output-type raw
dmtxwrite --encoding 8 --format png --resolution 72
./key.paperkey ./key.png

And everything worked just perfectly.

But after looking through my scripts (because I've automated the
entire process), I see a test where I check if the size of the file to
be encoded is less than 1555 bytes, because it seems that dtmx (in
fact the specification?) doesn't allow files larger than this.

Another quirk that I've found is that decoding back that image
after being printed, photographed and put back in my computer worked
Ok for small sizes (~200-300 bytes), but for other files (closer to
~1000 bytes) I was not able to decode the image back even after some
image processing that enhances the contrast, sharpens the colors, etc.
(I haven't tried a scanner, but I guess that would have worked.)
(But the original file spitted out by dtmx was decoded just fine.)

Ciprian.


On Fri, Mar 12, 2010 at 10:42 PM, john espiro john_esp...@yahoo.com wrote:
 Hi David -

 Thanks for the quick reply.

 I should note that I am on a Windows XP box.

 When I run gpg --export-secret-key m...@key.com | paperkey  --output-type raw
 for both the 2048 and 4096, I note that the output for the 4096 key is about
 10% logner than that of the 2048 key.

 I am not familiar with wc.exe, but will google it...

 John

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


Paperkey (Was: Re: )

2010-03-11 Thread john espiro
Sorry for the empty subject... fixed now





From: john espiro john_esp...@yahoo.com
To: gnupg-users@gnupg.org
Sent: Thu, March 11, 2010 7:25:45 AM
Subject: 


I am using paperkey 1.2 from http://www.jabberwocky.com/software/paperkey/
and 
dmtxwrite version 0.7.3
libdmtx version 0.7.3

If I run this command:
gpg --export-secret-key my...@me.com | paperkey --ignore-crc-error  
--output-type raw | dmtxwrite -e8 -f png  my_pdf_file.png

I get the 2D barcode generated correctly -- if the key is 1024 or 2048.  If I 
try this with a secret key that is 4096, I am left with 20x20 pixel image that 
in no way looks complete.  I wonder if there's a limitation with either 
paperkey or dmtxwrite, or if I am doing something wrong.

If this isn't the right forum, please let me know...
John


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


Re: Paperkey (Was: Re: )

2010-03-11 Thread David Shaw
On Mar 11, 2010, at 3:16 AM, john espiro wrote:

 I am using paperkey 1.2 from http://www.jabberwocky.com/software/paperkey/
 and 
 dmtxwrite version 0.7.3
 libdmtx version 0.7.3
 
 If I run this command:
 gpg --export-secret-key my...@me.com | paperkey --ignore-crc-error  
 --output-type raw | dmtxwrite -e8 -f png  my_pdf_file.png
 
 I get the 2D barcode generated correctly -- if the key is 1024 or 2048.  If I 
 try this with a secret key that is 4096, I am left with 20x20 pixel image 
 that in no way looks complete.  I wonder if there's a limitation with either 
 paperkey or dmtxwrite, or if I am doing something wrong.

Paperkey doesn't care what size the key is.  Try doing that same command line, 
but use wc -c instead of the dmtxwrite part to check that the output is 
larger than with a 2048 bit key.  Perhaps dmtxwrite is having a problem?

David


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