|
|
|
Hi,
This example shows you how to add dynamic image security system in signup pages like yahoo, hotmail etc. It will make your webpages more secured.
See the attached zip file and run login.php
dynamicimage.php
| <?php
$data = base64_decode($HTTP_GET_VARS['dt']);
$im = imagecreate(65,20);
$white = imagecolorallocate($im,255,255,255);
$gray = imagecolorallocate($im, 210,210,210);
$black = imagecolorallocate($im, 0,0,0);
imagestring($im,4,8,2,$data,$black);
imageline($im,0,10,65,10,$gray);
imagepng($im);
?> | |
login.php
| <! DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Dynamic Image Creation</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
This script shows how to implement a strong authentication scheme using dynamically generated image. This small snippet is extremely helpful for creating your signup script.
<form name="form1" method="post" action="">
<table width="42%" border="0" align="center" cellpadding="1" cellspacing="0" bgcolor="#990000">
<tr>
<td><table width="100%" border="0" align="center" cellpadding="2" cellspacing="2" bgcolor="#FFFFFF">
<tr>
<td width="64%">Type the following Image Data : <br>
<input name="data" type="text" id="data3"></td>
</tr>
<?
global $data;
$data = mt_rand(100000,1000000);
?>
<tr>
<td>Image : <br>
<img src=dynamicImage.php?dt=<? global $data; echo base64_encode($data);?> border="1">
<input type=hidden name='md5' value =<? echo md5($data);?>></td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td><input type="submit" name="Submit" value="Submit"></td>
</tr>
<tr>
<td>Result : <b>
<?
if (count($HTTP_POST_VARS)>0)
{
if (md5($HTTP_POST_VARS['data']) == $HTTP_POST_VARS['md5'])
{
echo "Its Alright";
}
else
{
echo "Wrong";
}
}
?>
<br>
</b></td>
</tr>
</table></td>
</tr>
</table>
</form>
</body>
</html> | | |
|
| A damaged image generator (class) for validating text.
CAPTCHA - Completely Automated Public Turing test to tell Computers and Humans Apart Categories : PHP, PHP Classes, Security, GD image library, Security | | | Creates a CAPTCHA image in PHP, which displays 5 numbers stored in a session. Categories : PHP, GD image library, Form Processing, Security | | | A captcha image allows you to prevent spam posting when users reload the page and stop bots from submitting forms automatically. This version allows you to use your own fonts (.ttf) to show the text.
Categories : PHP, Security, Graphics, GD image library | | | CAPTCHA[Image verification] Categories : PHP, Security, GD image library, Graphics, Sessions | | | Generate image with random number (CAPTCHA) Categories : PHP, GD image library, Graphics, Security | | | Securing Web Forms with Simple PHP-CAPTCHA (Completely Automated Public Turing test to tell Computers and Humans Apart)
Categories : PHP, Security, GD image library, Sessions | | | A PHP function to encrypt and decrypt a number or string or a combination of the two. Categories : PHP, Encryption, Security | | | Create Thumbnails - resize an image - jpeg, jpg, gif, png to the specifed width and height in proportion without loosing out on pixcel quality. Categories : PHP, GD image library, Graphics | | | crop and resize image class using gd library function Categories : PHP, PHP Classes, GD image library, Graphics | | | Dollar Serial Number Validator Categories : PHP, Security, Algorithms | | | PHP Email image generator - hide your email from bots - using the GD Library Categories : PHP, Graphics, GD image library, Beginner Guides | | | MD5 secured login Categories : PHP, Java Script, Authentication, Security | | | Simple Password example Categories : PHP, Authentication, Security, HTTP | | | PHP Function to Encrypt/Decrypt a string without a known key. The string itself has his own different key for every character. Categories : PHP, Algorithms, Security, Authentication, Encryption | | | Encoding data using PGP via PHP's proc_* functions Categories : Cryptography, Security, Email, PHP, PGP | |
|
|
|