PHP? ???, Javascript(cryptojs)? ???
?? ??:
?? ?? ???/?? ??, ?? PHP ??? ? Javascript ??? ??? ??? ??? ????. cryptojs? ?????.
??:
PHP ???? mcrypt ?????? ??? ???? base64 ???? ?????. ? ??? Javascript ??? CryptoJS? ???? ???? ???? ??? ????? ????? ??? ?????.
?? ??:
??? ???? ??? ??? ??, ?? mcrypt? ???? ????. ? ?? ??? ???? ????. ???/??? ??? ????? PHP? openssl ?????? ??? AES ???? ??? ? ????.
PHP ???/??? ??:
<?php function encrypt($passphrase, $value) { $salt = openssl_random_pseudo_bytes(8); $salted = ''; $dx = ''; while (strlen($salted) < 48) { $dx = md5($dx . $passphrase . $salt, true); $salted .= $dx; } $key = substr($salted, 0, 32); $iv = substr($salted, 32, 16); $encrypted_data = openssl_encrypt(json_encode($value), 'aes-256-cbc', $key, true, $iv); $data = array("ct" => base64_encode($encrypted_data), "iv" => bin2hex($iv), "s" => bin2hex($salt)); return json_encode($data); } function decrypt($passphrase, $jsonStr) { $j = json_decode($jsonStr, true); $cipherParams = CryptoJS.lib.CipherParams.create({ ciphertext: CryptoJS.enc.Base64.parse(j.ct) }); if (j.iv) $cipherParams.iv = CryptoJS.enc.Hex.parse(j.iv) if (j.s) $cipherParams.salt = CryptoJS.enc.Hex.parse(j.s) $key = substr($result, 0, 32); $data = openssl_decrypt($ct, 'aes-256-cbc', $key, true, $iv); return json_decode($data, true); }
Javascript ?? ?? ??:
function decrypt(passphrase, encryptedData) { var cipherParams = CryptoJSAesJson.parse(encryptedData); var decrypted = CryptoJS.AES.decrypt(cipherParams, passphrase, {format: CryptoJSAesJson}).toString(CryptoJS.enc.Utf8); return decrypted; }
?? ?:
$encrypted = encrypt('my passphrase', 'value to encrypt'); echo $encrypted; // Encrypted data with salt, iv, and cipher text
var decrypted = decrypt('my passphrase', $encrypted); console.log(decrypted); // Original 'value to encrypt'
? ?? ??? PHP? Javascript ?? ???? ?? ?? ??? ???/??? ?????. ?? ??? ??? cryptojs?? ???? ?????.
? ??? PHP?? ???? ???? ????? CryptoJS? ???? ???? ??? ??????? ?? ?????. ??? ??? PHP ??? ????? ?? ?? ??? ?????!

? AI ??

Undress AI Tool
??? ???? ??

Undresser.AI Undress
???? ?? ??? ??? ?? AI ?? ?

AI Clothes Remover
???? ?? ???? ??? AI ?????.

Clothoff.io
AI ? ???

Video Face Swap
??? ??? AI ?? ?? ??? ???? ?? ???? ??? ?? ????!

?? ??

??? ??

???++7.3.1
???? ?? ?? ?? ???

SublimeText3 ??? ??
??? ??, ???? ?? ????.

???? 13.0.1 ???
??? PHP ?? ?? ??

???? CS6
??? ? ?? ??

SublimeText3 Mac ??
? ??? ?? ?? ?????(SublimeText3)

??? ??











TOSECURELYHANDLEAUSTENCENDACTIONANDACTERIZINGINPHP, FORCUCTSESTEPS : 1. ALWAYSHASHPASSWORTHPASSWORD_HASH () ? VERVERIFYUSINGPANSWORD_VERIFY (), usePREPAREDSTATEMENTSTOPREVENTSQLINGERGED, andSTOREUSERSESSEATAIN $ _SESSIONSAFTERLOGIN.2.impleplempletrole ?? ACCESSC

PHP?? ?? ???? ???? ????? ??? ?? ??? ???? ?? ??? ??? ??? ???? ????. 1. finfo_file ()? ???? ?? ?? ??? ???? ???/jpeg? ?? ?? ?? ? ?????. 2. uniqid ()? ???? ??? ?? ??? ???? ? Web ?? ????? ??????. 3. php.ini ? html ??? ?? ?? ??? ???? ???? ??? 0755? ?????. 4. Clamav? ???? ???? ???? ??? ??????. ??? ??? ?? ???? ????? ???? ?? ??? ????? ???? ??? ? ??? ?????.

PHP?? ==? ==? ?? ???? ?? ??? ??????. == ?? ??? ?? ?? ?????. ?? ??, 5 == "5"? true? ????, ?? ??? ???? ?? ?? ??? ????? ????? (? : 5 === "5"? false? ?????. ?? ?????? ===? ? ???? ?? ?????? == ?? ??? ??? ???? ?????.

PHP?? ?? ??? ??? ???? ??? ??? ????. 1. ?? ??? ?? ? ?? ??? ??? ???? ???? ??? ? ????. ??? ??? ???? ????? ????? ???? ????. 2. ?? ?? ?? - ??, ??? ???? ?? ??? ?????. 3. ?? ???? ??? ??? ???? ??? ??? ?????. 4. Division? / ??? ???? 0?? ??? ?? ????? ??? ?? ??? ?? ? ? ????. 5. ???? ??? ???? ?? ?? ? ?? ??? ???? ? ??? ? ???, ??? ?? ? ? ??? ??? ???? ?????. ? ???? ???? ???? ??? ??? ??? ???? ?? ??? ? ??????? ????.

?, PHP? ?? ?? ?? ?????? ?? MongoDB ? Redis? ?? NOSQL ??????? ?? ??? ? ????. ?? MongoDBPHP ???? (PECL ?? Composer? ?? ??)? ???? ????? ????? ??? ?????? ? ???? ????? ??, ??, ?? ? ?? ??? ?????. ??, Predis ????? ?? Phpredis ??? ???? Redis? ???? ?? ? ?? ? ??? ???? ??? ????? Phpredis? ???? ?? Predis? ?? ??? ?????. ? ? ?? ??? ???? ? ????? ????.

tostaycurrentwithphpdevelopments ? bestpractices, followkeynewssources lifephp.netandphpweekly, adgytwithcommunitiesonforumsandconferences, readlingupdated andgrad indewfeatures, andreadorcontributetoopensourceproceprosts.first

phpbecamepupularforwebdevelopmentduetoiteofleneflening, whithhtml, wididepreadhostingsupport, andalargeecosystemincludingframeworkslikelaravelandcmsplatformsformslikewordpress.itexcelsinhandlingformsubmissions, managingussess, interptisussivers, ?? ???

TOSETTHERIGHTTIMEZONEINPHP, usedate_default_timezone_set () functionattStartOfyourscriptwitHavalidInlifiersuchas'America/new_york'.1.edate_default_timezone_set () beforeanydate/timeFunctions.2
