bug70625.phpt 480 B

1234567891011121314151617
  1. --TEST--
  2. Bug #70625: mcrypt_encrypt() : won't return data when no IV was specified under RC4
  3. --SKIPIF--
  4. <?php if (!extension_loaded("mcrypt")) print "skip"; ?>
  5. --FILE--
  6. <?php
  7. $key = 'secretkey';
  8. $ciphertext = mcrypt_encrypt(MCRYPT_ARCFOUR, $key, 'payload', MCRYPT_MODE_STREAM);
  9. var_dump(bin2hex($ciphertext));
  10. $plaintext = mcrypt_decrypt(MCRYPT_ARCFOUR, $key, $ciphertext, MCRYPT_MODE_STREAM);
  11. var_dump($plaintext);
  12. ?>
  13. --EXPECT--
  14. string(14) "d5c9a57023d0f1"
  15. string(7) "payload"