473,396 Members | 1,996 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

encrypting and decrypting with perl

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

Jul 19 '05 #1
1 8974


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.

Jul 19 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Piotr | last post by:
MS has published on its sites javascript encoder, which enables "encrypting" javascript code. It allows hiding js code from being seen as a text file. There is a decoder for it, available in the...
1
by: jimfortune | last post by:
This idea is still in the process of formulation. I'm considering the idea of storing encrypted data in memo fields. Since the data is for internal use only I don't think the legal limits on...
0
by: cmrchs | last post by:
Hi, Using the RSA-crypto algorithm in .NET , when actually encrypting/decrypting, all the code samples I ran into always used something like, to encrypt : // create keypair and store in...
4
by: Andy G | last post by:
If users forget there passwords I want to send a link to them through email so they can click on a link and go to a change password page. eBay does this by sending you a url that looks something...
0
by: cmrchs | last post by:
Hi, Using the RSA-crypto algorithm in .NET , when actually encrypting/decrypting, all the code samples I ran into always used something like, to encrypt : ' create keypair and store in...
3
by: neil | last post by:
Hi, I'm not sure whether this is a known or documented issue (I could'nt turn anything up, but maybe I'm not looking hard enough), but I seem to be have a problem encrypting and decrypting...
2
by: Amar | last post by:
Hi All, I want to insert my password into the mysql database by encrypting it so that I can also retrieve the password. Before I was using sha1() for encrypting password,but it is an one way...
3
by: dfa_geko | last post by:
Hi All, I had a question about encrypting and decrypting XML files using asymmetric keys. I copied some sample code from MSDN, here are the samples: ...
2
by: SeeSharp Bint | last post by:
Visual Studio 2005, dotnet, c#. Microsoft SQL Server. Windows XP forms application. Temporarily, for my database application, I have been storing the various elements of database connection...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.