PHP Classes

File: decrypt.php

Recommend this page to a friend!
  Classes of Grigori Kochanov   gksEncrypt   decrypt.php   Download  
File: decrypt.php
Role: Example script
Content type: text/plain
Description: decription sample
Class: gksEncrypt
Encrypt and decrypt data asymmetrically
Author: By
Last change:
Date: 16 years ago
Size: 528 bytes
 

Contents

Class file image Download
<?php

if ($_SERVER['REQUEST_METHOD'] != 'POST'){
   
header('Location: demo3.php');
    exit;
}

include(
'gksException.class.php');
include(
'encrypt.class.php');

$private_key = $_POST['private_key'];
$enctrypted_data = base64_decode($_POST['encrypted_data']);

try {
   
$data = gksEncrypt::decrypt($enctrypted_data,$private_key);
}catch (
gksException $E){
    echo
$E->getLogMessage();
    exit;
}

?>
<title>Data decryption</title>

The original data is:
<div style="border: 1px solid black;"><?php var_dump($data);?></div>