RC4/ARCFOUR Implementation in PHP
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. My motivation for writing it was to replace the dependency on MCrypt in my SpamKit plugin for Wordpress - see Gerry's site for the updated TBT code I will wrap in the next SpamKit Plugin release. This is software is completely public domain, all I ask for is a simple credit for my work if you find it useful. View Source: rc4.php View Source: rc4tests.php Examples: 1. Simple encryption & decryption php < ?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 < ?php require_once( "rc4tests.php" ); // Auto includes rc4.php echo rc4_tests(); ?>
3. Execute the tests as benchmarks and display the results ```php
< ?php require_once( "rc4tests.php" ); // Auto includes rc4.php echo rc4_benchmark(); ?>
Related Posts
Blogs are fundamentally flawed for the typical Grandma-User
It may seem a little sad but I can honestly say that reading my accesslog is far more interesting than any soap opera on TV; they are filled with e...
Horde 3.0.8 appears to be broken
Horde is an application framework used by a web-based email client IMP I use to read my email.
'NASA Search 1.0' ??? Something Google should worry about ???
Having written my own Wordpress logging / statistics plug-in over the weekend – which still in prototype, consider it a ‘coming soon’ - I have star...