CakeFest 2024: The Official CakePHP Conference

Mcrypt şifreleri

Burada mcrypt eklentisi tarafından desteklenen şifrelere yer verilmiştir. Desteklenen şifrelerin tam listesini mcrypt.h başlık dosyasının sonunda bulabilirsiniz. mcrypt-2.2.x arayüzünün genel kuralı, PHP ile bir şifreye MCRYPT_şifreadı ile erişilebilmesidir. Ayrıca bu sabitler, libmcrypt-2.4.x ve libmcrypt-2.5.x ile de çalışmakta olup bir şifreye mcrypt_module_open() işlevinde ismini bir dizge olarak belirterek erişmek de mümkünür.

  • MCRYPT_3DES
  • MCRYPT_ARCFOUR_IV (sadece libmcrypt > 2.4.x)
  • MCRYPT_ARCFOUR (sadece libmcrypt > 2.4.x)
  • MCRYPT_BLOWFISH
  • MCRYPT_CAST_128
  • MCRYPT_CAST_256
  • MCRYPT_CRYPT
  • MCRYPT_DES
  • MCRYPT_DES_COMPAT (sadece libmcrypt 2.2.xonly)
  • MCRYPT_ENIGMA (sadece libmcrypt > 2.4.x , MCRYPT_CRYPT için takma ad)
  • MCRYPT_GOST
  • MCRYPT_IDEA (özgür değil)
  • MCRYPT_LOKI97 (sadece libmcrypt > 2.4.x)
  • MCRYPT_MARS (sadece libmcrypt > 2.4.x, özgür değil)
  • MCRYPT_PANAMA (sadece libmcrypt > 2.4.x)
  • MCRYPT_RIJNDAEL_128 (sadece libmcrypt > 2.4.x)
  • MCRYPT_RIJNDAEL_192 (sadece libmcrypt > 2.4.x)
  • MCRYPT_RIJNDAEL_256 (sadece libmcrypt > 2.4.x)
  • MCRYPT_RC2
  • MCRYPT_RC4 (sadece libmcrypt 2.2.x)
  • MCRYPT_RC6 (sadece libmcrypt > 2.4.x)
  • MCRYPT_RC6_128 (sadece libmcrypt 2.2.x)
  • MCRYPT_RC6_192 (sadece libmcrypt 2.2.x)
  • MCRYPT_RC6_256 (sadece libmcrypt 2.2.x)
  • MCRYPT_SAFER64
  • MCRYPT_SAFER128
  • MCRYPT_SAFERPLUS (sadece libmcrypt > 2.4.x)
  • MCRYPT_SERPENT(sadece libmcrypt > 2.4.x)
  • MCRYPT_SERPENT_128 (sadece libmcrypt 2.2.x)
  • MCRYPT_SERPENT_192 (sadece libmcrypt 2.2.x)
  • MCRYPT_SERPENT_256 (sadece libmcrypt 2.2.x)
  • MCRYPT_SKIPJACK (sadece libmcrypt > 2.4.x)
  • MCRYPT_TEAN (sadece libmcrypt 2.2.x)
  • MCRYPT_THREEWAY
  • MCRYPT_TRIPLEDES (sadece libmcrypt > 2.4.x)
  • MCRYPT_TWOFISH (eski mcrypt 2.x veya mcrypt > 2.4.x sürümleri için)
  • MCRYPT_TWOFISH128 (TWOFISHxxx şifreleri 2.4.x sürümlerinde değil, yeni 2.x sürümlerinde kullanılabilmektedir)
  • MCRYPT_TWOFISH192
  • MCRYPT_TWOFISH256
  • MCRYPT_WAKE (sadece libmcrypt > 2.4.x)
  • MCRYPT_XTEA (sadece libmcrypt > 2.4.x)

İlgili şifre işlevinde, CBC kipi için bir ilklendirme vektörü (İV) sağlamanız isteğe bağlı iken CFB ve OFB kiplerinde bir ilklendirme vektörü sağlamak zorundasınız. İV eşsiz olmalı ve şifreleme/çözme için aynı İV kullanılmalıdır. Şifreli saklanacak bir veriyi, verinin altında saklandığı indisle ilgili bir işlevinin çıktısı olarak alabilirsiniz (dosyanın MD5 anahtarı gibi). Bundan başka, İV'yi şifreli veri ile birlikte de aktarabilirsiniz. (Bu konuda daha ayrıntılı bilgi için Applied Cryptography by Schneier (ISBN 0-471-11709-9) kitabının 9.3. faslına bakınız.)

add a note

User Contributed Notes 5 notes

up
6
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
2
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