Cov txheej txheem:

Mcrypt hauv PHP yog dab tsi?
Mcrypt hauv PHP yog dab tsi?

Video: Mcrypt hauv PHP yog dab tsi?

Video: Mcrypt hauv PHP yog dab tsi?
Video: Qhia website php ( variable scope) part21 2024, Kaum ib hlis
Anonim

Dab tsi yog mcrypt ? Cov mcrypt txuas ntxiv yog hloov pauv rau UNIX crypt cov lus txib. Cov lus txib no ua ib txoj hauv kev los encrypt cov ntaub ntawv ntawm UNIX thiab Linux systems. Cov php ib - mcrypt extension ua hauj lwm raws li ib tug interface ntawm PHP thiab mcrypt.

Hais txog qhov no, kuv yuav ua li cas qhib PHP Mcrypt?

Qhov no yog tej zaum txoj kev ceev tshaj plaws los pab php-mcrypt ntawm windows server - txhua yam koj yuav tsum ua yog:

  1. Nrhiav php. ini (cov ntaub ntawv tseem ceeb php configuration)
  2. Qhib thiab tshawb rau; txuas ntxiv = php_mcrypt. dll)
  3. Uncomment / tshem tawm ";" thiab txuag lub php. ib ini.

Tsis tas li ntawd, kuv yuav paub li cas yog tias PHP Mcrypt raug teeb tsa? Koj tuaj yeem siv function_exists rau kuaj yog tias ib cov mcrypt muaj nuj nqi. Koj tuaj yeem ua tiav qhov kev tshuaj ntsuam tib yam los ntawm kev saib a php ib cov ntaub ntawv uas muaj: phpinfo(); qhov twg hauv qhov chaws. Hauv qhov screen no, tsuas yog nrhiav txoj hlua " mcrypt txhawb". Yog ntsia , koj yuav pom ib lub thawv uas hais tias "enabled".

Ntxiv mus, kuv tuaj yeem siv dab tsi los hloov Mcrypt?

Koj yuav tsum siv OpenSSL dhau lawm mcrypt raws li nws tau nquag tsim thiab khaws cia. Nws muab kev ruaj ntseg zoo dua, kev ruaj ntseg thiab txav tau yooj yim. Qhov thib ob nws ua AES encryption / decryption sai dua. Nws siv PKCS7 padding los ntawm lub neej ntawd, tab sis koj tuaj yeem qhia OPENSSL_ZERO_PADDING yog tias koj xav tau.

Mcrypt extension yog dab tsi?

Cov mcrypt extension yog ib tug interface rau lub mcrypt cryptography tsev qiv ntawv. Qhov no txuas ntxiv yog pab tau rau kev tso cai PHP code siv mcrypt khiav ntawm PHP 7.2+. Cov mcrypt extension suav nrog PHP 5.4 txog PHP 7.1. Rau PHP 7.2+, PHP hloov pauv siv libsodium ua lub tsev qiv ntawv cryptography.

Pom zoo: