Login   Register  
PHP Classes
elePHPant
Icontem

File: example.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  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: 2004-05-24 07:28
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();
?>