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 Igor Ribeiro de Assis  >  Perfect Crypt Class  >  example.php  >  Download  
File: example.php
Role: Example script
Content type: text/plain
Description: An example of use
Class: Perfect Crypt Class
Symetric encryption of data using only PHP code
Author: By
Last change:
Date: 2004-04-30 14:21
Size: 393 bytes
 

Contents

Class file image Download
<?php

require 'class.pcrypt.php';
  
/* 
MODE: MODE_ECB or MODE_CBC
ALGO: BLOWFISH
KEY:  Your secret key :) (max lenght: 56)
*/
$crypt = new pcrypt(MODE_ECB"BLOWFISH""secretkey");
  
// to encrypt
$plaintext  "password";
$ciphertext $crypt->encrypt($plaintext);

// to decrypt
$decrypted  $crypt->decrypt($ciphertext);

echo 
$plaintext."<br />".$ciphertext."<br />".$decrypted;

?>