473,395 Members | 1,756 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,395 software developers and data experts.

Using Perl and encryption to validate a form entry

I have a web site that I need to build for a contest.

A person goes to the web site, and enters a two-digit number six times - as in a safe combination. Example - 25-98-46-73-88-02

They would then hit submit, and the Perl script would check their guess against the real combination. If it matches, then they are a winner (they will win a car).

I can create a script to check the submission, but I don't know how to encrypt the winning combination so that someone can't hack into the web site and/or Perl code to figure out the combination.

Any suggestions would be appreciated.

Thanks,

Tony
Aug 23 '07 #1
3 1424
miller
1,089 Expert 1GB
As long as the verification is being done server side in the perl script, then there is no need to encrypt the special code.

If you want to encrypt people's entries, then you'll need to use SSL.

I would suggest that you create some method of sessions though. There needs to be some implementation that limits someone from just creating a script that would go through all the possible combinations, probably overloading your server with submits. Sessions could be tied to both a verified email address and an ip address for example.

- Miller
Aug 23 '07 #2
KevinADC
4,059 Expert 2GB
You should store the winning combo in a database, not in your perl script or a plain text file.

You should probably check the laws regarding lotteries/give-aways like this, they are generally well regulated when the prize is worth more than a few dollars. The law may stipulate something about how the winning "code" in a contest of chance must be stored for future validation and proof that the contest was not rigged or someone cheated.
Aug 24 '07 #3
Thanks for the tips.

I am doing this for a client who is a licensed insurance/promotions company. I actually won't be the one giving the car away - it will be General Motors...

Thanks.
Aug 25 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

8
by: Derek Fountain | last post by:
I'm coming to Tkinter from Tcl/Tk. In Tcl I can get a variable in an event using the %<X> substitution mechanism. For example, I can set up a command like: entry .e -validate 1 -vcmd "checkkey...
4
by: Peloux | last post by:
Hi, I have written some htc in order to validate data in a form. most of htc are attached on 'onblur' event. Now, we would like to use the Enter Key to sublit form, so we use the following...
11
by: wolf | last post by:
There are three webcontrol on my asp.net form: a TextBox, a submit button and a RegularExpressionValidator. And I had set ControlToValidate property of the RegularExpressionValidator to the...
7
by: Rich | last post by:
Hello, I have 10 textboxes on a form. I would like to validate text-data entry on each textbox. I was looking for a Form_Current event or Form_Change event but did not recognize any such...
1
by: newhaven_lad | last post by:
Please could someone help, I have a Perl cgi script which works perfectly when run in a dos prompt, it connects to a database on my laptop and inserts a record. But when I use the internet browser...
11
by: TokyoJ | last post by:
I run a small camp in Alaska for kids and my director is asking for a web form. Could someone please have a look and offer some advice on where I'm making mistake(s)? I'm using the RegExp function...
4
by: syed.akhlaq | last post by:
Hi, Does anyone know how can I validate XPath expressions using xsd schema? Thanks
21
KevinADC
by: KevinADC | last post by:
Note: You may skip to the end of the article if all you want is the perl code. Introduction Uploading files from a local computer to a remote web server has many useful purposes, the most...
3
by: happyse27 | last post by:
Hi All, I am creating the perl script using html form(with embedded javascript inside). When using this html form with javascript alone, it works where the form validation will pop up...
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
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
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...

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.