PHP Classes

File: example3.php

Recommend this page to a friend!
  Classes of agus hariyanto  >  Encrypt MD5 64  >  example3.php  >  Download  
File: example3.php
Role: Example script
Content type: text/plain
Description: example
Class: Encrypt MD5 64
Encrypt and decrypt data using MD5 digest of a key
Author: By
Last change:
Date: 17 years ago
Size: 1,188 bytes
 

Contents

Class file image Download
<?
include("encdec.php");

$enc = new encdec();
$data=$HTTP_POST_VARS['data'];
$dec=$HTTP_POST_VARS['decryption'];
$key=$HTTP_POST_VARS['pwd'];
$e='';
if (
$dec=='fals')
{
   
$e = $enc->encrypt($data,$key);
    echo
'<h2> Result= '.urldecode($e).'</h2><br/><br/>';
}
else
{
   
$d = $enc->decrypt($dec,$key);
    echo
'<h2> Result= '.urldecode($d).'</h2><br/><br/>';
}
?>
<html>
    <head>
        <title>Encryption</title>
    </head>
    <body>

        <h2>Encryption</h2><br/>

        <form method="post" action="example3.php">
        <input type="hidden" name="decryption" value="fals"/>
            <input type="text" name="data" value="www.stekpi.ac.id"/>&nbsp;&nbsp;Data
            <br/>
            <input type="text" name="pwd" value="agus"/>&nbsp;&nbsp;Key
            <br/>
            <input type="submit" value="Encrypt">
        </form>

        <br/><br/>

        <h2>Decryption</h2><br/>

        <form method="post" action="example3.php">
        <input type="hidden" name="data" value="fals"/>
            <input type="text" name="decryption" value="<?=urldecode($e);?>"/>&nbsp;&nbsp;Data
            <br/>
            <input type="text" name="pwd" value="<?=$key;?>"/>&nbsp;&nbsp;Key
            <br/>
            <input type="submit" value="Decrypt">
        </form>
    </body>
</html>

For more information send a message to info at phpclasses dot org.