Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > encrypting and decrypting with perl

Reply
Thread Tools

encrypting and decrypting with perl

 
 
Marshall Dudley
Guest
Posts: n/a
 
      01-27-2005
I have an application where I need to encrypt a bit of text, and then I
need to be able to decrypt it using a customer's key. I want to make
sure that the key to decrypt is NOT on the server anywhere, so hackers
cannot get the decrypt key, which means I cannot use a symetrical key
pair since the encryption key will need to be on the server.

What I need is more like a public key cypher. But I want the customer
to be able to create his own private unencrypt key (like a password),
and then the server generates the public encrypt key from that. I do
not want the customer to have to enter a 128 or 1028 byte sequence each
time he executes the program, but to be able to enter a password he can
remember or have written down.

This is what I want.

1. When customer signs up, he enters a password. The password is NOT
stored on the system, but is used to generate a nonsymetrical encryption
key, which is stored on the server.
2. Sensitive information is encrypted using the encryption key.
3. When the customer wants to see the sensitive information, he has to
log in, using the password he supplied in #1, and this is the decryption
key for the information. This password is never stored on the server,
but only passed from session to session with an ssl connection.

Are there any libraries that allow a nonsymetrical key pair, where the
encryption key can be generated from the decryption key that the
customer supplies?

Thanks,

Marshall

 
Reply With Quote
 
 
 
 
Brian McCauley
Guest
Posts: n/a
 
      01-27-2005


Marshall Dudley wrote:

> I have an application where I need to encrypt a bit of text, and then I
> need to be able to decrypt it using a customer's key. I want to make
> sure that the key to decrypt is NOT on the server anywhere, so hackers
> cannot get the decrypt key, which means I cannot use a symetrical key
> pair since the encryption key will need to be on the server.


So the obvious choice would be PGP. There's a module on CPAN with
"Crypt" and "PGP" in the name that may help.

> What I need is more like a public key cypher. But I want the customer
> to be able to create his own private unencrypt key (like a password),
> and then the server generates the public encrypt key from that. I do
> not want the customer to have to enter a 128 or 1028 byte sequence each
> time he executes the program, but to be able to enter a password he can
> remember or have written down.


Sounds very like the way PGP operates to me.

> This is what I want.
>
> 1. When customer signs up, he enters a password. The password is NOT
> stored on the system, but is used to generate a nonsymetrical encryption
> key, which is stored on the server.
> 2. Sensitive information is encrypted using the encryption key.
> 3. When the customer wants to see the sensitive information, he has to
> log in, using the password he supplied in #1, and this is the decryption
> key for the information. This password is never stored on the server,
> but only passed from session to session with an ssl connection.


There should be no problem doing that with PGP. Of course the password
may get stored in your swap-file.

> Are there any libraries that allow a nonsymetrical key pair, where the
> encryption key can be generated from the decryption key that the
> customer supplies?


Forget libraries, I'm not aware of any PK _algorithm_ that would allow
that. All the PK algorithms I know create a key _pair_ in a single
operation and it is just about as hard to go from the private key to the
public as the other way.

However there is no need in anything you've said you want to achieve to
generate the encryption from the decryption key. Simply store the
encryption key (which is public after all) in step 1.

This, of course, has nothing to do with Perl.

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Encrypting/Decrypting XML Documents with Asymmetric Keys dfa_geko ASP .Net 3 04-06-2007 01:31 PM
Encrypting/Decrypting Password from a Config File michael.santamaria@gmail.com Java 35 11-09-2005 06:58 PM
encrypting and decrypting with perl Marshall Dudley Perl 1 01-27-2005 06:14 PM
Encrypting/Decrypting Connection String VB Programmer ASP .Net 3 11-30-2004 06:08 AM
Is there any asymmetric crypto API to allow decrypting a message but not encrypting it? Andy Chau ASP .Net Security 7 10-05-2003 01:17 AM



Advertisments