PHP Classes

File: example.php

Recommend this page to a friend!
  Classes of Gabriel Almeida   Encryption Class BCA   example.php   Download  
File: example.php
Role: Example script
Content type: text/plain
Description: Example class to use Encryption
Class: Encryption Class BCA
Encrypt and decrypt data using Rijndael 256 cipher
Author: By
Last change: -
Date: 10 years ago
Size: 667 bytes
 

Contents

Class file image Download
<?php


# - Include Class Encryption
   
require_once('Encryption.php');


# - Key to encrypt and decrypt
   
$secureKey = 'SECRET_KEY';
# - Separator encrypted string; Allowed: !@#%&*=+/~:?
   
$separator = '/';


# - Starting class and by setting parameters
   
$encrypt = new Encryption( $secureKey, $separator);

# - Example of text to encrypt and decrypt
   
$encodeTXT = 'Hello World';


# - Encrypt
   
$crypt = $encrypt->encode( $encodeTXT );
# - Decrypt
   
$decrypt = $encrypt->decode( $crypt );


# - Print text Encrypt
   
print('Encrypted: ' . $crypt);


    print(
'<br />');


# - Print text Decrypt
   
print('Decrypted: ' . $decrypt);

?>