From pinto.antonio at gmail.com Thu Nov 4 17:21:20 2004 From: pinto.antonio at gmail.com (=?ISO-8859-1?Q?Ant=F3nio_Pinto?=) Date: Thu Nov 4 17:25:40 2004 Subject: Newbie question - gcry_sexp_build Seg. Fault Message-ID: <90dd10ff04110408211b363008@mail.gmail.com> Hello, I'm getting a seg. fault while running the following code: ------------------------ int buildSig(int msgid, int leaderid, char * sig) { gcry_sexp_t plain, sign; int len,data; data=msgid+leaderid; gcry_sexp_build (&plain, NULL, "(data (flags raw) (value %d))", &data); /* SEG FAULT */ gcry_pk_sign(&sign, plain, sKey); len=gcry_sexp_sprint(sign, GCRYSEXP_FMT_ADVANCED, sig, sizeof(char)*1024); return len; } ------------------------ Can anyone tell me what am I doing wrong? I'm running libgcrypt 1.2.0 on a Fedora Core 2 Intel PC. thx -- Ant?nio Pinto From t.fromm at dresearch.de Fri Nov 5 02:17:43 2004 From: t.fromm at dresearch.de (t.fromm@dresearch.de) Date: Thu Nov 4 18:07:34 2004 Subject: Newbie question - gcry_sexp_build Seg. Fault In-Reply-To: <90dd10ff04110408211b363008@mail.gmail.com> References: <90dd10ff04110408211b363008@mail.gmail.com> Message-ID: On Thu, 4 Nov 2004, Ant?nio Pinto wrote: > I'm getting a seg. fault while running the following code: > > ------------------------ > gcry_sexp_build (&plain, NULL, "(data (flags raw) (value %d))", &data); /* SEG FAULT */ Typo here: you want to use tha value of (int) data, not the value at the address this (uninitialised) int points to. Try '...lue %d))", data);' . Regards, Thilo /* Dipl.-Ing. (FH) Thilo Fromm, MSc., Hardware & Software * DResearch Digital Media Systems GmbH * Otto-Schmirgal-Str. 3, 10319 Berlin, Germany * Tel: +49 (30) 515932-228 mailto:t.fromm@dresearch.de * Fax: +49 (30) 515932-299 http://www.dresearch.de */ From pinto.antonio at gmail.com Thu Nov 4 18:20:55 2004 From: pinto.antonio at gmail.com (=?ISO-8859-1?Q?Ant=F3nio_Pinto?=) Date: Thu Nov 4 18:29:00 2004 Subject: Newbie question - gcry_sexp_build Seg. Fault In-Reply-To: References: <90dd10ff04110408211b363008@mail.gmail.com> Message-ID: <90dd10ff04110409202678c424@mail.gmail.com> That was one of the attempts I've made to resolve the seg. fault. The actual code is the following: ------------------ int buildSig(int msgid, int leaderid, char * sig) { gcry_sexp_t plain, sign; int len,data; data=msgid+leaderid; gcry_sexp_build (&plain, NULL, "(data (flags raw) (value %d))", data); gcry_pk_sign(&sign, plain, sKey); len=gcry_sexp_sprint(sign, GCRYSEXP_FMT_ADVANCED, sig, sizeof(char)*1024); return len; } -------------------- And I keep getting de seg. fault. One thing I've noticied is that the seg. fault only happens on the first run (of the first forked process, in a multi process enviroment). thx On Fri, 5 Nov 2004 01:17:43 +0000 (Local time zone must be set--see zic manual page), t.fromm@dresearch.de wrote: > > On Thu, 4 Nov 2004, Ant?nio Pinto wrote: > > > I'm getting a seg. fault while running the following code: > > > > ------------------------ > > gcry_sexp_build (&plain, NULL, "(data (flags raw) (value %d))", &data); /* SEG FAULT */ > > Typo here: you want to use tha value of (int) data, not the value at the > address this (uninitialised) int points to. Try '...lue %d))", data);' . > > Regards, > Thilo > > /* Dipl.-Ing. (FH) Thilo Fromm, MSc., Hardware & Software > * DResearch Digital Media Systems GmbH > * Otto-Schmirgal-Str. 3, 10319 Berlin, Germany > * Tel: +49 (30) 515932-228 mailto:t.fromm@dresearch.de > * Fax: +49 (30) 515932-299 http://www.dresearch.de */ > > -- Ant?nio Pinto From pinto.antonio at gmail.com Fri Nov 5 12:59:14 2004 From: pinto.antonio at gmail.com (=?ISO-8859-1?Q?Ant=F3nio_Pinto?=) Date: Fri Nov 5 13:20:38 2004 Subject: Newbie question - gcry_sexp_build Seg. Fault In-Reply-To: <90dd10ff04110409202678c424@mail.gmail.com> References: <90dd10ff04110408211b363008@mail.gmail.com> <90dd10ff04110409202678c424@mail.gmail.com> Message-ID: <90dd10ff04110503593a8a4695@mail.gmail.com> I've tried replacing the gcry_sexp_build with gcry_sexp_sscan, but I still get a seg. fault. The current code is: ------------------- int buildSig(int msgid, int leaderid, char * sig) { gcry_sexp_t plain, sign; int len; char exp[1024]; sprintf(exp,"(data (flags raw) (value %d))",msgid+leaderid); // gcry_sexp_build (&plain, NULL, "(data (flags raw) (value %s))", val); gcry_sexp_sscan(&plain,NULL,exp,strlen(exp)); gcry_pk_sign(&sign, plain, sKey); len=gcry_sexp_sprint(sign, GCRYSEXP_FMT_ADVANCED, sig, sizeof(char)*1024); return len; } ------------------- On Thu, 4 Nov 2004 17:20:55 +0000, Ant?nio Pinto wrote: > That was one of the attempts I've made to resolve the seg. fault. The > actual code is the following: > > > > ------------------ > int buildSig(int msgid, int leaderid, char * sig) { > gcry_sexp_t plain, sign; > int len,data; > > data=msgid+leaderid; > gcry_sexp_build (&plain, NULL, "(data (flags raw) (value %d))", data); > gcry_pk_sign(&sign, plain, sKey); > len=gcry_sexp_sprint(sign, GCRYSEXP_FMT_ADVANCED, sig, sizeof(char)*1024); > > return len; > } > -------------------- > > And I keep getting de seg. fault. > One thing I've noticied is that the seg. fault only happens on the > first run (of the first forked process, in a multi process > enviroment). > > thx > > On Fri, 5 Nov 2004 01:17:43 +0000 (Local time zone must be set--see > > > zic manual page), t.fromm@dresearch.de wrote: > > > > On Thu, 4 Nov 2004, Ant?nio Pinto wrote: > > > > > I'm getting a seg. fault while running the following code: > > > > > > ------------------------ > > > gcry_sexp_build (&plain, NULL, "(data (flags raw) (value %d))", &data); /* SEG FAULT */ > > > > Typo here: you want to use tha value of (int) data, not the value at the > > address this (uninitialised) int points to. Try '...lue %d))", data);' . > > > > Regards, > > Thilo > > > > /* Dipl.-Ing. (FH) Thilo Fromm, MSc., Hardware & Software > > * DResearch Digital Media Systems GmbH > > * Otto-Schmirgal-Str. 3, 10319 Berlin, Germany > > * Tel: +49 (30) 515932-228 mailto:t.fromm@dresearch.de > > * Fax: +49 (30) 515932-299 http://www.dresearch.de */ > > > > > > > -- > Ant?nio Pinto > -- Ant?nio Pinto From pinto.antonio at gmail.com Fri Nov 5 13:09:20 2004 From: pinto.antonio at gmail.com (=?ISO-8859-1?Q?Ant=F3nio_Pinto?=) Date: Fri Nov 5 13:20:40 2004 Subject: Newbie question - gcry_sexp_build Seg. Fault In-Reply-To: <90dd10ff04110503593a8a4695@mail.gmail.com> References: <90dd10ff04110408211b363008@mail.gmail.com> <90dd10ff04110409202678c424@mail.gmail.com> <90dd10ff04110503593a8a4695@mail.gmail.com> Message-ID: <90dd10ff04110504093aba5d58@mail.gmail.com> I forgot to attache the debugger output: ------- Program received signal SIGSEGV, Segmentation fault. 0x008743b2 in gcry_sexp_cadr() from /usr/lib/libgcrypt.s0.11 ------- I'm using Anjuta (don't if this is important). thx On Fri, 5 Nov 2004 11:59:14 +0000, Ant?nio Pinto wrote: > I've tried replacing the gcry_sexp_build with gcry_sexp_sscan, but I > still get a seg. fault. > The current code is: > ------------------- > int buildSig(int msgid, int leaderid, char * sig) { > gcry_sexp_t plain, sign; > int len; char exp[1024]; > > sprintf(exp,"(data (flags raw) (value %d))",msgid+leaderid); > // gcry_sexp_build (&plain, NULL, "(data (flags raw) (value %s))", val); > gcry_sexp_sscan(&plain,NULL,exp,strlen(exp)); > gcry_pk_sign(&sign, plain, sKey); > len=gcry_sexp_sprint(sign, GCRYSEXP_FMT_ADVANCED, sig, sizeof(char)*1024); > > return len; > } > ------------------- > > > On Thu, 4 Nov 2004 17:20:55 +0000, Ant?nio Pinto > > > wrote: > > That was one of the attempts I've made to resolve the seg. fault. The > > actual code is the following: > > > > > > > > ------------------ > > int buildSig(int msgid, int leaderid, char * sig) { > > gcry_sexp_t plain, sign; > > int len,data; > > > > data=msgid+leaderid; > > gcry_sexp_build (&plain, NULL, "(data (flags raw) (value %d))", data); > > gcry_pk_sign(&sign, plain, sKey); > > len=gcry_sexp_sprint(sign, GCRYSEXP_FMT_ADVANCED, sig, sizeof(char)*1024); > > > > return len; > > } > > -------------------- > > > > And I keep getting de seg. fault. > > One thing I've noticied is that the seg. fault only happens on the > > first run (of the first forked process, in a multi process > > enviroment). > > > > thx > > > > On Fri, 5 Nov 2004 01:17:43 +0000 (Local time zone must be set--see > > > > > > zic manual page), t.fromm@dresearch.de wrote: > > > > > > On Thu, 4 Nov 2004, Ant?nio Pinto wrote: > > > > > > > I'm getting a seg. fault while running the following code: > > > > > > > > ------------------------ > > > > gcry_sexp_build (&plain, NULL, "(data (flags raw) (value %d))", &data); /* SEG FAULT */ > > > > > > Typo here: you want to use tha value of (int) data, not the value at the > > > address this (uninitialised) int points to. Try '...lue %d))", data);' . > > > > > > Regards, > > > Thilo > > > > > > /* Dipl.-Ing. (FH) Thilo Fromm, MSc., Hardware & Software > > > * DResearch Digital Media Systems GmbH > > > * Otto-Schmirgal-Str. 3, 10319 Berlin, Germany > > > * Tel: +49 (30) 515932-228 mailto:t.fromm@dresearch.de > > > * Fax: +49 (30) 515932-299 http://www.dresearch.de */ > > > > > > > > > > > > -- > > Ant?nio Pinto > > > > > -- > Ant?nio Pinto > -- Ant?nio Pinto From wk at gnupg.org Fri Nov 5 15:45:05 2004 From: wk at gnupg.org (Werner Koch) Date: Fri Nov 5 15:45:12 2004 Subject: Newbie question - gcry_sexp_build Seg. Fault In-Reply-To: <90dd10ff04110503593a8a4695@mail.gmail.com> =?utf-8?q?=28Ant=C3=B3nio?= Pinto's message of "Fri, 5 Nov 2004 11:59:14 +0000") References: <90dd10ff04110408211b363008@mail.gmail.com> <90dd10ff04110409202678c424@mail.gmail.com> <90dd10ff04110503593a8a4695@mail.gmail.com> Message-ID: <87u0s4xslq.fsf@wheatstone.g10code.de> Hi, if you want us to help you you should give us more detailed information. Printing the values used in the function before the SEGV as well as full backtrace is essential (in gdb enter "bt full"). On Fri, 5 Nov 2004 11:59:14 +0000, Ant?nio Pinto said: >> data=msgid+leaderid; >> gcry_sexp_build (&plain, NULL, "(data (flags raw) (value %d))", data); >> gcry_pk_sign(&sign, plain, sKey); Signing a plain integer in raw mode is in most cases not a good idea. Depending on the circumstances it is vulnerable to several real world attacks. Werner From uschenk at versant.com Fri Nov 5 19:40:13 2004 From: uschenk at versant.com (Ulf Schenk) Date: Fri Nov 5 19:37:50 2004 Subject: decrypting errors with ARM - i386 Message-ID: Hello, I have a question regarding libgcrypt. We develop a software running on i386 linux and on the PDA zaurus platform (linux on strongARM processor). We are using libgcrypt 1.2 and link the files statically into our code. Depending on the target (i386, ARM) we are using the GNU compiler or the GNU crosscompiler. Encryption/decryption on the same platform works well. But If I move an encrypted file to the other platform, the decryption process fails with crashes. Example: encrypt a file with Linux, and then decrypt the same file on the ARM or vice versa. The configuration of libgcrypt we are using is based on mpi/generic. I checked also if configure generates different config.h files for i386 and ARM. But the resulting config.h is basically the same. Only that configure generates for i386 links to mpi/i386 (compared with mpi/generic for the ARM) - Did you hear about this behavior? - Do you have ideas how to fix that? - Are there any implications if I use mpi/generic for i386? Thanks, Ulf __________________________________ Ulf Schenk Technical Support, Versant Corporation Email: uschenk@versant.com Phone: 510-789-1642 Fax: 510-789-1519 From wk at gnupg.org Fri Nov 5 22:46:18 2004 From: wk at gnupg.org (Werner Koch) Date: Fri Nov 5 22:49:27 2004 Subject: decrypting errors with ARM - i386 In-Reply-To: (Ulf Schenk's message of "Fri, 5 Nov 2004 10:40:13 -0800") References: Message-ID: <87actwvuj9.fsf@wheatstone.g10code.de> On Fri, 5 Nov 2004 10:40:13 -0800, Ulf Schenk said: > Encryption/decryption on the same platform works well. But If I move an > encrypted file to the other platform, the decryption process fails with > crashes. To track down the probelm we first need to know how you encrypt a file. Libgcrypt is just a low-level library and does not implement any protocol. A stack bachtrace would be helpful too ("bt full" in gdb on the core file or the process). > - Are there any implications if I use mpi/generic for i386? No, it works on any platform as it is plain C code and very likely has been used on little and big endian machines. Shalom-Salam, Werner From uschenk at versant.com Mon Nov 8 18:55:03 2004 From: uschenk at versant.com (Ulf Schenk) Date: Mon Nov 8 18:53:03 2004 Subject: decrypting errors with ARM - i386 Message-ID: I found the problem finally, And it was of course an application error, and unrelated to libgcrypt. Thanks for your help. Ulf > -----Original Message----- > From: Werner Koch [mailto:wk@gnupg.org] > Sent: Friday, November 05, 2004 1:46 PM > To: Ulf Schenk > Cc: gcrypt-devel@gnupg.org > Subject: Re: decrypting errors with ARM - i386 > > On Fri, 5 Nov 2004 10:40:13 -0800, Ulf Schenk said: > > > Encryption/decryption on the same platform works well. But If I move an > > encrypted file to the other platform, the decryption process fails with > > crashes. > > To track down the probelm we first need to know how you encrypt a > file. Libgcrypt is just a low-level library and does not implement > any protocol. A stack bachtrace would be helpful too ("bt full" in > gdb on the core file or the process). > > > - Are there any implications if I use mpi/generic for i386? > > No, it works on any platform as it is plain C code and very likely has > been used on little and big endian machines. > > > Shalom-Salam, > > Werner From uschenk at versant.com Mon Nov 8 20:10:40 2004 From: uschenk at versant.com (Ulf Schenk) Date: Mon Nov 8 20:08:17 2004 Subject: win32 build Message-ID: Hello, Is there somewhere a howto document that describes how to compile libgcrypt for windows. I could not find anything on the website. The targetsystem would be the MSVC 7.0/7.1 compiler. What I want to archive (if possible) is to create an archive file of libgrypt 1.2 that I can link statically into my MSVC7.0 project. Is this possible, or do I have to create a libgcrypt DLL? Thanks, Ulf From wk at gnupg.org Mon Nov 8 21:20:01 2004 From: wk at gnupg.org (Werner Koch) Date: Mon Nov 8 21:19:29 2004 Subject: win32 build In-Reply-To: (Ulf Schenk's message of "Mon, 8 Nov 2004 11:10:40 -0800") References: Message-ID: <873bzkf5zi.fsf@wheatstone.g10code.de> On Mon, 8 Nov 2004 11:10:40 -0800, Ulf Schenk said: > Is there somewhere a howto document that describes how to compile > libgcrypt for windows. I could not find anything on the website. > The targetsystem would be the MSVC 7.0/7.1 compiler. I have not tried it yet and will definitely not use MSVC ;-). Please take care that using Libgcrypt under Windows is subject to the terms of the GPL not the LGPL. Werner From stamer at flower.theory.informatik.uni-kassel.de Mon Nov 8 21:35:31 2004 From: stamer at flower.theory.informatik.uni-kassel.de (Heiko Stamer) Date: Tue Nov 9 13:53:20 2004 Subject: GCC warnings about enumerator lists in gcrypt.h Message-ID: <20041108203531.GA27510@flower.theory.informatik.uni-kassel.de> Hello libgrypt-team, during portage of a software (which uses libgcrypt-1.2) to Darwin 7.5.0/powerpc the following warnings of 'gcc 3.3 (Apple Computer, Inc. build 1666)' occured: gcrypt.h:729 comma at end of enumerator list gcrypt.h:947 comma at end of enumerator list gcrypt.h:955 comma at end of enumerator list The following patch fixes the above inaccuracies. 728c728 < GCRY_CIPHER_RFC2268_128 = 308, /* Ron's Cipher 2 (128 bit). */ --- > GCRY_CIPHER_RFC2268_128 = 308 /* Ron's Cipher 2 (128 bit). */ 946c946 < GCRY_AC_ELG_E = 16, --- > GCRY_AC_ELG_E = 16 954c954 < GCRY_AC_KEY_PUBLIC, --- > GCRY_AC_KEY_PUBLIC Hope this helps, Best regards. -- Heiko Stamer -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 185 bytes Desc: not available Url : /pipermail/attachments/20041108/1748b4a8/attachment.bin From pinto.antonio at gmail.com Tue Nov 9 12:46:26 2004 From: pinto.antonio at gmail.com (=?ISO-8859-1?Q?Ant=F3nio_Pinto?=) Date: Tue Nov 9 13:53:23 2004 Subject: Newbie question - gcry_sexp_build Seg. Fault In-Reply-To: <87u0s4xslq.fsf@wheatstone.g10code.de> References: <90dd10ff04110408211b363008@mail.gmail.com> <90dd10ff04110409202678c424@mail.gmail.com> <90dd10ff04110503593a8a4695@mail.gmail.com> <87u0s4xslq.fsf@wheatstone.g10code.de> Message-ID: <90dd10ff04110903461dcb221e@mail.gmail.com> Hello again, Problem solved, I recoded the app from scratch and I don't have the problem anymore. The problem was probably related to the fact that I was using (badly) some symmetic encryption gcrypt routines in another part of the program. Thanks for the help. On Fri, 05 Nov 2004 15:45:05 +0100, Werner Koch wrote: > Hi, > > if you want us to help you you should give us more detailed > information. Printing the values used in the function before the SEGV > as well as full backtrace is essential (in gdb enter "bt full"). > > On Fri, 5 Nov 2004 11:59:14 +0000, Ant?nio Pinto said: > > >> data=msgid+leaderid; > >> gcry_sexp_build (&plain, NULL, "(data (flags raw) (value %d))", data); > >> gcry_pk_sign(&sign, plain, sKey); > > Signing a plain integer in raw mode is in most cases not a good idea. > Depending on the circumstances it is vulnerable to several real world > attacks. > > Werner > > -- Ant?nio Pinto From wk at gnupg.org Tue Nov 9 16:54:04 2004 From: wk at gnupg.org (Werner Koch) Date: Tue Nov 9 16:54:28 2004 Subject: Newbie question - gcry_sexp_build Seg. Fault In-Reply-To: <90dd10ff04110903461dcb221e@mail.gmail.com> =?utf-8?q?=28Ant=C3=B3nio?= Pinto's message of "Tue, 9 Nov 2004 11:46:26 +0000") References: <90dd10ff04110408211b363008@mail.gmail.com> <90dd10ff04110409202678c424@mail.gmail.com> <90dd10ff04110503593a8a4695@mail.gmail.com> <87u0s4xslq.fsf@wheatstone.g10code.de> <90dd10ff04110903461dcb221e@mail.gmail.com> Message-ID: <878y9b5883.fsf@wheatstone.g10code.de> On Tue, 9 Nov 2004 11:46:26 +0000, Ant?nio Pinto said: > The problem was probably related to the fact that I was using (badly) > some symmetic encryption gcrypt routines in another part of the > program. If you are running GNU/Linux on an ia32 box you should use valgrind to point out such problems. It is really helpful in case of dangling pointers and overwritten memory. Werner From pinto.antonio at gmail.com Tue Nov 9 17:58:17 2004 From: pinto.antonio at gmail.com (=?ISO-8859-1?Q?Ant=F3nio_Pinto?=) Date: Tue Nov 9 17:57:53 2004 Subject: Newbie question - gcry_sexp_build Seg. Fault In-Reply-To: <878y9b5883.fsf@wheatstone.g10code.de> References: <90dd10ff04110408211b363008@mail.gmail.com> <90dd10ff04110409202678c424@mail.gmail.com> <90dd10ff04110503593a8a4695@mail.gmail.com> <87u0s4xslq.fsf@wheatstone.g10code.de> <90dd10ff04110903461dcb221e@mail.gmail.com> <878y9b5883.fsf@wheatstone.g10code.de> Message-ID: <90dd10ff0411090858162f0eef@mail.gmail.com> Thx for the tip, I've never used it, but i'll give it a go... ;) On Tue, 09 Nov 2004 16:54:04 +0100, Werner Koch wrote: > On Tue, 9 Nov 2004 11:46:26 +0000, Ant?nio Pinto said: > > > The problem was probably related to the fact that I was using (badly) > > some symmetic encryption gcrypt routines in another part of the > > program. > > If you are running GNU/Linux on an ia32 box you should use valgrind to > point out such problems. It is really helpful in case of dangling > pointers and overwritten memory. > > Werner > > -- Ant?nio Pinto From wk at gnupg.org Tue Nov 9 18:03:38 2004 From: wk at gnupg.org (Werner Koch) Date: Tue Nov 9 18:04:27 2004 Subject: GCC warnings about enumerator lists in gcrypt.h In-Reply-To: <20041108203531.GA27510@flower.theory.informatik.uni-kassel.de> (Heiko Stamer's message of "Mon, 8 Nov 2004 21:35:31 +0100") References: <20041108203531.GA27510@flower.theory.informatik.uni-kassel.de> Message-ID: <87is8f3qfp.fsf@wheatstone.g10code.de> On Mon, 8 Nov 2004 21:35:31 +0100, Heiko Stamer said: > gcrypt.h:729 comma at end of enumerator list > gcrypt.h:947 comma at end of enumerator list > gcrypt.h:955 comma at end of enumerator list Thank. Fixed in CVS. Werner From zgrp_zgrp at yahoo.com.br Mon Nov 22 18:00:44 2004 From: zgrp_zgrp at yahoo.com.br (zgrp unknow) Date: Mon Nov 22 17:57:48 2004 Subject: twofish without block mode... Message-ID: <20041122170044.71153.qmail@web54405.mail.yahoo.com> Hello, I have a program to windows that I want to port to Linux (so I will use Linux all day at work), the program encrypt some files with twofish without any block chiper (like cbc, cfb, ecb, etc), so I need to encrypt and decrypt in this way. I started to search at Internet and found basic two libs the libmcrypt and libgcrypt, the libmcrypt unhapilly doesn't appear to work WITHOUT block chipers (or you choose ebc, ecb, etc, or die ), so i started to check the libgcrypt. :) Well, The .info file is very informative, but with a lot of information (i'm a little confused) and not examples code. :( The good think I found on libmcrypt is that it have two .c examples file, why not add something like in libgcrypt ? Well, let's to my problem, can someone send me a basic example code encode and decode of twofish without block chipers with libgcrypt ? obs: If doesn't have with twofish can be other algorithm, i think i can make it work with twofish.... I need a example that work.. hehehe Thkz a lot. Regards, _______________________________________________________ Yahoo! Acesso Gr?tis - Internet r?pida e gr?tis. Instale o discador agora! http://br.acesso.yahoo.com/ From wk at gnupg.org Mon Nov 22 19:55:40 2004 From: wk at gnupg.org (Werner Koch) Date: Mon Nov 22 19:59:38 2004 Subject: twofish without block mode... In-Reply-To: <20041122170044.71153.qmail@web54405.mail.yahoo.com> (zgrp unknow's message of "Mon, 22 Nov 2004 14:00:44 -0300 (ART)") References: <20041122170044.71153.qmail@web54405.mail.yahoo.com> Message-ID: <87zn19lnmb.fsf@wheatstone.g10code.de> On Mon, 22 Nov 2004 14:00:44 -0300 (ART), zgrp unknow said: > Well, let's to my problem, can someone send me a basic > example code encode and decode of twofish without > block chipers with libgcrypt ? Twofish is a block cipher and can't me turned into a stream cipher. Stream ciphers are a different class of algorithm. Well, you may use CFB mode which has similar properties. Why do you want to use a stream cipher at all. Correct use of stream ciphers isn't easy. Before you start to do something like this you definitely should get your hands on literature (no, Applied Cryptography isn't enough - get Ferguson and Schneier's Practical Cryptography). Salam-Shalom, Werner From jrydberg at gnu.org Fri Nov 26 00:27:56 2004 From: jrydberg at gnu.org (Johan Rydberg) Date: Fri Nov 26 00:15:12 2004 Subject: PATCH: gcry_ac_key_get_elements Message-ID: <87wtw9mrur.fsf@gnu.org> Hi, I did not find any way of extracting the element names from a key (it is possible to extract the _number_ of elements using GCRYCTL_GET_ALGO_N[PS]KEY, though.) Here's a function that does just that. I just write a "ac API" version of the function, since that's the API I'm using. Cheers, Johan. [cipher/] 2004-11-26 Johan Rydberg * ac.c (gcry_ac_key_get_elements): New function. [src/] 2004-11-26 Johan Rydberg * libgcrypt.vers (gcry_ac_key_get_elemenets): Add. * gcrypt.h (gcry_ac_key_get_elements): New. [tests/] 2004-11-26 Johan Rydberg * ac.c (check_one): Test gcry_ac_key_get_elements. -------------- next part -------------- A non-text attachment was scrubbed... Name: gcr-ac-elements.patch Type: text/x-patch Size: 3486 bytes Desc: gcry_ac_key_get_elements Url : /pipermail/attachments/20041126/0a6d7c30/gcr-ac-elements-0001.bin