php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #11101 Php has caused an error in PHP4TS.DLL
Submitted: 2001-05-24 19:00 UTC Modified: 2001-07-22 13:00 UTC
From: admin at webfroggie dot com Assigned:
Status: Closed Package: Reproducible crash
PHP Version: 4.0.5 OS: Windows ME
Private report: No CVE-ID: None
 [2001-05-24 19:00 UTC] admin at webfroggie dot com
Hi,

I have the following machine:

- Windows ME
- Xitami server(just installed)
- PHP 4.05 (just installed)

When running this script:
-------------------------
<?php

// Class Made By Mukul Sabharwal [mukulsabharwal@yahoo.com]
// http://www.devhome.net/php/
// On October 21, 2000
// Updated February 24, 2001
// Now passes RC4 Vector Harness

class rc4crypt {

	function endecrypt ($pwd, $data, $case) {

		if ($case == 'de') {

			$data = urldecode($data);

		}

		$key[] = "";
		$box[] = "";
		$temp_swap = "";
		$pwd_length = 0;

		$pwd_length = strlen($pwd);

		for ($i = 0; $i <= 255; $i++) {

			$key[$i] = ord(substr($pwd, ($i % $pwd_length), 1));
			$box[$i] = $i;

		}

		$x = 0;

		for ($i = 0; $i <= 255; $i++) {

			$x = ($x + $box[$i] + $key[$i]) % 256;
			$temp_swap = $box[$i];

			$box[$i] = $box[$x];
			$box[$x] = $temp_swap;

		}

		$temp = "";
		$k = "";

		$cipherby = "";
		$cipher = "";

		$a = 0;
		$j = 0;

		for ($i = 0; $i < strlen($data); $i++) {

			$a = ($a + 1) % 256;
			$j = ($j + $box[$a]) % 256;

			$temp = $box[$a];
			$box[$a] = $box[$j];

			$box[$j] = $temp;

			$k = $box[(($box[$a] + $box[$j]) % 256)];
			$cipherby = ord(substr($data, $i, 1)) ^ $k;

			$cipher .= chr($cipherby);

		}

		if ($case == 'de') {

			$cipher = urldecode(urlencode($cipher));

		} else {

			$cipher = urlencode($cipher);

		}

		return $cipher;

	}


}


$rc4 = new rc4crypt; 

echo "<BR><BR>";
$msg="mmmmmmmmmmmmmmmmmmmmmmm3mmmmmmmmmmmm";
$d = $rc4->endecrypt("hi div", $msg, "");
echo $d;

?>

--------------------------
I get the following error:
--------------------------

"Php has caused an error in PHP4TSDLL.
Php will now close.

If you continue to experience problems,
try restarting your computer."

--------------------------
...and I did restart... but the message wont go away! I uploaded the script to a unix server running apache with PHP v. 4.01pl and it works fine...

Also, if we change the variable $msg to, for example, "abc" it works...

Any ideas?!

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-06-14 22:34 UTC] sniper@php.net
Does this happen with other scripts?
Have you tried reinstalling? I had troubles with
having two different versions of php4ts.dll in my system..

--Jani

 [2001-07-22 13:00 UTC] andy@php.net
no feedback after 35+ days.
 [2003-01-16 02:00 UTC] denver dot prophit at cox dot net
I have vers 4.3.0 of the thread safe php dll file php4ts.dll I also have the modules mycrypt installed could that have an affect?
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed Apr 24 18:01:28 2024 UTC