How to store keys generated from Crypt::RSA module??

How to store keys generated from Crypt::RSA module??

am 03.01.2008 16:36:13 von arnab

Hi All,

I'm using Crypt::RSA module for generating public & private keys. Now the
problem is that when I'm storing the keys in the database, and again
bringing them to do the signature or verification the Crypt::RSA module is
unable to understand the key format. I'm storing the keys in the Varchar
field of the MySQL.

Could any body tell me when storing the keys in the databases what would be
the type of the field or how to work with the keys??

Thanks in advance.

Arnab
--
View this message in context: http://www.nabble.com/How-to-store-keys-generated-from-Crypt %3A%3ARSA-module---tp14599117p14599117.html
Sent from the mod_perl - General mailing list archive at Nabble.com.

Re: How to store keys generated from Crypt::RSA module??

am 06.01.2008 18:37:46 von Kurt Hansen

arnab wrote:
> Hi All,
>
> I'm using Crypt::RSA module for generating public & private keys. Now the
> problem is that when I'm storing the keys in the database, and again
> bringing them to do the signature or verification the Crypt::RSA module is
> unable to understand the key format. I'm storing the keys in the Varchar
> field of the MySQL.
>
> Could any body tell me when storing the keys in the databases what would be
> the type of the field or how to work with the keys??
Try the "blob" type. I think varchar is too short to store the private key in a format Crypt:RSA expects. We store the keys in files, but store the encrypted data in "blob" records.

Take care,

Kurt
khansen@charityweb.net

Re: How to store keys generated from Crypt::RSA module??

am 22.01.2008 19:26:48 von jonathan vanasco

On Jan 6, 2008, at 12:37 PM, Kurt Hansen wrote:

>> I'm using Crypt::RSA module for generating public & private keys.
>> Now the
>> problem is that when I'm storing the keys in the database, and again
>> bringing them to do the signature or verification the Crypt::RSA
>> module is
>> unable to understand the key format. I'm storing the keys in the
>> Varchar
>> field of the MySQL.
>> Could any body tell me when storing the keys in the databases what
>> would be
>> the type of the field or how to work with the keys??
> Try the "blob" type. I think varchar is too short to store the
> private key in a format Crypt:RSA expects. We store the keys in
> files, but store the encrypted data in "blob" records.

i save as TEXT in postgres

you need to make sure that you're reading/writing them correctly.
some modules use base16, base32, base64 ; its a PITA realizing that
your issues are entirely with base representation.