Cifradores mcrypt

Aqui hay una lista de los cifradores que actualmente son soportados por la extensión mcrypt. Para una lista completa de los cifradores soportados, vea los defines al final de mcrypt.h. La regla general con la API de mcrypt-2.2.x es que se puede acceder al cifrador desde PHP con MCRYPT_ciphername. Con la API de libmcrypt-2.4.x y libmcrypt-2.5.x estas constantes también trabajan, pero es posible especificar el nombre del cifrador como una string al invocar a mcrypt_module_open().

  • MCRYPT_3DES
  • MCRYPT_ARCFOUR_IV (solo libmcrypt > 2.4.x)
  • MCRYPT_ARCFOUR (solo libmcrypt > 2.4.x)
  • MCRYPT_BLOWFISH
  • MCRYPT_CAST_128
  • MCRYPT_CAST_256
  • MCRYPT_CRYPT
  • MCRYPT_DES
  • MCRYPT_DES_COMPAT (solo libmcrypt 2.2.x)
  • MCRYPT_ENIGMA (solo libmcrypt > 2.4.x, alias de MCRYPT_CRYPT)
  • MCRYPT_GOST
  • MCRYPT_IDEA (no libre)
  • MCRYPT_LOKI97 (solo libmcrypt > 2.4.x)
  • MCRYPT_MARS (solo libmcrypt > 2.4.x, no libre)
  • MCRYPT_PANAMA (libmcrypt > 2.4.x only)
  • MCRYPT_RIJNDAEL_128 (solo libmcrypt > 2.4.x)
  • MCRYPT_RIJNDAEL_192 (solo libmcrypt > 2.4.x)
  • MCRYPT_RIJNDAEL_256 (solo libmcrypt > 2.4.x)
  • MCRYPT_RC2
  • MCRYPT_RC4 (solo libmcrypt 2.2.x)
  • MCRYPT_RC6 (solo libmcrypt > 2.4.x)
  • MCRYPT_RC6_128 (solo libmcrypt 2.2.x)
  • MCRYPT_RC6_192 (solo libmcrypt 2.2.x)
  • MCRYPT_RC6_256 (solo libmcrypt 2.2.x)
  • MCRYPT_SAFER64
  • MCRYPT_SAFER128
  • MCRYPT_SAFERPLUS (solo libmcrypt > 2.4.x)
  • MCRYPT_SERPENT (solo libmcrypt > 2.4.x)
  • MCRYPT_SERPENT_128 (solo libmcrypt 2.2.x)
  • MCRYPT_SERPENT_192 (solo libmcrypt 2.2.x)
  • MCRYPT_SERPENT_256 (solo libmcrypt 2.2.x)
  • MCRYPT_SKIPJACK (solo libmcrypt > 2.4.x)
  • MCRYPT_TEAN (solo libmcrypt 2.2.x)
  • MCRYPT_THREEWAY
  • MCRYPT_TRIPLEDES (solo libmcrypt > 2.4.x)
  • MCRYPT_TWOFISH (para versiones de mcrypt inferiores a la 2.x, o mcrypt > 2.4.x )
  • MCRYPT_TWOFISH128 (TWOFISHxxx están disponibles en las más recientes versiones 2.x, pero no en las versiones 2.4.x)
  • MCRYPT_TWOFISH192
  • MCRYPT_TWOFISH256
  • MCRYPT_WAKE (solo libmcrypt > 2.4.x)
  • MCRYPT_XTEA (solo libmcrypt > 2.4.x)

Se debe (en modo CFB y OFB) o se puede (en modo CBC) suministrar un vector de inicialización (IV) a la función de cifrado correspondiente. El IV debe ser único y debe ser el mismo cuando cifra/descifra. Con información que es almacenada encriptada, se puede tomar la salida de una función del índice con el que la información es almacenada (por ej., la clave MD5 de un nombre de archivo). Alternativamente, se puede transmitir el IV junto con los datos encriptados (ver el capítulo 9.3 de Applied Cryptography by Schneier (ISBN 0-471-11709-9) para una discusión sobre este tema).

add a note add a note

User Contributed Notes 5 notes

up
5
robin
13 years ago
The MCRYPT_TWOFISH constant when defined by mcrypt version 2.4.x and later is the 256 bit version of Twofish; it uses a 1-32 byte key, a 16 byte IV, and outputs 16 byte blocks in CBC mode.
up
4
Rob
10 years ago
These constants can in fact be used as input to the function mcrypt_module_open() because mcrypt.php contains defines that map these constants to the appropriate string values obtained from mcrypt_list_algorithms().
up
0
Mark
11 years ago
Note, these are not the names you use in the function mcrypt_module_open to specify the algorithm.

Use mcrypt_list_algorithms to get the right names to stick in there
up
-3
stanislav dot eckert at vizson dot de
8 years ago
The latest patents for the IDEA algorithm have expired in 2012 and the cipher is now patent-free and free to use.
up
-5
dan at zaph dot com
8 years ago
Interpretability:

mcrypt does not support PKCS#7 padding, it uses non-standard and insecure null padding. This means that for interoperability with most other implementations PKCS#7 padding will have to be added prior to encryption and/or removed after decryption. This is a major source of interoperability issues.

When interoperating with AES the mcrypt algorithm must be specified as MCRYPT_RIJNDAEL_128 since AES only supports a block size of 128-bits. There is often confusion that this specifies the key size which it does not.
To Top