PHP Classes

File: example.php

Recommend this page to a friend!
  Classes of Johan De Klerk  >  EnDe  >  example.php  >  Download  
File: example.php
Role: Example script
Content type: text/plain
Description: example
Class: EnDe
Encrypt and decrypt text with the mcrypt extension
Author: By
Last change: added close
Date: 18 years ago
Size: 637 bytes
 

Contents

Class file image Download
<?php
require_once('class_ende.php');

$ende = new EnDe('secret key');

$username = 'myusername';
$password = 'mypassword';

echo
'username: '.$username;
echo
'<br>';
echo
'password: '.$password;
echo
'<br>';
echo
'<br>';

$e_username = $ende->encrypt($username);
$e_password = $ende->encrypt($password);

echo
'encrypted username: '.$e_username;
echo
'<br>';
echo
'encrypted password: '.$e_password;
echo
'<br>';
echo
'<br>';

echo
'decrypted username: '.$ende->decrypt($e_username);
echo
'<br>';
echo
'decrypted password: '.$ende->decrypt($e_password);
echo
'<br>';

//free resources
$ende->close();
?>

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