{"id":3032,"date":"2018-06-13T19:23:00","date_gmt":"2018-06-13T10:23:00","guid":{"rendered":"http:\/\/taitan916.info\/blog\/?p=3032"},"modified":"2024-02-20T18:58:22","modified_gmt":"2024-02-20T09:58:22","slug":"post-3032","status":"publish","type":"post","link":"https:\/\/taitan916.info\/blog\/archives\/3032","title":{"rendered":"PHP\u3067Blowfish\u30a2\u30eb\u30b4\u30ea\u30ba\u30e0\u3092\u7528\u3044\u305f\u6697\u53f7\u5316\u3068\u5fa9\u53f7\u5316\u65b9\u6cd5"},"content":{"rendered":"<p>PHP\u3067Blowfish\u30a2\u30eb\u30b4\u30ea\u30ba\u30e0\u3092\u7528\u3044\u3066CBC\u30e2\u30fc\u30c9\u3067\u6697\u53f7\u5316\u3068\u5fa9\u53f7\u5316\u3092\u884c\u3044\u305f\u304b\u3063\u305f\u3002\u8abf\u3079\u305f\u3068\u3053\u308dPear\u306eCrypt_Blowfish\u30d1\u30c3\u30b1\u30fc\u30b8\u3068\u3044\u3046\u3082\u306e\u3092\u5c0e\u5165\u3059\u308b\u3053\u3068\u3067\u5b9f\u88c5\u3067\u304d\u308b\u6a21\u69d8\u3002\u4ee5\u4e0b\u306b\u30d1\u30c3\u30b1\u30fc\u30b8\u306e\u5c0e\u5165\u65b9\u6cd5\u53ca\u3073\u6697\u53f7\u5316\u30fb\u5fa9\u53f7\u5316\u306e\u30bd\u30fc\u30b9\u30b3\u30fc\u30c9\u3092\u30e1\u30e2\u3002<\/p>\n<p>&nbsp;<\/p>\n<h2>\u30d1\u30c3\u30b1\u30fc\u30b8\u306e\u5c0e\u5165<\/h2>\n<p>SSH\u63a5\u7d9a\u4e0d\u53ef\u306e\u30b5\u30fc\u30d0\u30fc\u3060\u3063\u305f\u306e\u3067\u4ee5\u4e0b\u30da\u30fc\u30b8\u53f3\u5074\u306eDownload\u306e\u4e0b\u306b\u3042\u308b\u300c1.1.0RC2\u300d\u3068\u3044\u3046\u30ea\u30f3\u30af\u304b\u3089\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3057\u305f\u3002<\/p>\n<p><a href=\"https:\/\/pear.php.net\/package\/Crypt_Blowfish\/download\" target=\"_blank\" rel=\"noopener\">https:\/\/pear.php.net\/package\/Crypt_Blowfish\/download<\/a><\/p>\n<p>SSH\u63a5\u7d9a\u3067\u304d\u308b\u5834\u5408\u306f\u4ee5\u4e0b\u3067\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3067\u304d\u308b\u307f\u305f\u3044\u3002<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">pear install Crypt_Blowfish-1.1.0RC2<\/pre>\n<p>\u5c1a\u3001\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3057\u305f\u30d5\u30a1\u30a4\u30eb\u3092\u89e3\u51cd\u3059\u308b\u3068\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u306a\u3063\u3066\u3044\u308b\u3002<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">Crypt_Blowfish-1.1.0RC2\/\r\n\u3000\u251cBlowfish\/\r\n\u3000\u2514Blowfish.php<\/pre>\n<p>\u300cCrypt_Blowfish-1.1.0RC2\u300d\u306e\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u540d\u3092\u300cCrypt\u300d\u306b\u5909\u66f4\u3057\u3066\u30a2\u30c3\u30d7\u30ed\u30fc\u30c9\u3059\u308b\u3002<\/p>\n<p>&nbsp;<\/p>\n<h2>\u6697\u53f7\u5316\u3068\u5fa9\u53f7\u5316<\/h2>\n<p>\u6697\u53f7\u30ad\u30fc\u3084\u6697\u53f7\u30d9\u30af\u30c8\u30eb\u306f\u56fa\u5b9a\u3068\u60f3\u5b9a\u3059\u308b\u3002\u4ee5\u4e0b\u304c\u30bd\u30fc\u30b9\u3002<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">&lt;?php\r\ndefine('PASS_VECTOR', 'xxxxxxxxx'); \/\/\u6697\u53f7\u5316\u30d9\u30af\u30c8\u30eb\r\ndefine('PASS_KEY', 'xxxxxxxxxxxxxxxx'); \/\/\u6697\u53f7\u5316\u30ad\u30fc\r\n\r\nrequire_once 'Crypt\/Blowfish.php';\r\n\r\n\/\/\u6697\u53f7\u5316\r\nfunction passwordEncrypt( $pass ){\r\n\r\n    $blowfish = Crypt_Blowfish::factory('cbc', PASS_KEY, PASS_VECTOR);\r\n    $encrypt_data = $blowfish-&gt;encrypt($pass);\r\n\r\n    return base64_encode($encrypt_data);\r\n}\r\n\r\n\/\/\u5fa9\u53f7\u5316\r\nfunction passwordDecrypt( $pass ){\r\n\r\n    $blowfish = Crypt_Blowfish::factory('cbc', PASS_KEY, PASS_VECTOR);\r\n    $decrypt_data = $blowfish-&gt;decrypt(base64_decode($pass));\r\n\r\n    return $decrypt_data;\r\n}<\/pre>\n<p>&nbsp;<\/p>\n<h2>Blowfish\u3068\u306f<\/h2>\n<p>\u6697\u53f7\u65b9\u5f0f\u306e\u4e00\u3064\u3002\u30e9\u30a4\u30bb\u30f3\u30b9\u30d5\u30ea\u30fc\u306a\u306e\u3067\u5e45\u5e83\u304f\u4f7f\u308f\u308c\u3066\u3044\u308b\u3089\u3057\u3044\u3002<\/p>\n<p>&nbsp;<\/p>\n<h2>CBC\u30e2\u30fc\u30c9\u3068\u306f<\/h2>\n<p>\u6697\u53f7\u5229\u7528\u30e2\u30fc\u30c9\u306e\u4e00\u3064\u3002\u30d6\u30ed\u30c3\u30af\u306e\u6697\u53f7\u304c\u4e91\u3005\u3068\u306e\u3053\u3068\u3060\u3051\u3069\u3001\u3053\u308c\u306f\u30a4\u30de\u30a4\u30c1\u7406\u89e3\u3067\u304d\u306a\u304b\u3063\u305f\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>PHP\u3067Blowfish\u30a2\u30eb\u30b4\u30ea\u30ba\u30e0\u3092\u7528\u3044\u3066CBC\u30e2\u30fc\u30c9\u3067\u6697\u53f7\u5316\u3068\u5fa9\u53f7\u5316\u3092\u884c\u3044\u305f ... <\/p>\n","protected":false},"author":1,"featured_media":1085,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[2],"tags":[],"class_list":["post-3032","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-php"],"acf":[],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/taitan916.info\/blog\/wp-json\/wp\/v2\/posts\/3032","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/taitan916.info\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/taitan916.info\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/taitan916.info\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/taitan916.info\/blog\/wp-json\/wp\/v2\/comments?post=3032"}],"version-history":[{"count":2,"href":"https:\/\/taitan916.info\/blog\/wp-json\/wp\/v2\/posts\/3032\/revisions"}],"predecessor-version":[{"id":4806,"href":"https:\/\/taitan916.info\/blog\/wp-json\/wp\/v2\/posts\/3032\/revisions\/4806"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/taitan916.info\/blog\/wp-json\/wp\/v2\/media\/1085"}],"wp:attachment":[{"href":"https:\/\/taitan916.info\/blog\/wp-json\/wp\/v2\/media?parent=3032"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/taitan916.info\/blog\/wp-json\/wp\/v2\/categories?post=3032"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/taitan916.info\/blog\/wp-json\/wp\/v2\/tags?post=3032"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}