From:             james at jpsgraphics dot co dot uk
Operating system: ubuntu
PHP version:      5.2.6
PHP Bug Type:     *Encryption and hash functions
Bug description:  aes_decrypt will not work in my php page

Description:
------------
in my php pages i am using aes_encrypt which works fine. The issue i am
having is with aes_decrypt. I have been searching for days to try and
resolve this problem but need more help. The following string in my php
will not bring any results back at all. I know it does work because running
it in mysql direct works.

simple sql string:
SELECT AES_DECRYPT(password, 'keyhere') FROM accounts where id = '11';


Reproduce code:
---------------
$sql = "SELECT userId, name, email, aes_decrypt(password,'keyhere'),
country FROM accounts where id='". $_SESSION['member_ID'] ."'";

$result = mysql_query($sql);

if (!$result) {
    echo "Could not successfully run query ($sql) from DB: " .
mysql_error();
    exit;
}

if (mysql_num_rows($result) == 0) {
    echo "No rows found, nothing to print so am exiting";
    exit;
}
        while ($row = mysql_fetch_array($result))

{
     echo $row["userId"];
     echo $row["name"];
     echo $row["email"];
         echo $row["password"];
         echo $row["country"];
}

mysql_free_result($result);
mysql_close($conn);

Expected result:
----------------
123456 john [EMAIL PROTECTED] 'password should be here' UK

Actual result:
--------------
[EMAIL PROTECTED]

-- 
Edit bug report at http://bugs.php.net/?id=45504&edit=1
-- 
Try a CVS snapshot (PHP 5.2): 
http://bugs.php.net/fix.php?id=45504&r=trysnapshot52
Try a CVS snapshot (PHP 5.3): 
http://bugs.php.net/fix.php?id=45504&r=trysnapshot53
Try a CVS snapshot (PHP 6.0): 
http://bugs.php.net/fix.php?id=45504&r=trysnapshot60
Fixed in CVS:                 http://bugs.php.net/fix.php?id=45504&r=fixedcvs
Fixed in release:             
http://bugs.php.net/fix.php?id=45504&r=alreadyfixed
Need backtrace:               http://bugs.php.net/fix.php?id=45504&r=needtrace
Need Reproduce Script:        http://bugs.php.net/fix.php?id=45504&r=needscript
Try newer version:            http://bugs.php.net/fix.php?id=45504&r=oldversion
Not developer issue:          http://bugs.php.net/fix.php?id=45504&r=support
Expected behavior:            http://bugs.php.net/fix.php?id=45504&r=notwrong
Not enough info:              
http://bugs.php.net/fix.php?id=45504&r=notenoughinfo
Submitted twice:              
http://bugs.php.net/fix.php?id=45504&r=submittedtwice
register_globals:             http://bugs.php.net/fix.php?id=45504&r=globals
PHP 4 support discontinued:   http://bugs.php.net/fix.php?id=45504&r=php4
Daylight Savings:             http://bugs.php.net/fix.php?id=45504&r=dst
IIS Stability:                http://bugs.php.net/fix.php?id=45504&r=isapi
Install GNU Sed:              http://bugs.php.net/fix.php?id=45504&r=gnused
Floating point limitations:   http://bugs.php.net/fix.php?id=45504&r=float
No Zend Extensions:           http://bugs.php.net/fix.php?id=45504&r=nozend
MySQL Configuration Error:    http://bugs.php.net/fix.php?id=45504&r=mysqlcfg

Reply via email to