Mcrypt
在线手册:中文  英文

预定义常量

下列常量由此扩展定义,且仅在此扩展编译入 PHP 或在运行时动态载入时可用。

Mcrypt can operate in four block cipher modes (CBC, OFB, CFB, and ECB). If linked against libmcrypt-2.4.x or higher the functions can also operate in the block cipher mode nOFB and in STREAM mode. Below you find a list with all supported encryption modes together with the constants that are defines for the encryption mode. For a more complete reference and discussion see Applied Cryptography by Schneier (ISBN 0-471-11709-9).

Some other mode and random device constants:

MCRYPT_ENCRYPT (integer)
MCRYPT_DECRYPT (integer)
MCRYPT_DEV_RANDOM (integer)
MCRYPT_DEV_URANDOM (integer)
MCRYPT_RAND (integer)


Mcrypt
在线手册:中文  英文

用户评论:

gordon at vixo dot com (2013-02-02 20:17:29)

These constants don't cover all the possible options.
There are two constants:
MCRYPT_MODE_OFB
MCRYPT_MODE_NOFB
These relate to using OFB mode in 8-bit feedback mode and using the same feedback length as the key
There is one constant
MCRYPT_MODE_CFB which uses 8-bit feedback mode
There ought to be a constant
MCRYPT_MODE_NCFB which uses the same feedback length as the key.
In fact you can just use the option 'ncfb' in mycrypt

易百教程