Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> mcrypt, pytanko o szyfrowanie
-arnt-
post
Post #1





Goście







witam, mam pytanko jak się wykorzystuje funkcje mcrypt lub crypt i czy to jakaś różnica. będe też wdzięczny za prosty przykład. Tylko nie odsyłajcie mnie do manuala. Z góry dziękuje.
Go to the top of the page
+Quote Post
hwao
post
Post #2


Developer


Grupa: Moderatorzy
Postów: 2 844
Pomógł: 20
Dołączył: 25.11.2003
Skąd: Olkusz




Małą lekcja manuala (IMG:http://forum.php.pl/style_emoticons/default/smile.gif)
crypt -- One-way string encryption (hashing)
Czyli:
crypt -- W 1 strone koduje ciag znakow (haszuje)
Tlumacz:
crypt -- koduje tak haslo ze nie da sie do rozkodowac (hashuje)
crypt - przykład
  1. <?php
  2. $password = crypt(&#092;"My1sTpassword\"); // let salt be generated
  3.  
  4. # You should pass the entire results of crypt() as the salt for comparing a
  5. # password, to avoid problems when different hashing algorithms are used. (As
  6. # it says above, standard DES-based password hashing uses a 2-character salt,
  7. # but MD5-based hashing uses 12.)
  8. if (crypt($user_input, $password) == $password) {
  9.  echo &#092;"Password verified!\";
  10. }
  11. ?>


See also md5() [...]
Zobacz takrze md5() ...
crypt jest podbne do md5 hasuja dany ciag znakó tak ze nie da sie go rozkodowac
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 - 05:21