--FILE--
<?php
$td = mcrypt_module_open(MCRYPT_DES, '', MCRYPT_MODE_ECB, '');
-echo mcrypt_generic($td,'aaaaaaaa');
+echo mcrypt_generic($td,b'aaaaaaaa');
print "I'm alive!\n";
?>
--EXPECTF--
<?php if (!extension_loaded("mcrypt") || unicode_semantics()) print "skip"; ?>
--FILE--
<?php
-$key = "FooBar";
-$secret = "PHP Testfest 2008";
+$key = b"FooBar";
+$secret = b"PHP Testfest 2008";
$cipher = MCRYPT_RIJNDAEL_128;
$iv = mcrypt_create_iv(mcrypt_get_iv_size($cipher, MCRYPT_MODE_ECB), MCRYPT_RAND);
<?php if (!extension_loaded("mcrypt") || unicode_semantics()) print "skip"; ?>
--FILE--
<?php
-$key = "FooBar";
-$secret = "PHP Testfest 2008";
+$key = b"FooBar";
+$secret = b"PHP Testfest 2008";
$cipher = MCRYPT_RIJNDAEL_128;
$iv = mcrypt_create_iv(mcrypt_get_iv_size($cipher, MCRYPT_MODE_ECB), MCRYPT_RAND);
<?php if (!extension_loaded("mcrypt") || unicode_semantics()) print "skip"; ?>
--FILE--
<?php
-$key = "FooBar";
-$secret = "PHP Testfest 2008";
+$key = b"FooBar";
+$secret = b"PHP Testfest 2008";
$mode = MCRYPT_MODE_CBC;
$cipher = MCRYPT_RIJNDAEL_128;
// a warning must be issued if we don't use a IV on a AES cipher, that usually requires an IV
mcrypt_decrypt($cipher, $key, $enc_data, MCRYPT_MODE_CBC);
-var_dump(strpos(mcrypt_decrypt(MCRYPT_BLOWFISH, "FooBar", $enc_data, MCRYPT_MODE_CBC, $iv), "Testfest") !== false);
+var_dump(strpos(mcrypt_decrypt(MCRYPT_BLOWFISH, b"FooBar", $enc_data, MCRYPT_MODE_CBC, $iv), b"Testfest") !== false);
--EXPECTF--
PHP Testfest 2008
<?php if (!extension_loaded("mcrypt") || unicode_semantics()) print "skip"; ?>
--FILE--
<?php
-$key = "FooBar";
-$secret = "PHP Testfest 2008";
+$key = b"FooBar";
+$secret = b"PHP Testfest 2008";
$cipher = MCRYPT_RIJNDAEL_128;
$iv = mcrypt_create_iv(mcrypt_get_iv_size($cipher, MCRYPT_MODE_ECB), MCRYPT_RAND);
--EXPECT--
array(8) {
[0]=>
- string(3) "cbc"
+ unicode(3) "cbc"
[1]=>
- string(3) "cfb"
+ unicode(3) "cfb"
[2]=>
- string(3) "ctr"
+ unicode(3) "ctr"
[3]=>
- string(3) "ecb"
+ unicode(3) "ecb"
[4]=>
- string(4) "ncfb"
+ unicode(4) "ncfb"
[5]=>
- string(4) "nofb"
+ unicode(4) "nofb"
[6]=>
- string(3) "ofb"
+ unicode(3) "ofb"
[7]=>
- string(6) "stream"
+ unicode(6) "stream"
}
<?php if (!extension_loaded("mcrypt") || unicode_semantics()) print "skip"; ?>
--FILE--
<?php
-$key = "FooBar";
-$secret = "PHP Testfest 2008";
+$key = b"FooBar";
+$secret = b"PHP Testfest 2008";
$cipher = MCRYPT_RIJNDAEL_128;
$iv = mcrypt_create_iv(mcrypt_get_iv_size($cipher, MCRYPT_MODE_ECB), MCRYPT_RAND);