PHP Classes

File: example.php

Recommend this page to a friend!
  Classes of Al Rankin  >  EncDec  >  example.php  >  Download  
File: example.php
Role: Example script
Content type: text/plain
Description: example file
Class: EncDec
Encryption and decryption of strings of data
Author: By
Last change: changed hash line
Date: 18 years ago
Size: 534 bytes
 

Contents

Class file image Download
<?
/* include the class */
include "encdec.class.php";

/* this is our sample password */
$word_in = "password";

/* create a new instance of EncDec */
$test = &New EncDec;

/* a hash to do our XOR against */
//$test->hash = "aTestHash"; // change to whatever
$test->hash = "veryLongAndWindingHash";


$test_out = $test->phpEncrypt($word_in);
$test_out2 = $test->phpDecrypt($test->phpEncrypt($word_in));

echo
"Encryption of $word_in: $test_out";
echo
"<br><br>";
echo
"Decryption of $test_out: $test_out2";

?>

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