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 Romeu Gamelas  >  SRCrypt  >  example.php  >  Download  
File: example.php
Role: Example script
Content type: text/plain
Description: Example file
Class: SRCrypt
Encrypt and decrypt data using a secret key
Author: By
Last change:
Date: 2009-04-14 06:22
Size: 457 bytes
 

Contents

Class file image Download
<?php
  
require("srcrypt.class.php");
  include(
"sampleKey.php");
  
$cr = new SRCrypt($key);
  
$cr->encrypt(file_get_contents("testfile.txt"));
?>
<h2>Once encrypted your file will look like this:</h2>

<textarea cols="100" rows="5"><?php echo $cr->result;?></textarea>
<?php
  $cr
->decrypt($cr->result);
  if(
$cr->error) die($cr->error);
?>
<h2>Decrypt back to get this</h2>
<textarea cols="100" rows="50"><?php echo $cr->result;?></textarea>