{"id":673,"date":"2024-04-15T11:05:47","date_gmt":"2024-04-15T02:05:47","guid":{"rendered":"http:\/\/inwelly.com\/?p=673"},"modified":"2024-04-23T04:33:53","modified_gmt":"2024-04-22T19:33:53","slug":"php-%ec%95%94%ed%98%b8%ed%99%94-%ed%95%98%ea%b8%b0-bcrypt","status":"publish","type":"post","link":"https:\/\/inwelly.com\/?p=673","title":{"rendered":"PHP \uc554\ud638\ud654 \ud558\uae30 &#8211; BCRYPT"},"content":{"rendered":"\n<pre class=\"wp-block-code\"><code>\ud574\ub2f9 \uc554\ud638 \uc0ac\uc6a9\uc740 (1) PHP \ubc84\uc83c 5.5.XX \uc5d0\uc11c\ub294 \uc544\ub798\uc758 \ud568\uc218\ub97c \uadf8\ub300\ub85c \uc0ac\uc6a9 \ud558\uc154\ub3c4 \ub429\ub2c8\ub2e4. \ub2e8 PHP 5.3.10 \ucbe4\uc758 \ubc84\uc83c\uc5d0\uc11c\ub294\n\uad00\ub828 \ud568\uc218\ub97c \uc704\ud574 \ud30c\uc77c\uc744 include \ud574\uc11c \uc0ac\uc6a9 \ud558\uc154\uc57c \ud569\ub2c8\ub2e4.\n\n(1)  php 5.5.xx \uc774\uc0c1\uc5d0\uc11c \uadf8\ub300\ub85c \uc0ac\uc6a9\n(1-1) \uc554\ud638\ud654 \ud558\uae30\n\n$\uc785\ub825\ubc1b\uc740\ubcc0\uc218= '1111';\n\n$hash = password_hash($\uc785\ub825\ubc1b\uc740\ubcc0\uc218, PASSWORD_DEFAULT);\n\n\uc554\ud638\ud654 \ub41c \uac12 $hash \uc744  DB \uc5d0 \uc800\uc7a5 ( \ub2e8 \uc800\uc7a5\uc2dc varchar(60) \uc774\uc0c1\uc758 DB \uceec\ub7fc\uc5d0 \ub123\uae30\ubc14\ub78d\ub2c8\ub2e4 )\n\ub9d0\uc778\uc989 \ud574\ub2f9 \uc554\ud638\ud654 \ub41c \uac12\uc740 60 \uc774\uc0c1\uc785\ub2c8\ub2e4.\n\n(1-2) \ube44\uad50\ud558\uae30 - \ub370\uc774\ud130\uc5d0 \ub123\uc5c8\ub358 \uac12\uacfc \uc0c8\ub85c \ubc1b\uc740 \uac12 \ube44\uad50\n\n$result_str = password_verify($\uc0c8\ub85c\ubc1b\uc548\ub4e4\uc778\uac12, $\ub370\uc774\ud130\ubca0\uc774\uc2a4\uc5d0\ub123\uc5c8\ub358\uac12);\n\necho \"$result_str\";   \/\/ 1   - \ube44\uad50\uac12\uc774 \uac19\uc744\ub54c \ucd9c\ub825\ub428 \n\n\n(2) 5.3.10 \ucbe4\uc758 \ubc84\uc83c\uc5d0\uc11c\ub294 \uc544\ub798 \uc18c\uc2a4\ud30c\uc77c\uc744 \ub2e4\uc6b4\ubc1b\uc544\uc11c \uc11c\ubc84\uc5d0 \ud30c\uc77c \uc800\uc7a5 \ud6c4 include \ud558\uc2e0\ud6c4\n    \uc704 (1) \uc5d0\uc11c \uc11c\uc220\ud55c \ub300\ub85c \uc0ac\uc6a9 \ud558\uba74 \ub429\ub2c8\ub2e4.\n\nuse_bcrypt.zip \ud30c\uc77c \ub2e4\uc6b4\ub85c\ub4dc<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"","protected":false},"author":1,"featured_media":1251,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[],"class_list":["post-673","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-php"],"_links":{"self":[{"href":"https:\/\/inwelly.com\/index.php?rest_route=\/wp\/v2\/posts\/673","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/inwelly.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/inwelly.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/inwelly.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/inwelly.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=673"}],"version-history":[{"count":1,"href":"https:\/\/inwelly.com\/index.php?rest_route=\/wp\/v2\/posts\/673\/revisions"}],"predecessor-version":[{"id":674,"href":"https:\/\/inwelly.com\/index.php?rest_route=\/wp\/v2\/posts\/673\/revisions\/674"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/inwelly.com\/index.php?rest_route=\/wp\/v2\/media\/1251"}],"wp:attachment":[{"href":"https:\/\/inwelly.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=673"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/inwelly.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=673"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/inwelly.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=673"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}