-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathREADME
33 lines (25 loc) · 903 Bytes
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
I wrote this RC4/ARCFOUR implementation in PHP - based on the original C source
code posted on usenet in 1994. The rc4() call itself is completely
self-contained, two other methods rc4_test() and rc4_benchmark() have been
provided for testing and are optional.
Examples:
1. Simple encryption & decryption
<?php
require_once( "rc4.php" );
$key = "0123456789abcdef";
$plaintext = "Hello World!";
$ciphertext = rc4( $key, $plaintext );
$decrypted = rc4( $key, $ciphertext );
echo $decrypted . " - " . $plaintext . "\n";
?>
2. Execute the tests and display the results
<?php
require_once( "rc4tests.php" ); // Auto includes rc4.php
echo rc4_tests();
?>
3. Execute the tests as benchmarks and display the results
<?php
require_once( "rc4tests.php" ); // Auto includes rc4.php
echo rc4_benchmark();
?>
http://cotdp.com/blog/2006/03/rc4-arcfour-implementation-in-php.html