Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
Fellow monks,

I've Googled and Super Searched this to no avail.

I've got a super small shopping cart I'm doing for work ( 5 items ) and I've got it almost all done but I've come up with a problem I can't solve, and I'm not sure I'm attacking it the right way.

I've set up the web page as a self referencing CGI script using https not plain http, which is all well and good, but when I get to the part to have people enter a credit card number for payment, I'm stuck on exactly when to do the encryption. I'm using Crypt::OpenPGP to do my encryption, but I'd like to do it when the submit button is clicked. I know things like this can be done in JavaScript with an -onSubmit but I'm curious how to do this in Perl - or if it's even possible. Trying to use Crypt::OpenPGP fails at present as there is no data in the form to encrypt, thus my question.

My other thought is: Am I barking up the wrong tree? Do I even need to worry about encrypting a cc number in a https post until it's a parameter on the new page? I can obviously easily encrypt the parameter once it's passed, but my concern is obviously security.

Thanks in advance!

Update: Sorry for being unclear. I wasn't trying to do my encryption in JavaScript, but rather emulate the -onScript function in the submit using Perl code rathe than JavaScript.

Useless trivia: In the 2004 Las Vegas phone book there are approximately 28 pages of ads for massage, but almost 200 for lawyers.

In reply to Execute Perl code on CGI submit for credit card encryption by Popcorn Dave

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others admiring the Monastery: (9)
As of 2024-04-23 18:29 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found