Mcrypt Chiffren

Hier ist eine Liste der Chiffren, die aktuell von der mcrypt-Erweiterung unterstützt werden. Für eine komplette Liste der unterstützten Chiffren siehe die Definitionen am Ende der Datei mcrypt.h. Im allgemeinen gilt für die mcrypt-2.2.x API, dass auf die Chiffre mit MCRYPT_[chiffrename] zugegriffen werden kann. Diese Konstanten funktionieren ebenfalls mit der libmcrypt-2.4.x und libmcrypt-2.5.x API, jedoch ist es möglich, den Namen der Chiffre als String mit einem Aufruf der Funktion mcrypt_module_open() anzugeben.

  • MCRYPT_3DES
  • MCRYPT_ARCFOUR_IV (nur libmcrypt > 2.4.x)
  • MCRYPT_ARCFOUR (nur libmcrypt > 2.4.x)
  • MCRYPT_BLOWFISH
  • MCRYPT_CAST_128
  • MCRYPT_CAST_256
  • MCRYPT_CRYPT
  • MCRYPT_DES
  • MCRYPT_DES_COMPAT (nur libmcrypt 2.2.x)
  • MCRYPT_ENIGMA (nur libmcrypt > 2.4.x, Aliase für MCRYPT_CRYPT)
  • MCRYPT_GOST
  • MCRYPT_IDEA (nicht frei)
  • MCRYPT_LOKI97 (nur libmcrypt > 2.4.x)
  • MCRYPT_MARS (nur libmcrypt > 2.4.x, nicht frei)
  • MCRYPT_PANAMA (nur libmcrypt > 2.4.x)
  • MCRYPT_RIJNDAEL_128 (nur libmcrypt > 2.4.x)
  • MCRYPT_RIJNDAEL_192 (nur libmcrypt > 2.4.x)
  • MCRYPT_RIJNDAEL_256 (nur libmcrypt > 2.4.x)
  • MCRYPT_RC2
  • MCRYPT_RC4 (nur libmcrypt 2.2.x)
  • MCRYPT_RC6 (nur libmcrypt > 2.4.x)
  • MCRYPT_RC6_128 (nur libmcrypt 2.2.x)
  • MCRYPT_RC6_192 (nur libmcrypt 2.2.x)
  • MCRYPT_RC6_256 (nur libmcrypt 2.2.x)
  • MCRYPT_SAFER64
  • MCRYPT_SAFER128
  • MCRYPT_SAFERPLUS (nur libmcrypt > 2.4.x)
  • MCRYPT_SERPENT(nur libmcrypt > 2.4.x)
  • MCRYPT_SERPENT_128 (nur libmcrypt 2.2.x)
  • MCRYPT_SERPENT_192 (nur libmcrypt 2.2.x)
  • MCRYPT_SERPENT_256 (nur libmcrypt 2.2.x)
  • MCRYPT_SKIPJACK (nur libmcrypt > 2.4.x)
  • MCRYPT_TEAN (nur libmcrypt 2.2.x)
  • MCRYPT_THREEWAY
  • MCRYPT_TRIPLEDES (nur libmcrypt > 2.4.x)
  • MCRYPT_TWOFISH (für ältere mcrypt 2.x Versionen, oder mcrypt > 2.4.x )
  • MCRYPT_TWOFISH128 (TWOFISHxxx sind verfügbar in neueren 2.x Versionen, aber nicht in den 2.4.x Versionen)
  • MCRYPT_TWOFISH192
  • MCRYPT_TWOFISH256
  • MCRYPT_WAKE (nur libmcrypt > 2.4.x)
  • MCRYPT_XTEA (nur libmcrypt > 2.4.x)

Sie müssen (im CFB und OFB Modus) oder können (im CBC Modus) die jeweiligen Chiffrierfunktionen mit einem Initialierungs-Vektor versorgen (initialization vector, IV). Der IV muss einmalig und sowohl für die Verschlüsselung als auch für die Entschlüsselung gleich sein. Bei Daten, die verschlüsselt gespeichert werden, können Sie die Ausgabe einer Funktion des Indexes verwenden, unter welcher die Daten gespeichert werden (z. B. der MD5-Hash des Dateinamens). Alternativ können die den IV zusammen mit den verschlüsselten Daten übermitteln (siehe Kapitel 9.3 aus Applied Cryptography by Schneier (ISBN 0-471-11709-9) für eine Diskussion zu diesem Thema).

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