Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Message from discussion CryptoPP: RSA Signature Scheme causes a Segmentation Fault
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Michele  
View profile  
 More options Jul 15 2012, 8:37 am
From: Michele <michelegucciard...@gmail.com>
Date: Sun, 15 Jul 2012 05:37:34 -0700 (PDT)
Local: Sun, Jul 15 2012 8:37 am
Subject: Re: CryptoPP: RSA Signature Scheme causes a Segmentation Fault

Done!! Now item 4) of my first post works fine.

Here is a part of my Signature.cpp :

static CryptoPP::AutoSeededRandomPool rng;               //this fixed rng
troblues as David Irvine suggested

void Signature::SignHash()                   //method declared in my
Signature.h file
{
[...]
static RSA::PrivateKey RSAprivate;                                
RSAprivate.GenerateRandomWithKeySize(rng,1536);

static RSA::PublicKey RSApublic;                                     //keys
created inside the method as Fraser suggested

          //and not declared inside the class as Ingo Naumann suggested
[...]

}

I'm not sure that the key pair is generated only once ( as I want). I'm
going to verify that key pair is not re-generated every time i call the
method , because I have to sign every file with the same RSAprivate.

Thanks Everybody!!
Now I'm going to work on item 5) of my first post: perform the integrity
check of files (created/hashed/signed). I think that, because of I declared
my key pair as local static variables, I must implement a method
Signature::IntegrityCheck() inside my Signature.cpp, because outside of it
the keys will not be visible.......

Il giorno sabato 14 luglio 2012 21:44:24 UTC+2, Michele ha scritto:

> Ok David, now i'm deleting RNG from class members. I'm not sure that I've
> understand your example but i will try...

> Il giorno sabato 14 luglio 2012 19:08:07 UTC+2, David Irvine ha scritto:

>> It seems you may not be using the RNG correctly. It's generally preferred
>> to have on per thread at least (or a global if you like).  i.e. in test.cpp
>> you will see how this was done. In your case I am not sure you should have
>> a  class member RNG used as you have. This can cause all sorts of issues
>> with threading and protection of the os provided generator etc.

>> static OFB_Mode<AES>::Encryption s_globalRNG;

>> RandomNumberGenerator & GlobalRNG()
>>  {
>>          return s_globalRNG;
>>  }

>> See the docs here http://www.cryptopp.com/wiki/RandomNumberGenerator

>> Best Regards
>> David Irvine

>> On Sat, Jul 14, 2012 at 5:53 PM, Michele <michelegucciard...@gmail.com>wrote:

>>> RSA::PrivateKey RSAprivate;
>>> string DigitalSIgn;


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.