From etiquettesg at gmail.com Thu May 5 01:49:01 2011 From: etiquettesg at gmail.com (Foo Lum) Date: Thu, 5 May 2011 09:19:01 +0930 Subject: Does libgcrypt provide pkcs1 unpadding functionality? Message-ID: Hey, In the libgcrypt doco, it specifies that you can define an s-expression that allows for the data to be padded in PKCS#1 before being encrypted. Is there a another function or another expression I could build to unpad the data after it has been decrypted or is there some other work around to do this? Thanks in advance! -------------- next part -------------- An HTML attachment was scrubbed... URL: From etiquettesg at gmail.com Thu May 5 01:49:53 2011 From: etiquettesg at gmail.com (Foo Lum) Date: Thu, 5 May 2011 09:19:53 +0930 Subject: How to use GPG exported keys in libgcrypt? Message-ID: Hey, Was wondering how could I use private/public keys exported by GPG to be used by libgcrypt? Libgcrypt needs to s-expression structures with its associated mpi values and I don't know how to extract that from the GPG export :( Thanks in advance! -------------- next part -------------- An HTML attachment was scrubbed... URL: From foo.lum at gmail.com Thu May 5 00:44:57 2011 From: foo.lum at gmail.com (Foo Lum) Date: Thu, 5 May 2011 08:14:57 +0930 Subject: Does libgcrypt provide pkcs1 unpadding functionality? Message-ID: Hey, In the libgcrypt doco, it specifies that you can define an s-expression that allows for the data to be padded in PKCS#1 before being encrypted. Is there a another function or another expression I could build to unpad the data after it has been decrypted or is there some other work around to do this? Thanks in advance! Foo -------------- next part -------------- An HTML attachment was scrubbed... URL: From foo.lum at gmail.com Thu May 5 00:47:00 2011 From: foo.lum at gmail.com (Foo Lum) Date: Thu, 5 May 2011 08:17:00 +0930 Subject: How to use GPG exported keys in libgcrypt? Message-ID: Hey, Was wondering how could I use private/public keys exported by GPG to be used by libgcrypt? Libgcrypt needs to s-expression structures with its associated mpi values and I don't know how to extract that from the GPG export :( Many thanks! Foo -------------- next part -------------- An HTML attachment was scrubbed... URL: From ueno at unixuser.org Thu May 12 03:51:39 2011 From: ueno at unixuser.org (Daiki Ueno) Date: Thu, 12 May 2011 10:51:39 +0900 Subject: Does libgcrypt provide pkcs1 unpadding functionality? In-Reply-To: (Foo Lum's message of "Thu, 5 May 2011 09:19:01 +0930") References: Message-ID: Foo Lum writes: > In the libgcrypt doco, it specifies that you can define an > s-expression that allows for the data to be padded in PKCS#1 before > being encrypted. Is there a another function or another expression I > could build to unpad the data after it has been decrypted or is there > some other work around to do this? The current git master supports "unpad" flag (it was introduced along with OAEP padding support yesterday). The document should be updated I guess...will try to do. Regards, -- Daiki Ueno From nehakochar1 at gmail.com Fri May 13 18:41:57 2011 From: nehakochar1 at gmail.com (sudoer) Date: Fri, 13 May 2011 09:41:57 -0700 (PDT) Subject: Libgcrypt CTR Mode Counter Value Message-ID: <31613046.post@talk.nabble.com> Hello All, I'm using libgcrypt-1.4.4 and wanted to know if the counter source for the CTR mode is internal or external. As far as I see in the code, the counter has to be set using the gcry_cipher_setctr() function. So, it sounds like "external" counter source, correct? But the CAVP or FIPS algorithm certificate for Libgcrypt's AES mentions that its CTR mode uses internal counter. Can someone please explain how? Also, if the counter is indeed sourced internally, how does Libgcrypt ensure that the counter values are always unique as specified in NIST SP800-38a standard? If someone can provide some code pointers for this, it would be great. I appreciate your time and help. Thanks. -- View this message in context: http://old.nabble.com/Libgcrypt-CTR-Mode-Counter-Value-tp31613046p31613046.html Sent from the GnuPG - Libgcrypt - Dev mailing list archive at Nabble.com. From info at eshat.de Sun May 15 13:35:40 2011 From: info at eshat.de (Eshat Cakar) Date: Sun, 15 May 2011 13:35:40 +0200 Subject: Colorize gpg terminal output Message-ID: <201105151335.40919.info@eshat.de> Dear List, what about adding colors to the output of gpg? For example color keys/lines green that have new signatures or other changes, when refreshing. And color keys red, that just got revoked since last refresh. This would improve the output information and make it easier for humans to read it. By now, when calling "gpg --refresh-keys" for instance, you have to read line by line for the "not changed" appendix which isn't aligned very well due to the different width of names. Since the output could be quiet a lot, I think it would be a good idea to add an (optional) color option, just like this is solved in git. I would be very happy to see this in a future version of gpg. If there already is such a thing, please ignore the above and give me a hint. Best regards -- eshat cakar web: www.eshat.de gpg-id: 799B 95D5 gpg-fingerprint: D59E 3B77 8662 D221 0900 D758 9D0F C2C1 799B 95D5 -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 836 bytes Desc: This is a digitally signed message part. URL: From wk at gnupg.org Mon May 16 11:35:40 2011 From: wk at gnupg.org (Werner Koch) Date: Mon, 16 May 2011 11:35:40 +0200 Subject: Colorize gpg terminal output In-Reply-To: <201105151335.40919.info@eshat.de> (Eshat Cakar's message of "Sun, 15 May 2011 13:35:40 +0200") References: <201105151335.40919.info@eshat.de> Message-ID: <87k4drvvgz.fsf@vigenere.g10code.de> On Sun, 15 May 2011 13:35, info at eshat.de said: > what about adding colors to the output of gpg? No. If you want that please write your own wrapper around gpg. BTW, this isn the Libgcrypt mailing list; you should mail to gnupg-users. Shalom-Salam, Werner -- Die Gedanken sind frei. Ausnahmen regelt ein Bundesgesetz. From wk at gnupg.org Mon May 16 11:39:01 2011 From: wk at gnupg.org (Werner Koch) Date: Mon, 16 May 2011 11:39:01 +0200 Subject: Libgcrypt CTR Mode Counter Value In-Reply-To: <31613046.post@talk.nabble.com> (sudoer's message of "Fri, 13 May 2011 09:41:57 -0700 (PDT)") References: <31613046.post@talk.nabble.com> Message-ID: <87fwofvvbe.fsf@vigenere.g10code.de> On Fri, 13 May 2011 18:41, nehakochar1 at gmail.com said: > But the CAVP or FIPS algorithm certificate for Libgcrypt's AES mentions that > its CTR mode uses internal counter. Can someone please explain how? Right. However, you need to set the start value. > Also, if the counter is indeed sourced internally, how does Libgcrypt ensure > that the counter values are always unique as specified in NIST SP800-38a > standard? Using something like counter++ which is what counter mode is about. I have not read FIPS documents for some time so I don't know exactly what the AES specs exactly mean by internal and external counter. Salam-Shalom, Werner -- Die Gedanken sind frei. Ausnahmen regelt ein Bundesgesetz. From ulm at gentoo.org Mon May 16 19:27:56 2011 From: ulm at gentoo.org (Ulrich Mueller) Date: Mon, 16 May 2011 19:27:56 +0200 Subject: IDEA support Message-ID: <19921.24220.826380.56157@a1i15.kph.uni-mainz.de> According to the IDEA patent has expired today. Are there any plans for (re-)adding support for the IDEA algorithm to libgcrypt? See also downstream bug at . Ulrich From wk at gnupg.org Mon May 16 20:26:35 2011 From: wk at gnupg.org (Werner Koch) Date: Mon, 16 May 2011 20:26:35 +0200 Subject: IDEA support In-Reply-To: <19921.24220.826380.56157@a1i15.kph.uni-mainz.de> (Ulrich Mueller's message of "Mon, 16 May 2011 19:27:56 +0200") References: <19921.24220.826380.56157@a1i15.kph.uni-mainz.de> Message-ID: <871uzyv6w4.fsf@vigenere.g10code.de> On Mon, 16 May 2011 19:27, ulm at gentoo.org said: > According to the IDEA > patent has expired today. Are there any plans for (re-)adding support > for the IDEA algorithm to libgcrypt? Maybe after the US patent expires next year. Still waiting for someone who want BassOMatic implemented ;-). Salam-Shalom, Werner -- Die Gedanken sind frei. Ausnahmen regelt ein Bundesgesetz. From ueno at unixuser.org Tue May 17 10:53:54 2011 From: ueno at unixuser.org (Daiki Ueno) Date: Tue, 17 May 2011 17:53:54 +0900 Subject: Does libgcrypt provide pkcs1 unpadding functionality? In-Reply-To: (Daiki Ueno's message of "Thu, 12 May 2011 10:51:39 +0900") References: Message-ID: Daiki Ueno writes: >> In the libgcrypt doco, it specifies that you can define an >> s-expression that allows for the data to be padded in PKCS#1 before >> being encrypted. Is there a another function or another expression I >> could build to unpad the data after it has been decrypted or is there >> some other work around to do this? > > The current git master supports "unpad" flag (it was introduced along > with OAEP padding support yesterday). The document should be updated I > guess...will try to do. Oh, sorry, with the current code the "unpad" flag only works with OAEP. I'm attaching a patch to support it with PKCS#1. You could take a look at check_pubkey_crypt in tests/basic.c for the usage. -------------- next part -------------- A non-text attachment was scrubbed... Name: 0001-Support-PKCS-1-block-type-2-unpadding.patch Type: text/x-patch Size: 3577 bytes Desc: not available URL: -------------- next part -------------- BTW, perhaps it might be good to factor out PKCS#1 encode logic to a separate function as well. Regards, -- Daiki Ueno From etiquettesg at gmail.com Tue May 17 15:22:08 2011 From: etiquettesg at gmail.com (Foo Lum) Date: Tue, 17 May 2011 22:52:08 +0930 Subject: Does libgcrypt provide pkcs1 unpadding functionality? In-Reply-To: References: Message-ID: Thanks for the info mate, I could only use libs that are already on redhat so I am manually unpadding the padding done by the encrypt function. On Tue, May 17, 2011 at 6:23 PM, Daiki Ueno wrote: > Daiki Ueno writes: > > >> In the libgcrypt doco, it specifies that you can define an > >> s-expression that allows for the data to be padded in PKCS#1 before > >> being encrypted. Is there a another function or another expression I > >> could build to unpad the data after it has been decrypted or is there > >> some other work around to do this? > > > > The current git master supports "unpad" flag (it was introduced along > > with OAEP padding support yesterday). The document should be updated I > > guess...will try to do. > > Oh, sorry, with the current code the "unpad" flag only works with OAEP. > I'm attaching a patch to support it with PKCS#1. You could take a look > at check_pubkey_crypt in tests/basic.c for the usage. > > > > BTW, perhaps it might be good to factor out PKCS#1 encode logic to a > separate function as well. > > Regards, > -- > Daiki Ueno > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From tom at ritter.vg Thu May 26 19:29:33 2011 From: tom at ritter.vg (Tom Ritter) Date: Thu, 26 May 2011 13:29:33 -0400 Subject: Double-Free in new Unpadding Code Message-ID: The following double-free in the new unpadding code was causing crashes on my machine when attempting a decrypt with invalid padding. Found it using valgrind after much head-smashing. It seems to apply with or without an error in padding, and for both PKCS1 and OAEP, although I only was testing OAEP, and only encountered it with invalid padding. The fix included definitely made the problem go away however. diff --git a/cipher/pubkey.c b/cipher/pubkey.c index ba888f3..5361287 100644 --- a/cipher/pubkey.c +++ b/cipher/pubkey.c @@ -2249,40 +2249,41 @@ gcry_pk_decrypt (gcry_sexp_t *r_plain, gcry_sexp_t s_data, gcry_sexp_t s_skey) rc = pubkey_decrypt (module_key->mod_id, &plain, data, skey, flags); if (rc) goto leave; /* Do un-padding if necessary. */ switch (ctx.encoding) { case PUBKEY_ENC_PKCS1: rc = pkcs1_decode_for_encryption (&unpad, gcry_pk_get_nbits (s_skey), plain); mpi_free (plain); + plain = NULL; if (rc) goto leave; plain = unpad; break; case PUBKEY_ENC_OAEP: rc = oaep_decode (&unpad, gcry_pk_get_nbits (s_skey), ctx.hash_algo, plain, ctx.label, ctx.labellen); mpi_free (plain); + plain = NULL; if (rc) goto leave; plain = unpad; break; default: break; } if (gcry_sexp_build (r_plain, NULL, modern? "(value %m)" : "%m", plain)) BUG (); leave: if (skey) { release_mpi_array (skey); gcry_free (skey); } if (plain) mpi_free (plain); -tom From tom at ritter.vg Thu May 26 19:44:08 2011 From: tom at ritter.vg (Tom Ritter) Date: Thu, 26 May 2011 13:44:08 -0400 Subject: Double-Free in new Unpadding Code In-Reply-To: References: Message-ID: On 26 May 2011 13:29, Tom Ritter wrote: > It seems to apply > with or without an error in padding, and for both PKCS1 and OAEP, Nevermind, it makes sense that it only occurs for invalid padding, as otherwise plain is set to a valid pointer to be freed later. -tom From wk at gnupg.org Thu May 26 22:20:37 2011 From: wk at gnupg.org (Werner Koch) Date: Thu, 26 May 2011 22:20:37 +0200 Subject: Double-Free in new Unpadding Code In-Reply-To: (Tom Ritter's message of "Thu, 26 May 2011 13:29:33 -0400") References: Message-ID: <87hb8h5i3u.fsf@vigenere.g10code.de> On Thu, 26 May 2011 19:29, tom at ritter.vg said: > The following double-free in the new unpadding code was causing > crashes on my machine when attempting a decrypt with invalid padding. I already found and fixed that in my local review branch. Thanks anyway. Shalom-Salam, Werner -- Die Gedanken sind frei. Ausnahmen regelt ein Bundesgesetz. From ueno at unixuser.org Fri May 27 03:22:38 2011 From: ueno at unixuser.org (Daiki Ueno) Date: Fri, 27 May 2011 10:22:38 +0900 Subject: Double-Free in new Unpadding Code In-Reply-To: <87hb8h5i3u.fsf@vigenere.g10code.de> (Werner Koch's message of "Thu, 26 May 2011 22:20:37 +0200") References: <87hb8h5i3u.fsf@vigenere.g10code.de> Message-ID: Werner Koch writes: > On Thu, 26 May 2011 19:29, tom at ritter.vg said: >> The following double-free in the new unpadding code was causing >> crashes on my machine when attempting a decrypt with invalid padding. > > I already found and fixed that in my local review branch. Thanks > anyway. Many thanks to Tom and Werner. I pushed the fix to the git master with invalid padding test cases. Regards, -- Daiki Ueno From saharyousefi82 at yahoo.com Mon May 30 20:21:13 2011 From: saharyousefi82 at yahoo.com (sahar yousefi) Date: Mon, 30 May 2011 11:21:13 -0700 (PDT) Subject: help Message-ID: <60609.30329.qm@web162011.mail.bf1.yahoo.com> Hello I'm working on asymmetric keys for encryption and decryption of files. I am going to encrypt data on sender PC using receiver's public key and send encrypted data to receiver in order to decrypt it using its private key. ?I have two PCs (A and B). I created a (public key, private key) on A and sent its public key to B. the public key is attached. Then I tried to encrypt a dir using "gpgdir" command. But I encountered below error. I'm wondered why gpg is looking for A's private key? Whenever we don?t want B knows the private key? How can I fix it? ? ============================================ # gpgdir --verbose -K el_ghasemi at yahoo.com -e /home/yousefi/Desktop/a [+] import_perl_modules(): The @INC array: /usr/local/lib64/perl5/site_perl/5.10.0/x86_64-linux-thread-multi /usr/local/lib/perl5/site_perl/5.10.0 /usr/lib64/perl5/vendor_perl/5.10.0/x86_64-linux-thread-multi /usr/lib/perl5/vendor_perl/5.10.0 /usr/lib/perl5/vendor_perl /usr/lib64/perl5/5.10.0/x86_64-linux-thread-multi /usr/lib/perl5/5.10.0 /usr/lib/perl5/site_perl . [+] Executing: gpgdir --verbose -K el_ghasemi at yahoo.com -e /home/yousefi/Desktop/a ??? Using GnuPG key: el_ghasemi at yahoo.com ??? Enter password (for initial encrypt/decrypt test) Password: 21961363 ? [+] test_mode(): Encrypt/Decrypt test of gpgdir_test.2902 [+] test_mode(): Created gpgdir_test.2902 Reading passphrase from file descriptor 9??? ? pub? 1024R/18EA55AA 2011-05-30 ghasemi (this is a encrypt test) ?Primary key fingerprint: C4F9 1073 B733 C752 C18C? EF81 1BFC 4C86 58C0 723B ????? Subkey fingerprint: D953 4E49 13CA 998C BF0F? 3CE5 7E3A 9360 18EA 55AA ? It is NOT certain that the key belongs to the person named in the user ID.? If you *really* know what you are doing, you may answer the next question with yes. ? Use this key anyway? (y/N) y gpg: 18EA55AA: There is no assurance this key belongs to the named user [+] test_mode(): Successful encrypt of gpgdir_test.2902 Reading passphrase from file descriptor 9??? ??? GnuPG errors: gpg: encrypted with 1024-bit RSA key, ID 18EA55AA, created 2011-05-30 ????? "ghasemi (this is a encrypt test) " gpg: decryption failed: secret key not available ??? GnuPG status: [GNUPG:] ENC_TO 7E3A936018EA55AA 1 0 [GNUPG:] NO_SECKEY 7E3A936018EA55AA [GNUPG:] BEGIN_DECRYPTION [GNUPG:] DECRYPTION_FAILED [GNUPG:] END_DECRYPTION [*] Created zero-size file: gpgdir_test.2902 ??? Bad password? Try with --verbose at /usr/bin/gpgdir line 642. ? Best regards -------------- next part -------------- An HTML attachment was scrubbed... URL: From vincent.torri at gmail.com Tue May 31 06:46:11 2011 From: vincent.torri at gmail.com (vincent.torri at gmail.com) Date: Tue, 31 May 2011 07:46:11 +0300 Subject: how are you? Message-ID: <4de49cad.051f440a.7206.ffff97e4@mx.google.com> hey , I've been earning cash online with this program I found http://g.msn.com.br/BR9/1369.0?http://cnbc7.com/news