PHP Classes

File: example.php

Recommend this page to a friend!
  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: 19 years ago
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;

?>