PHP Classes

File: example.php

Recommend this page to a friend!
  Classes of Rafael M. Salvioni   RC4 Cipher   example.php   Download  
File: example.php
Role: Example script
Content type: text/plain
Description: Class example
Class: RC4 Cipher
Encrypt and decrypt data with RC4 algorithm
Author: By
Last change:
Date: 16 years ago
Size: 303 bytes
 

Contents

Class file image Download
<?php

include('RC4.php');

$string = "I am a secret text";
$key = "crypt_key";

$crypt = RC4::encrypt($key, $string);
$dcrypt = RC4::decrypt($key, $crypt);

echo
"
String:
$string
Key:
$key

Encripted Data:
$crypt;

Success: "
. ($string == $dcrypt ? 'true' : 'false') . "
"
;

?>