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 Er. Rochak Chauhan  >  PHP Encrypt Files  >  example.php  >  Download  
File: example.php
Role: Example script
Content type: text/plain
Description: example
Class: PHP Encrypt Files
Encrypt and decrypt data with a given key and salt
Author: By
Last change:
Date: 11 months ago
Size: 630 bytes
 

Contents

Class file image Download
<?php
define
("PUBLIC_KEY","YOUR_PUBLIC_KEY");    //Secret Key
define("PRIVATE_KEY","ABCD1234");        //Eight bit

require_once("PhpEncryptFiles.inc.php");
$phpEncryptFiles=New PhpEncryptFiles(PUBLIC_KEYPRIVATE_KEY);

//Example 1
$text=" Hello world ! ";

$str$phpEncryptFiles->encrypt($text);
$dec$phpEncryptFiles->decrypt($str);

echo 
"<hr> Original: ".$text;
echo 
"<hr> Encoded: ".$str;
echo 
"<hr> Decoded: ".$dec;


/*
//Example #2

$text=file_get_contents("RochakChauhan.jpg");
$str= $phpEncryptFiles->encrypt($text);

$mimeType="image/jpeg";
$phpEncryptFiles->decryptAndRender($str,$mimeType);
*/
?>