php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #8040 MCRYPT_MODE_ does not seem to exist
Submitted: 2000-11-29 19:40 UTC Modified: 2000-12-15 10:53 UTC
From: barton at applitec dot com Assigned: derick (profile)
Status: Closed Package: mcrypt related
PHP Version: 4.0.2 OS: linux RedHat 7.0
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: barton at applitec dot com
New email:
PHP Version: OS:

 

 [2000-11-29 19:40 UTC] barton at applitec dot com
I have mcrypt libmcrypt 2.4.7. 
Following simple script:

define("CIPHER", MCRYPT_TWOFISH);
define("MODE1", MCRYPT_MODE_CBC);
define("MODE2", MCRYPT_CBC);

print("cipher=". CIPHER . " mode1=" . MODE1 . "mode2=" . MODE2 . "<br>\n");

What prints is "cipher=twofish mode1=MCRYPT_MODE_CBC MODE2=MCRYPT_CBC"

The mcrypt.h file has #define MCRYPT_CBC "cbc"
so I don't understand?

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2000-11-30 06:34 UTC] derick@php.net
The following is defined in the code (PHP wrapper):

#if HAVE_LIBMCRYPT24
    MCRYPT_ENTRY2_2_4(ARCFOUR_IV, "arcfour-iv");
    MCRYPT_ENTRY2_2_4(ARCFOUR, "arcfour");
    MCRYPT_ENTRY2_2_4(BLOWFISH, "blowfish");
...
    MCRYPT_ENTRY2_2_4(MODE_CBC, "cbc");
    MCRYPT_ENTRY2_2_4(MODE_CFB, "cfb");
    MCRYPT_ENTRY2_2_4(MODE_ECB, "ecb");
    MCRYPT_ENTRY2_2_4(MODE_NOFB, "nofb");
    MCRYPT_ENTRY2_2_4(MODE_OFB, "ofb");
    MCRYPT_ENTRY2_2_4(MODE_STREAM, "stream");
    REGISTER_INI_ENTRIES();
#endif

So if MCRYPT_BLOWFISH works, then MCRYPT_MODE_CBC should work too.
I'm going to check this out later.
 [2000-12-15 10:53 UTC] derick@php.net
The following code snippet:

<?php
    echo MCRYPT_TWOFISH."<BR>\n";
    echo MCRYPT_MODE_CBC."<BR>\n";
?>

<?php
    define ("MODE1", MCRYPT_MODE_CBC);
    echo MODE1."<BR>\n";
?>

<?php
    define ("CIPHER", MCRYPT_TWOFISH);
    define ("MODE1", MCRYPT_MODE_CBC);
    define ("MODE2", MCRYPT_CBC);

    printf ("cipher=".CIPHER. " mode1=".MODE1. " mode2=". MODE2."<BR>\n");
?>

procudes this:

   twofish
   cbc
   cbc
   cipher=twofish mode1=cbc mode2=MCRYPT_CBC

Which is expected. From source code analyses it is not even possible that MCRYPT_TWOFISH is defined, but MCRYPT_MODE_CBC is not.

So closing
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Mar 29 09:01:28 2024 UTC