Edit report at http://bugs.php.net/bug.php?id=52930&edit=1
ID: 52930 User updated by: martin at appware dot co dot uk Reported by: martin at appware dot co dot uk Summary: Engine not responding to code properly Status: Bogus Type: Bug Package: Scripting Engine problem Operating System: Windows 7 Business PHP Version: 5.3.3 Block user comment: N New Comment: 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. Previous Comments: ------------------------------------------------------------------------ [2010-09-27 10:34:48] cataphr...@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 10:18:08] 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 09:55:08] 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 ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/bug.php?id=52930&edit=1