PEAR is archived and read-only

This mirror preserves historical PEAR package releases and metadata so existing references remain available.

Home » Encryption » Crypt_RC4 » Bug #4177

RC4 doesn't work - outputs some junk

Details

Submitted2005-04-18 17:38 UTC
Fromvaish at u dot washington dot edu
Assignedkguest
StatusClosed
PackageCrypt_RC4
PHP Version4.3.10
OSUNIX
Roadmaps(Not assigned)

Comments

[2005-04-18 17:38 UTC] vaish at u dot washington dot edu

Description:
------------
Hello,

I download RC4-1.0.2 and wrote a program very similar to the example - see code sample below

Why is this not working?

Thanks,
Vaish.

Reproduce code:
---------------
<?php

require_once '/home/vaish/Crypt_RC4-1.0.2/Rc4.php';

$key = "password";
$message = "this is a really really long sentence that we made up for testimng purposes to see iof this really really works!@@#$%^&*(";

$rc4->key($key);
echo "orig message : $message <br> \n";
$rc4->crypt($message);
echo "encrypted message is: $message <br> \n";
$rc4->decrypt($message);
echo "decrypted message is: $message <br> \n";

?>

Expected result:
----------------
It outputs some junk

orig message : this is a really really long sentence that we made up for testimn
g purposesxüGeÅi&;£(ô´î$äÕ really really works!@@#$%^&*( <br>
e¹¦×Öbj/×Ùz <br> is: }lWÇqÙS'Ãýsè#ç_!#U÷Ký9Âf´ÞÓØZ
decrypted message is: this is a really really long sentence that we made up for testimng purposes to see iof this really really works!@@#$%^&*( <br>

vaish@enkidu:~/Crypt_RC4-1.0.2$ VT102

The encrypted message is very messed up - I don't even know which is the encrypted message , also the original message is messed up while printing.

After this output I am not able to use the command line - eveything I type comes out as some junk. Please help - I replaced the
$rc4->key($key); line with
$rc4 = new Crypt_RC4($key);

but this also doesn't help.

Actual result:
--------------
The actual result should the orignal message, encrypted message and then the decrypted message (Which is the same as the original message)