Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [php]MCRYPT - błąd
Earth
post
Post #1





Grupa: Zarejestrowani
Postów: 169
Pomógł: 2
Dołączył: 6.12.2006

Ostrzeżenie: (0%)
-----


  1. <?php
  2. $key = base64_decode("NCiUmfiRByg=");
  3.  
  4. $locale['xxx130'] = mcrypt_cbc(MCRYPT_DES, $key, $locale['xxx130'], MCRYPT_ENCRYPT); 
  5. $_POST['nick'] = mcrypt_cbc(MCRYPT_DES, $key, $_POST[nick], MCRYPT_ENCRYPT);
  6. $locale['xxx113'] = mcrypt_cbc(MCRYPT_DES, $key, $locale['xxx113'], MCRYPT_ENCRYPT);
  7. $_POST['password'] = mcrypt_cbc(MCRYPT_DES, $key, $_POST['password'], MCRYPT_ENCRYPT);
  8.  
  9. setcookie('base64_encode($locale[xxx130])', 'base64_encode($_POST[nick])', $date_cookies, "/infusion/$name_folder", '$protocol_ssl_on');
  10.  
  11. setcookie('base64_encode(password)', 'base64_encode(password($_POST[password]))', $date_cookies, "/infusion/$name_folder", '$protocol_ssl_on');
  12. ?>




Błąd jaki się pokazuje:
  1. <?php
  2. Warning: mcrypt_cbc() [function.mcrypt-cbc]: Attempt to use an empty IV, which is NOT recommend in /home/n/f/s/nfs-pl/www/infusions/nfs_racer_u2/user_panel/login.php on line 34
  3.  
  4. Warning: mcrypt_cbc() [function.mcrypt-cbc]: Attempt to use an empty IV, which is NOT recommend in /home/n/f/s/nfs-pl/www/infusions/nfs_racer_u2/user_panel/login.php on line 35
  5.  
  6. Warning: mcrypt_cbc() [function.mcrypt-cbc]: Attempt to use an empty IV, which is NOT recommend in /home/n/f/s/nfs-pl/www/infusions/nfs_racer_u2/user_panel/login.php on line 36
  7.  
  8. Warning: mcrypt_cbc() [function.mcrypt-cbc]: Attempt to use an empty IV, which is NOT recommend in /home/n/f/s/nfs-pl/www/infusions/nfs_racer_u2/user_panel/login.php on line 37
  9. ?>


Proszę o pomoc.

Ten post edytował Earth 27.12.2006, 19:23:41
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi (1 - 4)
nospor
post
Post #2





Grupa: Moderatorzy
Postów: 36 557
Pomógł: 6315
Dołączył: 27.12.2004




masz napisane, ze wywolujesz funkcje mcrypt_cbc() z pustym argumentem IV, co nie jest zalecane.

patrzysz do manuala i widzisz, ze faktycznie ta funkcja ma jeszcze taki parametr:
Cytat
string mcrypt_cbc ( int cipher, string key, string data, int mode [, string iv] )


proszę poprawić tytuł o znacznik zgodnie z zasadami forum Przedszkole:
Temat: Tematyka i zasady panujace na forum Przedszkole
Go to the top of the page
+Quote Post
Earth
post
Post #3





Grupa: Zarejestrowani
Postów: 169
Pomógł: 2
Dołączył: 6.12.2006

Ostrzeżenie: (0%)
-----


Niestety nie wiem co to jest argument IV. U mnie w książce to wszystko jest podane bez tego argumentu.

A do manuala nie mogę wejść. Chyba za bardzo serwer jest obciążony.

Chyba że chodzi o wektor początkowy, który jest używany w CFB i OFB.
Go to the top of the page
+Quote Post
nospor
post
Post #4





Grupa: Moderatorzy
Postów: 36 557
Pomógł: 6315
Dołączył: 27.12.2004




Cytat
A do manuala nie mogę wejść. Chyba za bardzo serwer jest obciążony.
Dziwne, ja moge (IMG:http://forum.php.pl/style_emoticons/default/smile.gif)
http://pl.php.net/manual/pl/function.mcrypt-cbc.php
Cytat
mcrypt_cbc

(php 3 >= 3.0.8, php 4, php 5)
mcrypt_cbc -- Encrypt/decrypt data in CBC mode
Description
string mcrypt_cbc ( int cipher, string key, string data, int mode [, string iv] )

string mcrypt_cbc ( string cipher, string key, string data, int mode [, string iv] )


The first prototype is when linked against libmcrypt 2.2.x, the second when linked against libmcrypt 2.4.x or higher. The mode should be either MCRYPT_ENCRYPT or MCRYPT_DECRYPT.

This function should not be used anymore, see mcrypt_generic() and mdecrypt_generic() for replacements.
Go to the top of the page
+Quote Post
Earth
post
Post #5





Grupa: Zarejestrowani
Postów: 169
Pomógł: 2
Dołączył: 6.12.2006

Ostrzeżenie: (0%)
-----


Dzięki udało się. Manual też mi już działa.
Go to the top of the page
+Quote Post

Reply to this topicStart new topic
2 Użytkowników czyta ten temat (2 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 23.08.2025 - 06:52