php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #52930 Engine not responding to code properly
Submitted: 2010-09-27 09:55 UTC Modified: 2010-09-27 11:05 UTC
From: martin at appware dot co dot uk Assigned:
Status: Not a bug Package: Scripting Engine problem
PHP Version: 5.3.3 OS: Windows 7 Business
Private report: No CVE-ID: None
 [2010-09-27 09:55 UTC] martin at appware dot co dot uk
Description:
------------
cipher using php code to allow 2 way encryption currently it uses a predefined 
array of Char's it then loops though this and creates every cipher possible by 
shifting the first char to the end in a new array, and as it ciphers one letter 
the cipher moves forward on cipher it's using

No my problem is that i have had to place a check in to make sure the cipher has 
finished if it has and the decrypted cipher is not the same as the original 
string rerun the cipher with the same string,

Now this should not be needed, also this still creates error's

This has been tested in php 5.3.1 and 5.3.3,

The occurrence the same some times refreshing the system give a cipher that's to 
short for the string and this is with the check

whats more annoying is that there is a check in the code to prevent this 
happening as it was happening more and more 

P.S now i got to re-random my cipher base as its useless one made public haha

Test script:
---------------
http://pastebin.com/r934gLpM


inside encryptString you will see 

if($this->decryptString($encoded) === $string){
	return $encoded;
}else{
	return $this->encryptString($string);
}

at the end it should not be possible for me to get a string thats dose not break back.

Expected result:
----------------
The cipher to not occasionally return a string that is to short 

Actual result:
--------------
Using the code above works but keep refreshing it and you will see you will get 
ciphers back that are 2 small a common one for me is "LX" on its own.

this happens more and more with a bigger string in the 

$secure->encryptString

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2010-09-27 10:18 UTC] martin at appware dot co dot uk
http://pastebin.com/NQByiELh

Updated the test script to fix a E_NOTICE bug,

The PHP Error still occurs though
 [2010-09-27 10:34 UTC] cataphract@php.net
-Status: Open +Status: Bogus
 [2010-09-27 10:34 UTC] cataphract@php.net
Sorry, but your problem does not imply a bug in PHP itself.  For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system is not the
appropriate forum for asking support questions.  Due to the volume
of reports we can not explain in detail here why your report is not
a bug.  The support channels will be able to provide an explanation
for you.

Thank you for your interest in PHP.


 [2010-09-27 11:05 UTC] martin at appware dot co dot uk
if($this->decryptString($encoded) === $string){
	return $encoded;
}else{
	return $this->encryptString($string);
}

Sorry but learn to read

How the hell dose the code above Return a string that dose not work, even though 
the Decryptor works perfectly as i did all the math and worked it out and 
tested.

Add 
die("<pre>".print_r(array($string, $this->decryptString($encoded)))."</pre>");

above the code i pasted at the top of this message and watch it loop yet it will 
say it works then return a code that dose not work something is happening to the 
return cipher.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Mon Jul 07 07:01:33 2025 UTC