Security Code Generator

liunx

Guest
I would like to use a security code feature similar to the signup page (<!-- m --><a class="postlink" href="http://www.totalchoicehosting.com/forums/index.php?act=Reg&CODE=00">http://www.totalchoicehosting.com/forum ... eg&CODE=00</a><!-- m -->). Any clues or pointers?<!--content-->
I am hoping to mimic the link with CGI and perl. What I have found is either the GD or Image::Magick interfaces. Both installed on TCH!<br /><br />Initial logic has me generating a random number sequence, annotating an image with it, putting the image in the web page via cgi, encoding the random number and using it as a variable to the form, and comparing the encoded number with what the user enters. Easy enough!<!--content-->
Since the page you pointed to is part of the Invision Board script, you could download a free copy for yourself and borrow the part with the security code. That would be a fast solution.<br /><br />If you are going to build one from scratch that puts up one of those 'ransom note' looking random codes then you'll probably need an image file for each character (letter or number) that will be part of the random security code you generate.<br /><br />Generating the random code is easy. Then you could display the images with server side language (PHP or CGI) and compare the user input with the actual string that the server created.<br /><br />Not hard, but a lot of work to get those images together.<!--content-->
Solved the problem using cgi Image::Magick. Actually quite easy once I understood how to create a basic image. Only problem I have now is how to delete the temporary image files if users leave the page without using my 'get' or 'cancel' buttons (see <!-- w --><a class="postlink" href="http://www.jsnmp.com/cgi-bin/download.pl">www.jsnmp.com/cgi-bin/download.pl</a><!-- w --> ... the generated image is the security code at the bottom of the page). I am looking into the JavaScript possibilites at the moment. May have to resort to periodically running a cron job.<!--content-->
What about using a session cookie? Don't ask me how it would work, but I know that is how alot of providers use the images - person navigates away or closes the browser and poof! image is gone.....<!--content-->
dupe post - disregard<!--content-->
 
Back
Top