From viviane@imagoweb.com.br Tue Oct 1 18:29:04 2002
From: viviane@imagoweb.com.br (=?iso-8859-1?Q?Viviane_Antonia_Corr=EAa_Thom=E9?=)
Date: Tue, 1 Oct 2002 14:29:04 -0300
Subject: Questions about key generate.
Message-ID: <119D777F3023F54BB0E86676C83202F00A56EE@hercules.imagoweb.com.br>
This is a multi-part message in MIME format.
------_=_NextPart_001_01C26970.09E2D396
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Hi,
=20
I would like to create keys randomly.=20
I wanted to know if I must make this=20
using to function: =20
void gcry_randomize (unsigned to char * buffer, size_t length, enum
gcry_random_level level)
or another exists of makes it.=20
=20
Thank's,
Viviane Thom=E9.
=20
=20
------_=_NextPart_001_01C26970.09E2D396
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
=00
------_=_NextPart_001_01C26970.09E2D396--
From wk@gnupg.org Tue Oct 1 19:09:34 2002
From: wk@gnupg.org (Werner Koch)
Date: Tue, 01 Oct 2002 20:09:34 +0200
Subject: Questions about key generate.
In-Reply-To: <119D777F3023F54BB0E86676C83202F00A56EE@hercules.imagoweb.com.br>
(Viviane Antonia =?iso-8859-1?q?Corr=EAa_Thom=E9's?= message of "Tue, 1 Oct
2002 14:29:04 -0300")
References: <119D777F3023F54BB0E86676C83202F00A56EE@hercules.imagoweb.com.br>
Message-ID: <87wup2qbdt.fsf@alberti.gnupg.de>
On Tue, 1 Oct 2002 14:29:04 -0300, Viviane Antonia Corrêa Thomé said:
> I would like to create keys randomly.
This is in general a good idea as long as you have established a way
for key agreement.
> void gcry_randomize (unsigned to char * buffer, size_t length, enum
> gcry_random_level level)
This is a good choice, regarding the random levele you must decide for
what the keys are used and what your threat model is.
Shalom-Salam,
Werner
From nisse@lysator.liu.se Wed Oct 2 23:38:56 2002
From: nisse@lysator.liu.se (Niels =?iso-8859-1?q?M=F6ller?=)
Date: 03 Oct 2002 00:38:56 +0200
Subject: ANNOUNCE: Nettle-1.6
Message-ID:
NEWS for the 1.6 release
Optimized assembler implementations of aes, for sparc and x86.
The aes interface has changed slightly. The function
aes_set_key is no more. Instead one has to use
aes_set_encrypt_key or aes_set_decrypt_key. Sorry about that.
New example programs, rsa-keygen, rsa-sign and rsa-verify,
located in the examples directory.
New configure option --enable-shared, which builds a shared
library. Not tested.
New experimental features, including sexp parsing and
formatting, and changes to base64 encoding and decoding. The
interfaces to these functions are subject to change, and are
documented only in the source code.
I'll appreciate comments on the new things, in particular the
--enable-shared option, and the new sexp functions, which probably can
be simplified a little.
I've also created a nettle mailing list, see for
subscription information. I expect it to be a low-volume list.
Further announcements of nettle releases will be sent to that list,
and probably not to the lsh or the gcrypt lists.
nettle-1.6 is available at
http://www.lysator.liu.se/~nisse/archive
ftp://ftp.lysator.liu.se/pub/security/lsh
Happy hacking,
/Niels Möller
From viviane@imagoweb.com.br Thu Oct 3 22:16:22 2002
From: viviane@imagoweb.com.br (=?iso-8859-1?Q?Viviane_Antonia_Corr=EAa_Thom=E9?=)
Date: Thu, 3 Oct 2002 18:16:22 -0300
Subject: signature.
Message-ID: <119D777F3023F54BB0E86676C83202F00A56F0@hercules.imagoweb.com.br>
This is a multi-part message in MIME format.
------_=_NextPart_001_01C26B22.1FC766C4
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Hi,
=20
I have problems with create signatures.
I need an explanation on how to use the signature functions.
If you can help me, please send me explanation about
signature in libgcrypt 1.1.9 or suggestions where I can
find some code example.
=20
Thanks,
=20
Viviane.
=20
------_=_NextPart_001_01C26B22.1FC766C4
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Hi,=
font>
I have problems with =
create
signatures.
I need an explanation =
on how
to use the signature functions.
If you can help me, =
please
send me explanation about
signature in libgcrypt
1.1.9 or suggestions where I can
find some code =
example.
Thanks,
Viviane.
=00
------_=_NextPart_001_01C26B22.1FC766C4--
From cplusplushelp@gmx.net Tue Oct 22 16:58:04 2002
From: cplusplushelp@gmx.net (Ruediger Sonderfeld)
Date: Tue, 22 Oct 2002 17:58:04 +0200
Subject: Fatal: memory at 0x804a3dc corrupted (underflow=40)
Message-ID: <183zaB-0H3J32C@fmrl01.sul.t-online.com>
hi,
I'm trying to encrypt some data with RSA using the libgcrypt CVS snapshot.
I'm using Code I extracted and modified from gnupg-1.1.2 to encrypt the data
GCRY_SEXP list,s_pkey,s_data,s_ciph;
GCRY_MPI* pkey=key.pubkey;
GCRY_MPI data,resarr[2];
gcry_mpi_scan(&data,GCRYMPI_FMT_USG,sdata,&ndata);
switch(alg)
{
case GCRY_PK_ELG:
case GCRY_PK_ELG_E:
if(gcry_sexp_build ( &s_pkey, NULL,
"(public-key(elg(p%m)(g%m)(y%m)))",
pkey[0], pkey[1], pkey[2] ))
return -1;
break;
case GCRY_PK_RSA:
if(gcry_sexp_build( &s_pkey, NULL,
"(public-key(rsa(n%m)(e%m)))",
pkey[0] /* n */, pkey[1] /* e */ ))
return -1;
break;
default:
return -1;
}
/* put the data into a simple list */
if ( gcry_sexp_build( &s_data, NULL, "%m", data ) )
return -1;
/* pass it to libgcrypt */
gcry_pk_encrypt( &s_ciph, s_data, s_pkey );
gcry_sexp_release( s_data );
gcry_sexp_release( s_pkey );
/* extract the MPI values */
if(! (list=gcry_sexp_find_token(s_ciph,"a",0)))
return -1;
if(! (resarr[0]=gcry_sexp_nth_mpi(list,1,0)))
return -1;
gcry_sexp_release ( list );
if(alg==GCRY_PK_ELG||alg==GCRY_PK_ELG_E)
{
if(! (list=gcry_sexp_find_token(s_ciph,"b",0)))
return -1;
if(! (resarr[1]=gcry_sexp_nth_mpi(list,1,0)))
return -1;
}
gcry_sexp_release ( list );
gcry_mpi_print(GCRYMPI_FMT_USG,to,&nto,resarr[0]);
return 0;
In the gcry_sexp_release ( list ); function the program exits always with the
error code 02 and this message is printed to stderr
Fatal: memory at 0x804a3dc corrupted (underflow=40)
what is wrong?
From twoaday@freakmail.de Tue Oct 22 15:31:21 2002
From: twoaday@freakmail.de (Timo Schulz)
Date: Tue, 22 Oct 2002 16:31:21 +0200
Subject: Fatal: memory at 0x804a3dc corrupted (underflow=40)
In-Reply-To: <183zaB-0H3J32C@fmrl01.sul.t-online.com>
References: <183zaB-0H3J32C@fmrl01.sul.t-online.com>
Message-ID: <20021022143121.GA13916@daredevil.joesixpack.net>
On Tue Oct 22 2002; 17:58, Ruediger Sonderfeld wrote:
> /* extract the MPI values */
> if(! (list=gcry_sexp_find_token(s_ciph,"a",0)))
> return -1;
> if(! (resarr[0]=gcry_sexp_nth_mpi(list,1,0)))
> return -1;
>++ gcry_sexp_release ( list );
>
> if(alg==GCRY_PK_ELG||alg==GCRY_PK_ELG_E)
> {
> if(! (list=gcry_sexp_find_token(s_ciph,"b",0)))
> return -1;
> if(! (resarr[1]=gcry_sexp_nth_mpi(list,1,0)))
> return -1;
> }
>** gcry_sexp_release ( list );
> gcry_mpi_print(GCRYMPI_FMT_USG,to,&nto,resarr[0]);
> return 0;
>
Correcte me if I'm wrong but...if you use RSA, the list is released at ++.
Then the next if statement is not used (it's RSA) and then you release
the list *again* at **. I would say this is not right.
Only free the list again, if ELG is used.
Timo
From cplusplushelp@gmx.net Tue Oct 22 20:01:52 2002
From: cplusplushelp@gmx.net (Ruediger Sonderfeld)
Date: Tue, 22 Oct 2002 21:01:52 +0200
Subject: Fatal: memory at 0x804a3dc corrupted (underflow=40)
In-Reply-To: <20021022143121.GA13916@daredevil.joesixpack.net>
References: <183zaB-0H3J32C@fmrl01.sul.t-online.com> <20021022143121.GA13916@daredevil.joesixpack.net>
Message-ID: <1842S3-12OC2KC@fmrl04.sul.t-online.com>
On Tuesday, 22. October 2002 16:31, you wrote:
> Correcte me if I'm wrong but...if you use RSA, the list is released at ++.
> Then the next if statement is not used (it's RSA) and then you release
> the list *again* at **. I would say this is not right.
>
> Only free the list again, if ELG is used.
Oh I'm an idiot. Thanks for your help.
But now I have another problem. I want to decrypt some data with RSA I use a
function which I extracted and modified from gnupg-1.1.2 too
But now I recive this error and the program recives a SIGABRT
Fatal error: out of core in secure memory
What is now wrong?
(encrypted_data is a typedef for MPI and pkkey is the structur
typedef struct
{
pk_key *pubkey; //public key
pk_key *prikey; //private key
} pkkey;
)
int wcrypt_pkdecrypt(pkalgo algo,const encrypted_data *data,unsigned char*
to,size_t tn,pkkey key)
{
GCRY_SEXP s_skey,s_data,s_plain;
int rc;
MPI *result=NULL,*skey=key.prikey;
switch(algo)
{
case GCRY_PK_ELG:
case GCRY_PK_ELG_E:
/* make a sexp from skey */
if(gcry_sexp_build(&s_skey,NULL,
"(private-key(elg(p%m)(g%m)(y%m)(x%m)))",
skey[0], skey[1], skey[2], skey[3]))
return -1;
/* put data into a S-Exp s_data */
if(gcry_sexp_build(&s_data,NULL,"(enc-val(elg(a%m)(b%m)))",data[0],data[1]))
return -1;
break;
case GCRY_PK_RSA:
/* make a sexp from skey */
if(gcry_sexp_build(&s_skey,NULL,
"(private-key(rsa(n%m)(e%m)(d%m)(p%m)(q%m)(u%m)))",
skey[0], skey[1], skey[2], skey[3], skey[4], skey[5]))
/* put data into a S-Exp s_data */ return -1;
if(gcry_sexp_build(&s_data,NULL,"(enc-val(rsa(a%m)))",data[0]))
//<----here the error occures
return -1;
break;
default:
return -1;
}
rc=gcry_pk_decrypt(&s_plain,s_data,s_skey);
gcry_sexp_release(s_skey);
gcry_sexp_release(s_data);
if(rc)
return rc;
if(! (*result=gcry_sexp_nth_mpi(s_plain,0,0)))
{
gcry_sexp_release(s_plain);
return -1;
}
gcry_mpi_print(GCRYMPI_FMT_USG,to,&tn,*result);
gcry_sexp_release(s_plain);
return 0;
}
From twoaday@freakmail.de Tue Oct 22 18:27:16 2002
From: twoaday@freakmail.de (Timo Schulz)
Date: Tue, 22 Oct 2002 19:27:16 +0200
Subject: Fatal: memory at 0x804a3dc corrupted (underflow=40)
In-Reply-To: <1842S3-12OC2KC@fmrl04.sul.t-online.com>
References: <183zaB-0H3J32C@fmrl01.sul.t-online.com> <20021022143121.GA13916@daredevil.joesixpack.net> <1842S3-12OC2KC@fmrl04.sul.t-online.com>
Message-ID: <20021022172716.GB18427@daredevil.joesixpack.net>
On Tue Oct 22 2002; 21:01, Ruediger Sonderfeld wrote:
> int wcrypt_pkdecrypt(pkalgo algo,const encrypted_data *data,unsigned char*
> to,size_t tn,pkkey key)
[snip]
>
> if(gcry_sexp_build(&s_data,NULL,"(enc-val(rsa(a%m)))",data[0]))
> //<----here the error occures
> return -1;
The SEXP structure expects a MPI (GCRY_MPI=%m) but you use a
const structure (encrypted_data) and this might the problem.
BTW, it's propably the best you use a debugger to take a closer look
at the specific variables and pointers.
Timo
From cplusplushelp@gmx.net Tue Oct 22 22:56:35 2002
From: cplusplushelp@gmx.net (Ruediger Sonderfeld)
Date: Tue, 22 Oct 2002 23:56:35 +0200
Subject: Fatal: memory at 0x804a3dc corrupted (underflow=40)
In-Reply-To: <20021022172716.GB18427@daredevil.joesixpack.net>
References: <183zaB-0H3J32C@fmrl01.sul.t-online.com> <1842S3-12OC2KC@fmrl04.sul.t-online.com> <20021022172716.GB18427@daredevil.joesixpack.net>
Message-ID: <1845B9-0gMuDAC@fmrl04.sul.t-online.com>
On Tuesday, 22. October 2002 19:27, you wrote:
> The SEXP structure expects a MPI (GCRY_MPI=%m) but you use a
> const structure (encrypted_data) and this might the problem.
Oh sorry, this was only a C&P Failure. The problem occures in the
gcry_pk_decrypt function.
> BTW, it's propably the best you use a debugger to take a closer look
> at the specific variables and pointers.
I'm using a Debugger. But I didn't found anything going wrong :(