{"id":171347,"date":"2013-03-04T15:04:03","date_gmt":"2013-03-04T11:04:03","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=171347"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=171347","title":{"rendered":"<span class=\"post_title\">\u0411\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u0430\u044f \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044f \u043d\u0430 \u0441\u0430\u0439\u0442\u0435 \u0431\u0435\u0437 https<\/span>"},"content":{"rendered":"<div class=\"content html_format\">   \t\u0421\u0435\u0433\u043e\u0434\u043d\u044f \u0432\u0441\u0435 \u0435\u0449\u0451 \u0431\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u043e \u0441\u0430\u0439\u0442\u043e\u0432 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043f\u043e \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b\u0443 http, \u0430 \u043d\u0435 https. \u042d\u0442\u043e \u0445\u0443\u0436\u0435 \u0432 \u043f\u043b\u0430\u043d\u0435 \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u0438, \u043d\u043e \u0434\u0435\u0448\u0435\u0432\u043b\u0435 \u0438 \u043f\u0440\u043e\u0449\u0435 \u0432 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0435. \u0411\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u044c \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u043d\u0430 \u0442\u0430\u043a\u0438\u0445 \u0441\u0430\u0439\u0442\u0430\u0445 \u2014 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430, \u0442\u0430\u043a \u043a\u0430\u043a \u0447\u0430\u0449\u0435 \u0432\u0441\u0435\u0433\u043e \u043e\u043d\u0430 \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u0442\u0441\u044f \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u043e\u0439 \u0444\u043e\u0440\u043c\u044b c \u043b\u043e\u0433\u0438\u043d\u043e\u043c\/\u043f\u0430\u0440\u043e\u043b\u0435\u043c \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440, \u0433\u0434\u0435 \u0445\u044d\u0448 \u043f\u0430\u0440\u043e\u043b\u044f \u0441\u0432\u0435\u0440\u044f\u0435\u0442\u0441\u044f c \u0445\u044d\u0448\u0435\u043c, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u043e\u043c\u0443 \u043b\u043e\u0433\u0438\u043d\u0443. \u0412\u0445\u043e\u0434\u044f \u043d\u0430 \u0442\u0430\u043a\u043e\u0439 \u0441\u0430\u0439\u0442 \u0432 \u043e\u0442\u043a\u0440\u044b\u0442\u043e\u0439 Wi-Fi \u0441\u0435\u0442\u0438 \u0438\u043b\u0438 \u0434\u0440\u0443\u0433\u043e\u043c \u043f\u0443\u0431\u043b\u0438\u0447\u043d\u043e\u043c \u043c\u0435\u0441\u0442\u0435 \u043b\u044e\u0431\u043e\u0439 \u043a\u0442\u043e \u0443\u043c\u0435\u0435\u0442 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f google \u0441\u043c\u043e\u0436\u0435\u0442 \u0431\u0435\u0437 \u043e\u0441\u043e\u0431\u044b\u0445 \u0443\u0441\u0438\u043b\u0438\u0439 \u043f\u0435\u0440\u0435\u0445\u0432\u0430\u0442\u0438\u0442\u044c \u0432\u0430\u0448 \u043f\u0430\u0440\u043e\u043b\u044c. \u041d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0438\u0434\u0443\u0442 \u0447\u0443\u0442\u044c \u0434\u0430\u043b\u044c\u0448\u0435, \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u044f \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440 \u0445\u044d\u0448 \u043f\u0430\u0440\u043e\u043b\u044f, \u043d\u043e \u0438 \u044d\u0442\u043e \u043d\u0435 \u043d\u0430 \u043c\u043d\u043e\u0433\u043e \u043b\u0443\u0447\u0448\u0435 \u0442\u0430\u043a \u043a\u0430\u043a \u0438\u043c\u0435\u044f \u0440\u0430\u0434\u0443\u0436\u043d\u0443\u044e \u0442\u0430\u0431\u043b\u0438\u0446\u0443 (\u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u0434\u043b\u044f md5) \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u0442\u044c \u043d\u0430\u0439\u0442\u0438 \u043f\u0430\u0440\u043e\u043b\u044c, \u0438\u043c\u0435\u044f \u043d\u0435 \u043d\u0443\u043b\u0435\u0432\u043e\u0439 \u043d\u0430 \u0443\u0441\u043f\u0435\u0445, \u0438 \u043a\u0430\u0436\u0434\u044b\u0439 \u0434\u0435\u043d\u044c \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u044c \u0443\u0441\u043f\u0435\u0445\u0430 \u0440\u0430\u0441\u0442\u0435\u0442.<\/p>\n<p>  \u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u044f \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u044e \u0430\u043b\u044c\u0442\u0435\u0440\u043d\u0430\u0442\u0438\u0432\u043d\u044b\u0439, \u0431\u043e\u043b\u0435\u0435 \u0441\u043b\u043e\u0436\u043d\u044b\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438, \u043f\u0440\u0438 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u043f\u0430\u0440\u043e\u043b\u044c \u043d\u0438 \u0432 \u0447\u0438\u0441\u0442\u043e\u043c \u0432\u0438\u0434\u0435, \u043d\u0438 \u0432 \u0432\u0438\u0434\u0435 \u0445\u044d\u0448\u0430 \u043d\u0435 \u0441\u0432\u0435\u0442\u0438\u0442\u0441\u044f, \u0430 \u0437\u0430\u043e\u0434\u043d\u043e \u0442\u0430\u043a\u043e\u0439 \u043f\u043e\u0434\u0445\u043e\u0434 \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0438\u0441\u043a\u043b\u044e\u0447\u0438\u0442 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u044c \u0432 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0438 captcha \u043a \u0444\u043e\u0440\u043c\u0435 \u0432\u0445\u043e\u0434\u0430.<br \/>  <a name=\"habracut\"><\/a><br \/>  \u0412\u0441\u0451 \u043e\u043f\u0438\u0441\u0430\u043d\u043d\u043e\u0435 \u0443\u0436\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u043d\u0430 \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0435, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043f\u0440\u0438\u043c\u0435\u0440\u044b \u0431\u0443\u0434\u0443\u0442 \u0440\u0435\u0430\u043b\u044c\u043d\u044b\u0435, \u0438 \u0443\u0447\u0438\u0442\u044b\u0432\u0430\u044e\u0449\u0438\u0435 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442 \u0438\u0445 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f.<\/p>\n<p>  \u0410\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044f \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u043e\u0445\u043e\u0434\u0438\u0442\u044c \u0432 \u0434\u0432\u0430 \u044d\u0442\u0430\u043f\u0430 c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c AJAX.<\/p>\n<h2>1 \u042d\u0442\u0430\u043f<\/h2>\n<p>  \u041f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043a\u0430, \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u043c \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440 sha224 \u0445\u044d\u0448 \u043b\u043e\u0433\u0438\u043d\u0430, \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u044b\u0439 \u0445\u044d\u0448. JavaScript \u043f\u0440\u0438\u043c\u0435\u0440:<\/p>\n<pre><code>$.ajax(     base_url+'\/api\/System\/user\/login',     {         cache   : false,         data    : {             login : hash('sha224', login)         },         success : function(random_hash) {             \/\/Get random hash         },         error   : function() {             \/\/Error         }     } );<\/code><\/pre>\n<p>  hash() \u2014 \u044d\u0442\u043e JavaScript \u043e\u0431\u0435\u0440\u0442\u043a\u0430, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0434\u0435\u043b\u0430\u0435\u0442 \u0442\u043e \u0436\u0435 \u0441\u0430\u043c\u043e\u0435, \u0447\u0442\u043e \u0438 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0430\u044f php \u0444\u0443\u043d\u043a\u0446\u0438\u044f.<\/p>\n<p>  \u0421\u043b\u0443\u0447\u0430\u0439\u043d\u044b\u0439 \u0445\u044d\u0448 \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0435. PHP \u043f\u0440\u0438\u043c\u0435\u0440:<\/p>\n<pre><code>$random_hash = hash('sha224', microtime(true));<\/code><\/pre>\n<p>  \u0421\u043b\u0443\u0447\u0430\u0439\u043d\u044b\u0439 \u0445\u044d\u0448 \u0437\u0430\u043f\u043e\u043c\u0438\u043d\u0430\u0435\u0442\u0441\u044f \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0435, \u0438 \u0441\u0432\u044f\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f c \u043b\u043e\u0433\u0438\u043d\u043e\u043c.<\/p>\n<h2>2 \u042d\u0442\u0430\u043f<\/h2>\n<p>  \u0421\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e, \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044f. JavaScript \u043f\u0440\u0438\u043c\u0435\u0440 (\u0432\u043c\u0435\u0441\u0442\u0435 c \u043f\u0435\u0440\u0432\u044b\u043c):<\/p>\n<pre><code>**  * Login into system  *  * @param {string} login  * @param {string} password  *\/ function login (login, password) {     $.ajax(         base_url+'\/api\/System\/user\/login',         {             cache   : false,             data    : {                 login: hash('sha224', login)             },             success : function(random_hash) {                 if (random_hash.length == 56) {                     $.ajax(                         base_url+&quot;\/api\/user\/login&quot;,                         {                             cache   : false,                             data    : {                                 login        : hash('sha224', login),                                 auth_hash    : hash(                                     'sha512',                                     hash('sha224', login)+hash('sha512', hash('sha512', password)+public_key)+navigator.userAgent+random_hash                                 )                             },                             success : function(result) {                                 if (result == 'reload') {                                     location.reload();                                 } else {                                     \/\/Error                                 }                             },                             error   : function() {                                 \/\/Error                             }                         }                     );                 } else {                     \/\/Error                 }             },             error   : function() {                 \/\/Error             }         }     ); }<\/code><\/pre>\n<p>  \u041a\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u0443\u0432\u0438\u0434\u0435\u0442\u044c, \u0434\u043b\u044f \u043f\u0430\u0440\u043e\u043b\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f sha512 \u0445\u044d\u0448. public_key \u2014 \u044d\u0442\u043e \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u0430\u044f \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0441\u0442\u0440\u043e\u0447\u043a\u0443 \u0434\u043b\u0438\u043d\u043e\u0439 \u0432 56 \u0437\u043d\u0430\u043a\u043e\u0432, \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u043a\u0430\u043a \u0441\u043e\u043b\u044c. \u042d\u0442\u0430 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f \u043e\u0431\u0449\u0435\u0434\u043e\u0441\u0442\u0443\u043f\u043d\u0430, \u043d\u043e \u0431\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f \u0442\u043e\u043c\u0443, \u0447\u0442\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0441\u043b\u043e\u0436\u043d\u044b\u0439 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0445\u044d\u0448\u0430 sha512 (\u0434\u0432\u0430\u0436\u0434\u044b) \u2014 \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u044f \u0440\u0430\u0434\u0443\u0436\u043d\u044b\u0445 \u0442\u0430\u0431\u043b\u0438\u0446 \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u0441\u0430\u0439\u0442\u0430 \u0431\u0443\u0434\u0435\u0442 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0441\u043b\u043e\u0436\u043d\u043e\u0439, \u0434\u043e\u0440\u043e\u0433\u043e\u0439 \u0438 \u0434\u043b\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0439 \u043f\u0440\u043e\u0446\u0435\u0434\u0443\u0440\u043e\u0439, \u0447\u0442\u043e\u0431\u044b \u044d\u0442\u043e \u0438\u043c\u0435\u043b\u043e \u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u0441\u043c\u044b\u0441\u043b.<\/p>\n<p>  \u0418\u043c\u0435\u044f \u0445\u044d\u0448 \u043b\u043e\u0433\u0438\u043d\u0430, \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u043d\u0430\u0439\u0442\u0438 \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0435 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0439 \u043f\u0430\u0440\u043e\u043b\u044c, \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u044b\u0439 \u0445\u044d\u0448, \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0439 auth_hash \u0438 \u0441\u0440\u0430\u0432\u043d\u0438\u0442\u044c c \u0442\u0435\u043c, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u044b\u043b \u043f\u043e\u043b\u0443\u0447\u0435\u043d \u043e\u0442 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f. \u0412 \u0441\u043b\u0443\u0447\u0430\u0435 \u0441\u043e\u0432\u043f\u0430\u0434\u0435\u043d\u0438\u044f \u0437\u0430\u0432\u043e\u0434\u0438\u043c \u0441\u0435\u0441\u0441\u0438\u044e, \u0438 \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u0435\u043c \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0443 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f. \u0420\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u043e\u0448\u0438\u0431\u043e\u043a \u043e\u0441\u0442\u0430\u0435\u0442\u0441\u044f \u043d\u0430 \u0432\u0430\u0448\u0435 \u0440\u0430\u0441\u0441\u0443\u0436\u0434\u0435\u043d\u0438\u0435.<\/p>\n<h2>\u0427\u0442\u043e \u0442\u043e\u0433\u0434\u0430 c \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u0435\u0439<\/h2>\n<p>  \u041e\u0447\u0435\u043d\u044c \u043f\u0440\u043e\u0441\u0442\u043e, \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u0430\u0440\u043e\u043b\u044c \u0437\u0430 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f, \u0438 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u043d\u0430 \u043f\u043e\u0447\u0442\u0443. \u041b\u044e\u0431\u043e\u0439 \u0443\u0432\u0430\u0436\u0430\u044e\u0449\u0438\u0439 \u0441\u0435\u0431\u044f \u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u043f\u043e\u0447\u0442\u043e\u0432\u044b\u0439 \u0441\u0435\u0440\u0432\u0438\u0441 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u043f\u043e\u0447\u0442\u0435 \u043f\u043e \u0448\u0438\u0444\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u043c\u0443 \u043a\u0430\u043d\u0430\u043b\u0443. \u041f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u043f\u0440\u0438 \u0436\u0435\u043b\u0430\u043d\u0438\u0438 \u0441\u043c\u043e\u0436\u0435\u0442 \u0441\u043c\u0435\u043d\u0438\u0442\u044c \u043f\u0430\u0440\u043e\u043b\u044c.<\/p>\n<h2>\u0421\u043c\u0435\u043d\u0430 \u043f\u0430\u0440\u043e\u043b\u044f\/\u0432\u043e\u0441\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435<\/h2>\n<p>  \u0412\u043e\u0441\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435 \u043f\u0430\u0440\u043e\u043b\u044f \u0432 \u0434\u0430\u043d\u043d\u043e\u0439 \u0441\u0445\u0435\u043c\u0435 \u0442\u043e\u0436\u0435 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0441\u044f \u043d\u0430 \u043f\u043e\u0447\u0442\u043e\u0432\u044b\u0439 \u044f\u0449\u0438\u043a.<\/p>\n<p>  \u0421\u043c\u0435\u043d\u0443 \u043f\u0430\u0440\u043e\u043b\u044f \u043c\u043e\u0436\u043d\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:  <\/p>\n<ul>\n<li>\u0441\u043e \u0441\u0442\u0430\u0440\u043e\u0433\u043e \u0438 \u043d\u043e\u0432\u043e\u0433\u043e \u043f\u0430\u0440\u043e\u043b\u0435\u0439 \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u043c \u0445\u044d\u0448\u0438 \u043a\u0430\u043a \u0432 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u0432\u044b\u0448\u0435:\n<pre><code>hash('sha512', hash('sha512', password)+public_key)<\/code><\/pre>\n<p>   <\/li>\n<li>\u0434\u0435\u043b\u0430\u0435\u043c \u043f\u043e\u0441\u0438\u043c\u0432\u043e\u043b\u044c\u043d\u044b\u0439 XOR \u043e\u0431\u043e\u0438\u0445 \u043f\u0430\u0440\u043e\u043b\u0435\u0439, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, c \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0442\u0430\u043a\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 xor_string():\n<pre><code>String.prototype.replaceAt=function(index, symbol) {     return this.substr(0, index)+symbol+this.substr(index+symbol.length); }; function xor_string (string1, string2) {     var    len1    = string1.length,            len2    = string2.length;     if (len2 &gt; len1) {         var tmp    = string1;         string1    = string2;         string2    = tmp;         tmp        = len1;         len1       = len2;         len2       = tmp;     }     for (var i = 0; i &lt; len1; ++i) {         var pos    = i % len2;         string1    = string1.replaceAt(i, String.fromCharCode(string1.charCodeAt(i) ^ string2.charCodeAt(pos)));     }     return string1; }<\/code><\/pre>\n<p>   <\/li>\n<li>\u041e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u043c \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440 \u0434\u0432\u0430 \u0445\u044d\u0448\u0430. \u041e\u0434\u0438\u043d \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u0439 \u0432 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 xor_string, \u0432\u0442\u043e\u0440\u043e\u0439 \u043e\u0442 \u0445\u044d\u0448\u0430 \u0442\u0435\u043a\u0443\u0449\u0435\u0433\u043e \u043f\u0430\u0440\u043e\u043b\u044f \u0438 id \u0442\u0435\u043a\u0443\u0449\u0435\u0439 \u0441\u0435\u0441\u0441\u0438\u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f. JavaScript \u043f\u0440\u0438\u043c\u0435\u0440:\n<pre><code>\/**  * Password changing  *  * @param {string} current_password  * @param {string} new_password  *\/ function change_password (current_password, new_password) {     if (!current_password) {         \/\/Error         return;     } else if (!new_password) {        \/\/Error         return;     } else if (current_password == new_password) {         \/\/Error         return;     }     current_password    = hash('sha512', hash('sha512', current_password)+public_key);     new_password        = hash('sha512', hash('sha512', new_password)+public_key);     $.ajax(         base_url+'\/api\/System\/user\/change_password',         {             cache   : false,             data    : {                 verify_hash     : hash('sha224', current_password+session_id),                 new_password    : xor_string(current_password, new_password)             },             success : function(result) {                 if (result == 'OK') {                     \/\/Success                 } else {                     \/\/Error                 }             },             error   : function() {                 \/\/Error             }         }     ); }<\/code><\/pre>\n<p>   <\/li>\n<li>\u041d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0435, \u0437\u043d\u0430\u044f \u0447\u0442\u043e \u0437\u0430 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c, \u043c\u044b \u043b\u0435\u0433\u043a\u043e \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u043c verify_hash. \u0415\u0441\u043b\u0438 \u043e\u043d \u0441\u043e\u0432\u043f\u0430\u0434\u0430\u0435\u0442 c \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u043c \u043e\u0442 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u2014 \u0442\u0435\u043a\u0443\u0449\u0438\u0439 \u043f\u0430\u0440\u043e\u043b\u044c \u0431\u044b\u043b \u0432\u0432\u0435\u0434\u0435\u043d \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e, \u0434\u0435\u043b\u0430\u0435\u043c \u043f\u043e\u0441\u0438\u043c\u0432\u043e\u043b\u044c\u043d\u044b\u0439 xor \u0445\u044d\u0448\u0430 \u0441\u0442\u0440\u043e\u043a\u0438 \u0442\u0435\u043a\u0443\u0449\u0435\u0433\u043e \u043f\u0430\u0440\u043e\u043b\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f, \u0438 new_password, \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u043e\u0433\u043e \u043e\u0442 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f. \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u043c\u044b \u0432\u043e\u0441\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c \u0445\u044d\u0448 \u043d\u043e\u0432\u043e\u0433\u043e \u043f\u0430\u0440\u043e\u043b\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f, \u043a\u043e\u0442\u043e\u0440\u044b\u043c \u0438 \u0437\u0430\u043c\u0435\u043d\u044f\u0435\u043c \u0442\u0435\u043a\u0443\u0449\u0438\u0439. PHP \u043f\u0440\u0438\u043c\u0435\u0440 \u0430\u043d\u0430\u043b\u043e\u0433\u0430 xor_string \u0438\u0437 JavaScript \u043f\u0440\u0438\u043c\u0435\u0440\u0430:\n<pre><code>function xor_string ($string1, $string2) {     $len1    = mb_strlen($string1);     $len2    = mb_strlen($string2);     if ($len2 &gt; $len1) {         list($string1, $string2, $len1, $len2) = [$string2, $string1, $len2, $len1];     }     for ($i = 0; $i &lt; $len1; ++$i) {         $pos         = $i % $len2;         $string1[$i] = chr(ord($string1[$i]) ^ ord($string2[$pos]));     }     return $string1; }     <\/code><\/pre>\n<p>   <\/li>\n<\/ul>\n<h2>\u0414\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u043c\u0435\u0440\u044b \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u0438<\/h2>\n<p>  \u0414\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u044e \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0442\u044c \u0432 \u0437\u0430\u043f\u0440\u043e\u0441 id \u0442\u0435\u043a\u0443\u0449\u0435\u0439 \u0441\u0435\u0441\u0441\u0438\u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f, \u0438 \u043f\u0440\u0438 \u0435\u0433\u043e \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u0438 \u0438\u043b\u0438 \u043d\u0435 \u0441\u043e\u0432\u043f\u0430\u0434\u0435\u043d\u0438\u0438 c \u0442\u0435\u043a\u0443\u0449\u0435\u0439 \u0441\u0435\u0441\u0441\u0438\u0435\u0439 \u043e\u0431\u043d\u0443\u043b\u044f\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 POST \u0437\u0430\u043f\u0440\u043e\u0441\u0430.<\/p>\n<h2>\u041d\u0430 \u044d\u0442\u043e\u043c \u0432\u0441\u0451<\/h2>\n<p>  \u041a\u043e\u0434 \u043c\u043e\u0436\u0435\u0442\u0435 \u0441\u0432\u043e\u0431\u043e\u0434\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0432 \u0441\u0432\u043e\u0438\u0445 \u0446\u0435\u043b\u044f\u0445, \u043c\u0435\u043d\u044f\u0442\u044c \u0442\u0438\u043f\u044b \u0438 \u0440\u0430\u0437\u043c\u0435\u0440\u044b \u0445\u044d\u0448\u0435\u0439 \u0434\u043b\u044f \u0443\u0441\u043b\u043e\u0436\u043d\u0435\u043d\u0438\u044f \u0438\u043b\u0438 \u0443\u0441\u043a\u043e\u0440\u0435\u043d\u0438\u044f \u043f\u0440\u043e\u0446\u0435\u0434\u0443\u0440\u044b.<br \/>  \u0411\u0443\u0434\u0443 \u0440\u0430\u0434 \u0437\u0430\u043c\u0435\u0447\u0430\u043d\u0438\u044f\u043c\/\u043f\u043e\u0436\u0435\u043b\u0430\u043d\u0438\u044f\u043c, \u0441\u043f\u0430\u0441\u0438\u0431\u043e \u0447\u0442\u043e \u0434\u043e\u0447\u0438\u0442\u0430\u043b\u0438 \u0434\u043e \u044d\u0442\u043e\u0433\u043e \u043c\u0435\u0441\u0442\u0430.    \t \t\t   \t<\/p>\n<div class=\"clear\"><\/div>\n<\/p><\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"http:\/\/habrahabr.ru\/post\/171347\/\"> http:\/\/habrahabr.ru\/post\/171347\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div class=\"content html_format\">   \t\u0421\u0435\u0433\u043e\u0434\u043d\u044f \u0432\u0441\u0435 \u0435\u0449\u0451 \u0431\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u043e \u0441\u0430\u0439\u0442\u043e\u0432 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043f\u043e \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b\u0443 http, \u0430 \u043d\u0435 https. \u042d\u0442\u043e \u0445\u0443\u0436\u0435 \u0432 \u043f\u043b\u0430\u043d\u0435 \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u0438, \u043d\u043e \u0434\u0435\u0448\u0435\u0432\u043b\u0435 \u0438 \u043f\u0440\u043e\u0449\u0435 \u0432 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0435. \u0411\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u044c \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u043d\u0430 \u0442\u0430\u043a\u0438\u0445 \u0441\u0430\u0439\u0442\u0430\u0445 \u2014 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430, \u0442\u0430\u043a \u043a\u0430\u043a \u0447\u0430\u0449\u0435 \u0432\u0441\u0435\u0433\u043e \u043e\u043d\u0430 \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u0442\u0441\u044f \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u043e\u0439 \u0444\u043e\u0440\u043c\u044b c \u043b\u043e\u0433\u0438\u043d\u043e\u043c\/\u043f\u0430\u0440\u043e\u043b\u0435\u043c \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440, \u0433\u0434\u0435 \u0445\u044d\u0448 \u043f\u0430\u0440\u043e\u043b\u044f \u0441\u0432\u0435\u0440\u044f\u0435\u0442\u0441\u044f c \u0445\u044d\u0448\u0435\u043c, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u043e\u043c\u0443 \u043b\u043e\u0433\u0438\u043d\u0443. \u0412\u0445\u043e\u0434\u044f \u043d\u0430 \u0442\u0430\u043a\u043e\u0439 \u0441\u0430\u0439\u0442 \u0432 \u043e\u0442\u043a\u0440\u044b\u0442\u043e\u0439 Wi-Fi \u0441\u0435\u0442\u0438 \u0438\u043b\u0438 \u0434\u0440\u0443\u0433\u043e\u043c \u043f\u0443\u0431\u043b\u0438\u0447\u043d\u043e\u043c \u043c\u0435\u0441\u0442\u0435 \u043b\u044e\u0431\u043e\u0439 \u043a\u0442\u043e \u0443\u043c\u0435\u0435\u0442 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f google \u0441\u043c\u043e\u0436\u0435\u0442 \u0431\u0435\u0437 \u043e\u0441\u043e\u0431\u044b\u0445 \u0443\u0441\u0438\u043b\u0438\u0439 \u043f\u0435\u0440\u0435\u0445\u0432\u0430\u0442\u0438\u0442\u044c \u0432\u0430\u0448 \u043f\u0430\u0440\u043e\u043b\u044c. \u041d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0438\u0434\u0443\u0442 \u0447\u0443\u0442\u044c \u0434\u0430\u043b\u044c\u0448\u0435, \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u044f \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440 \u0445\u044d\u0448 \u043f\u0430\u0440\u043e\u043b\u044f, \u043d\u043e \u0438 \u044d\u0442\u043e \u043d\u0435 \u043d\u0430 \u043c\u043d\u043e\u0433\u043e \u043b\u0443\u0447\u0448\u0435 \u0442\u0430\u043a \u043a\u0430\u043a \u0438\u043c\u0435\u044f \u0440\u0430\u0434\u0443\u0436\u043d\u0443\u044e \u0442\u0430\u0431\u043b\u0438\u0446\u0443 (\u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u0434\u043b\u044f md5) \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u0442\u044c \u043d\u0430\u0439\u0442\u0438 \u043f\u0430\u0440\u043e\u043b\u044c, \u0438\u043c\u0435\u044f \u043d\u0435 \u043d\u0443\u043b\u0435\u0432\u043e\u0439 \u043d\u0430 \u0443\u0441\u043f\u0435\u0445, \u0438 \u043a\u0430\u0436\u0434\u044b\u0439 \u0434\u0435\u043d\u044c \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u044c \u0443\u0441\u043f\u0435\u0445\u0430 \u0440\u0430\u0441\u0442\u0435\u0442.<\/p>\n<p>  \u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u044f \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u044e \u0430\u043b\u044c\u0442\u0435\u0440\u043d\u0430\u0442\u0438\u0432\u043d\u044b\u0439, \u0431\u043e\u043b\u0435\u0435 \u0441\u043b\u043e\u0436\u043d\u044b\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438, \u043f\u0440\u0438 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u043f\u0430\u0440\u043e\u043b\u044c \u043d\u0438 \u0432 \u0447\u0438\u0441\u0442\u043e\u043c \u0432\u0438\u0434\u0435, \u043d\u0438 \u0432 \u0432\u0438\u0434\u0435 \u0445\u044d\u0448\u0430 \u043d\u0435 \u0441\u0432\u0435\u0442\u0438\u0442\u0441\u044f, \u0430 \u0437\u0430\u043e\u0434\u043d\u043e \u0442\u0430\u043a\u043e\u0439 \u043f\u043e\u0434\u0445\u043e\u0434 \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0438\u0441\u043a\u043b\u044e\u0447\u0438\u0442 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u044c \u0432 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0438 captcha \u043a \u0444\u043e\u0440\u043c\u0435 \u0432\u0445\u043e\u0434\u0430.  <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-171347","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/171347","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=171347"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/171347\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=171347"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=171347"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=171347"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}