{"id":464203,"date":"2025-06-23T15:00:15","date_gmt":"2025-06-23T15:00:15","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=464203"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=464203","title":{"rendered":"<span>\u0410\u043d\u0430\u0442\u043e\u043c\u0438\u044f \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u0438 XMPP<\/span>"},"content":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<h4>\u041f\u0440\u0435\u0434\u0438\u0441\u0442\u043e\u0440\u0438\u044f:<\/h4>\n<p>\u0420\u0435\u0448\u0430\u043b \u044f \u0442\u0430\u0441\u043a\u0438 \u043d\u0430 <a href=\"https:\/\/www.root-me.org\/\" rel=\"noopener noreferrer nofollow\">Root-Me<\/a> \u0438 \u043f\u043e\u043f\u0430\u043b\u0430\u0441\u044c \u0442\u0430\u0441\u043a\u0430 <a href=\"https:\/\/www.root-me.org\/en\/Challenges\/Network\/XMPP-authentication-197\" rel=\"noopener noreferrer nofollow\">XMPP &#8212; authentication<\/a>. \u041e\u0441\u043d\u043e\u0432\u043d\u0430\u044f \u0446\u0435\u043b\u044c \u0442\u0430\u0441\u043a\u0438 \u0441\u043e\u0441\u0442\u043e\u044f\u043b\u0430 \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e\u0431\u044b \u043f\u043e \u0437\u0430\u0445\u0432\u0430\u0442\u0443 \u043f\u0430\u043a\u0435\u0442\u043e\u0432 \u0432\u044b\u0442\u0430\u0449\u0438\u0442\u044c \u043f\u0430\u0440\u043e\u043b\u044c, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0441\u044f \u043f\u0440\u0438 \u0430\u0443\u043d\u0442\u0435\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u0438 \u044f \u043d\u0430\u0447\u0430\u043b \u0438\u0441\u043a\u0430\u0442\u044c \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044e \u043a \u0442\u043e\u043c\u0443, \u043a\u0430\u043a \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0430\u0443\u043d\u0442\u0435\u0444\u0438\u043a\u0430\u0446\u0438\u044f \u043a\u043b\u0438\u0435\u043d\u0442\u0430.<\/p>\n<figure class=\"full-width\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/699\/ac9\/561\/699ac9561c30524116929b95930ae1f0.png\" width=\"1280\" height=\"566\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/upload_files\/699\/ac9\/561\/699ac9561c30524116929b95930ae1f0.png 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/699\/ac9\/561\/699ac9561c30524116929b95930ae1f0.png 781w\" loading=\"lazy\" decode=\"async\"\/><\/figure>\n<p>\u041d\u0430\u0442\u043a\u043d\u0443\u043b\u0441\u044f \u043d\u0430 <a href=\"https:\/\/wiki.xmpp.org\/\" rel=\"noopener noreferrer nofollow\">xmpp wiki<\/a> \u0438 \u0442\u0430\u043c \u0436\u0435 \u043d\u0430\u0448\u0435\u043b \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044e \u043d\u0430 \u0430\u0443\u043d\u0442\u0435\u0444\u0438\u043a\u0430\u0446\u0438\u044e \u043a\u043b\u0438\u0435\u043d\u0442\u0430 <a href=\"https:\/\/wiki.xmpp.org\/web\/SASL_Authentication_and_SCRAM\" rel=\"noopener noreferrer nofollow\">SASL_Authentication_and_SCRAM<\/a>. \u0418\u0437 \u043d\u0435\u0435 \u044f \u0432\u044b\u044f\u0441\u043d\u0438\u043b \u0442\u043e, \u043a\u0430\u043a \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0440\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u0432\u0430\u043d\u0438\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u043a\u043b\u0438\u0435\u043d\u0442 \u0437\u043d\u0430\u0435\u0442 \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u044b\u0439 \u043f\u0430\u0440\u043e\u043b\u044c \u0438 \u0447\u0442\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u0442\u0430\u043a \u0438\u0437 \u043f\u0430\u043a\u0435\u0442\u043e\u0432 \u043f\u0430\u0440\u043e\u043b\u044c \u044f \u043d\u0435 \u0432\u044b\u0442\u0430\u0449\u0443. \u0418 \u0442\u0443\u0442 \u044f \u0437\u0430\u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043e\u0432\u0430\u043b\u0441\u044f \u0442\u0435\u043c, \u043a\u0430\u043a \u0432\u043e\u043e\u0431\u0449\u0435 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u043f\u043e\u0434\u0442\u0432\u0435\u0440\u0436\u0434\u0435\u043d\u0438\u0435 \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e\u0433\u043e \u043f\u0430\u0440\u043e\u043b\u044f. \u0418\u043c\u0435\u043d\u043d\u043e \u044d\u0442\u043e \u0438 \u043f\u043e\u0431\u0443\u0434\u0438\u043b\u043e \u043c\u0435\u043d\u044f \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u044d\u0442\u0443 \u0441\u0442\u0430\u0442\u044c\u044e.<\/p>\n<h4>\u041f\u043e\u0432\u0435\u0441\u0442\u0432\u043e\u0432\u0430\u043d\u0438\u0435 \u043e \u0442\u043e\u043c, \u0447\u0442\u043e \u0442\u0430\u043a\u043e\u0435 \u044d\u0442\u043e\u0442 \u0432\u0430\u0448 XMPP<\/h4>\n<p>XMPP(\u0440\u0430\u043d\u0435\u0435 jabber) &#8212; \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b \u043e\u0431\u043c\u0435\u043d\u0430 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f\u043c\u0438 \u0441 \u043e\u0442\u043a\u0440\u044b\u0442\u044b\u043c \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u043c \u043a\u043e\u0434\u043e\u043c, \u043f\u0443\u0431\u043b\u0438\u043a\u0443\u0435\u043c\u044b\u0439 \u043f\u043e\u0434 Apache License 2.0, \u043e\u0441\u043d\u043e\u0432\u0430\u043d \u043d\u0430 XML. \u041f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043c\u0433\u043d\u043e\u0432\u0435\u043d\u043d\u043e \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0442\u044c \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f \u0438 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043e \u043f\u0440\u0438\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u0438, \u0442\u0430\u043a\u0436\u0435 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0439 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0442\u044c \u0444\u0430\u0439\u043b\u044b(XEP-0363 HTTP File Upload; XEP-0096 SI File Transfer; XEP-0065 SOCKS5 Bytestreams; XEP-0166: Jingle \u0438 \u0442.\u0434.), \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u043a\u043e\u043c\u043d\u0430\u0442\u044b(XEP-0045: Multi-User Chat), \u043e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043b\u044f\u0442\u044c \u0433\u043e\u043b\u043e\u0441\u043e\u0432\u044b\u0435 \u0438 \u0432\u0438\u0434\u0435\u043e \u0437\u0432\u043e\u043d\u043a\u0438(XEP-0166: Jingle), \u0445\u0440\u0430\u043d\u0438\u0442\u044c \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u043b\u044c\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0435(XEP-0049 Private XML Storage) \u0438 \u0442.\u0434.<\/p>\n<figure class=\"full-width\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/731\/1ac\/7ca\/7311ac7ca74a137259725109958cad33.png\" width=\"801\" height=\"431\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/upload_files\/731\/1ac\/7ca\/7311ac7ca74a137259725109958cad33.png 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/731\/1ac\/7ca\/7311ac7ca74a137259725109958cad33.png 781w\" loading=\"lazy\" decode=\"async\"\/><\/figure>\n<h4>\u0410 \u0442\u0435\u043f\u0435\u0440\u044c \u043e \u0442\u043e\u043c, \u0447\u0442\u043e \u044f \u0445\u043e\u0442\u0435\u043b \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u0430\u0442\u044c \u0432 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435<\/h4>\n<p>\u0423 XMPP \u0435\u0441\u0442\u044c 2 \u0441\u043f\u043e\u0441\u043e\u0431\u0430 \u0430\u0443\u043d\u0442\u0435\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u043a\u043b\u0438\u0435\u043d\u0442\u0430 SASL \u0438 OAuth 2.0. \u041d\u0430\u0447\u043d\u0435\u043c \u043f\u043e \u043f\u043e\u0440\u044f\u0434\u043a\u0443 &#8212; \u0441 \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c\u043e\u0432 \u0430\u0443\u043d\u0442\u0435\u0444\u0438\u043a\u0430\u0446\u0438\u0438 SASL, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0435 \u0432 XMPP.<\/p>\n<p><strong>SASL<\/strong> (Simple Authentication and Security Layer) \u2014 \u0443\u043d\u0438\u0444\u0438\u0446\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a \u0434\u043b\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c\u043e\u0432 \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u0438 \u043e\u043f\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0448\u0438\u0444\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043f\u0440\u0438 \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 \u043f\u043e \u0441\u0435\u0442\u0438.<\/p>\n<h3>SASL:<\/h3>\n<p>\u041c\u0435\u0445\u0430\u043d\u0438\u0437\u043c\u044b SASL, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u0432 XMPP:<\/p>\n<ol>\n<li>\n<p>External<\/p>\n<\/li>\n<li>\n<p>SCRAM (Salted Challenge Response Authentication Mechanism)<\/p>\n<\/li>\n<li>\n<p>PLAIN<\/p>\n<\/li>\n<li>\n<p>DIGEST-MD5 <\/p>\n<p>(\u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u044b \u0432 \u043f\u043e\u0440\u044f\u0434\u043a\u0435 \u0443\u0431\u044b\u0432\u0430\u043d\u0438\u044f \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u0438)<\/p>\n<\/li>\n<\/ol>\n<p>\u0410 \u0442\u0435\u043f\u0435\u0440\u044c \u043f\u043e\u043f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0439 \u043f\u0440\u043e \u043a\u0430\u0436\u0434\u044b\u0439 \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c:<br \/> External &#8212; \u042d\u0442\u043e\u0442 \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043a\u043b\u0438\u0435\u043d\u0442\u0443 \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u0446\u0438\u0440\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0432\u043d\u0435\u0448\u043d\u0438\u0445 \u0441\u0440\u0435\u0434\u0441\u0442\u0432. \u041e\u043d \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0432\u0445\u043e\u0434\u0438\u0442\u044c \u0432 \u0441\u0438\u0441\u0442\u0435\u043c\u0443 \u0431\u0435\u0437 \u043f\u0430\u0440\u043e\u043b\u044f, \u043f\u043e\u0434\u0442\u0432\u0435\u0440\u0436\u0434\u0430\u044f \u0441\u0432\u043e\u044e \u043b\u0438\u0447\u043d\u043e\u0441\u0442\u044c \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0443\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0446\u0438\u0444\u0440\u043e\u0432\u043e\u0433\u043e \u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u0430<\/p>\n<p>SCRAM(\u041d\u0430 \u043d\u0435\u043c \u044f \u0438 \u0437\u0430\u043e\u0441\u0442\u0440\u044e \u0441\u0432\u043e\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435) &#8212; \u041d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u0440\u0430\u0441\u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0435\u043d\u043d\u044b\u0439 \u0438 \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u0434\u043b\u044f \u0441\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0433\u043e \u041f\u041e XMPP \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c. \u041e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0432\u0430\u0435\u0442 \u043d\u0430\u0434\u0435\u0436\u043d\u0443\u044e \u0437\u0430\u0449\u0438\u0442\u0443 \u043f\u0430\u0440\u043e\u043b\u044f. \u0427\u0442\u043e \u043c\u0435\u043d\u044f \u0437\u0430\u0446\u0435\u043f\u0438\u043b\u043e \u0438\u043c\u0435\u043d\u043d\u043e \u0432 \u044d\u0442\u043e\u043c \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c\u0435, \u044d\u0442\u043e \u0442\u043e, \u0447\u0442\u043e \u043a\u043b\u0438\u0435\u043d\u0442 \u043d\u0435 \u043f\u0435\u0440\u0435\u0434\u0430\u0435\u0442 \u043f\u0430\u0440\u043e\u043b\u044c \u0432 \u043e\u0442\u043a\u0440\u044b\u0442\u043e\u043c \u0432\u0438\u0434\u0435, \u0430 \u043f\u043e\u0434\u0442\u0432\u0435\u0440\u0436\u0434\u0430\u0435\u0442 \u0441\u0432\u043e\u0435 \u0437\u043d\u0430\u043d\u0438\u0435 \u043f\u0430\u0440\u043e\u043b\u044f.<\/p>\n<p>\u041a\u0430\u043a \u043e\u043d\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442?<\/p>\n<ol>\n<li>\n<p>\u041a\u043b\u0438\u0435\u043d\u0442 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442 \u0438\u043c\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f, \u043f\u043e\u0434 \u043a\u043e\u0442\u043e\u0440\u044b\u043c \u043e\u043d \u0445\u043e\u0447\u0435\u0442 \u0430\u0443\u043d\u0442\u0435\u0444\u0438\u0446\u0438\u0440\u043e\u0432\u0430\u0442\u044c\u0441\u044f<\/p>\n<\/li>\n<li>\n<p>\u0421\u0435\u0440\u0432\u0435\u0440 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442 \u043e\u0431\u0440\u0430\u0442\u043d\u043e \u0441\u043e\u043b\u044c \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0438 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0438\u0442\u0435\u0440\u0430\u0446\u0438\u0439<\/p>\n<\/li>\n<li>\n<p>\u041a\u043b\u0438\u0435\u043d\u0442 \u0445\u044d\u0448\u0438\u0440\u0443\u0435\u0442 \u043f\u0430\u0440\u043e\u043b\u044c \u0441 \u0437\u0430\u0434\u0430\u043d\u043d\u043e\u0439 \u0441\u043e\u043b\u044c\u044e \u0434\u043b\u044f \u0437\u0430\u0434\u0430\u043d\u043d\u043e\u0433\u043e \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u0438\u0442\u0435\u0440\u0430\u0446\u0438\u0439<\/p>\n<\/li>\n<li>\n<p>\u041a\u043b\u0438\u0435\u043d\u0442 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u043e\u0431\u0440\u0430\u0442\u043d\u043e<\/p>\n<\/li>\n<li>\n<p>\u0421\u0435\u0440\u0432\u0435\u0440 \u0445\u044d\u0448\u0438\u0440\u0443\u0435\u0442 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0438 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442 \u043a\u043b\u0438\u0435\u043d\u0442\u0443, \u0434\u0430\u0431\u044b \u043a\u043b\u0438\u0435\u043d\u0442 \u043c\u043e\u0433 \u0443\u0434\u043e\u0441\u0442\u043e\u0432\u0435\u0440\u0438\u0442\u044c\u0441\u044f \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u0443 \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u0431\u044b\u043b \u043f\u0430\u0440\u043e\u043b\u044c\/\u0445\u044d\u0448 \u043f\u0430\u0440\u043e\u043b\u044f<\/p>\n<\/li>\n<\/ol>\n<p>\u0421\u043e\u043b\u044c \u2014 \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435, \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c\u043e\u0435 \u043a \u0438\u0441\u0445\u043e\u0434\u043d\u043e\u043c\u0443 \u043f\u0430\u0440\u043e\u043b\u044e \u043f\u0435\u0440\u0435\u0434 \u0445\u0435\u0448\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435\u043c. \u041e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0432\u0430\u0435\u0442 \u0443\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0445\u0435\u0448\u0430 \u0434\u043b\u044f \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u044b\u0445 \u043f\u0430\u0440\u043e\u043b\u0435\u0439 \u0438 \u0437\u0430\u0449\u0438\u0449\u0430\u0435\u0442 \u043e\u0442 \u0430\u0442\u0430\u043a \u043f\u043e \u043f\u0440\u0435\u0434\u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u043d\u044b\u043c \u0442\u0430\u0431\u043b\u0438\u0446\u0430\u043c.<br \/>\u0418\u0442\u0435\u0440\u0430\u0446\u0438\u0438 \u2014 \u0447\u0438\u0441\u043b\u043e \u043f\u043e\u0432\u0442\u043e\u0440\u043d\u044b\u0445 \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u0439 \u0445\u0435\u0448\u2011\u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043a \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0443 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0433\u043e \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f. \u0423\u0432\u0435\u043b\u0438\u0447\u0438\u0432\u0430\u0435\u0442 \u0432\u044b\u0447\u0438\u0441\u043b\u0438\u0442\u0435\u043b\u044c\u043d\u0443\u044e \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043f\u043e\u0434\u0431\u043e\u0440\u0430 \u043f\u0430\u0440\u043e\u043b\u044f, \u0437\u0430\u043c\u0435\u0434\u043b\u044f\u044f \u0430\u0442\u0430\u043a\u0438 \u0433\u0440\u0443\u0431\u043e\u0439 \u0441\u0438\u043b\u044b.<\/p>\n<p>\u041a\u0430\u043a\u0438\u0435 \u0432\u0430\u0440\u0438\u0430\u0446\u0438\u0438 SCRAM \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 XMPP?<\/p>\n<ul>\n<li>\n<p>SCRAM-SHA-256-PLUS<\/p>\n<\/li>\n<li>\n<p>SCRAM-SHA-1-PLUS<\/p>\n<\/li>\n<li>\n<p>SCRAM-SHA-256<\/p>\n<\/li>\n<li>\n<p>SCRAM-SHA-1 <\/p>\n<p>(\u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u044b \u0432 \u043f\u043e\u0440\u044f\u0434\u043a\u0435 \u0443\u0431\u044b\u0432\u0430\u043d\u0438\u044f \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u0438, \u0442\u0430\u043a\u0436\u0435 \u0435\u0441\u0442\u044c SCRAM-SHA512(-PLUS) \u0438 SCRAM-SHA3-512(-PLUS), \u043d\u043e \u043d\u0430 \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0439 \u0432\u0438\u043a\u0438 \u0438 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0435, \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043e\u043d\u0430 \u0441\u0441\u044b\u043b\u0430\u0435\u0442\u0441\u044f, \u043d\u0435\u0442 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u043e \u0442\u043e\u043c, \u043d\u0430\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043e\u043d\u0438 \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u044b)<\/p>\n<\/li>\n<\/ul>\n<p>\u0410 \u0442\u0435\u043f\u0435\u0440\u044c \u043e \u0442\u043e\u043c, \u043a\u0430\u043a \u043e\u043d\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043f\u043e\u0434 \u043a\u0430\u043f\u043e\u0442\u043e\u043c<\/p>\n<ol>\n<li>\n<p>\u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u043d\u043e\u0440\u043c\u0430\u043b\u0438\u0437\u0443\u0435\u0442\u0441\u044f \u043f\u0430\u0440\u043e\u043b\u044c(\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f <a href=\"https:\/\/datatracker.ietf.org\/doc\/html\/rfc4013\" rel=\"noopener noreferrer nofollow\">SASLprep<\/a>)<\/p>\n<\/li>\n<li>\n<p>\u0411\u0435\u0440\u0435\u0442\u0441\u044f \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u0430\u044f \u0441\u0442\u0440\u043e\u043a\u0430(\u0434\u043b\u044f \u043f\u0440\u0438\u043c\u0435\u0440\u0430 \u0431\u0443\u0434\u0435\u0442 32 \u0431\u0430\u0439\u0442\u0430 \u0432 Hex \u043a\u043e\u0434\u0438\u0440\u043e\u0432\u043a\u0435). \u042d\u0442\u043e \u0431\u0443\u0434\u0435\u0442 clientNonce<\/p>\n<\/li>\n<li>\n<p>\u041a\u043b\u0438\u0435\u043d\u0442 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442 \u043f\u0435\u0440\u0432\u043e\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435(initialMessage) <code>\"n=\" .. username .. \",r=\" .. clientNonce<\/code><\/p>\n<\/li>\n<li>\n<p>\u041a\u043b\u0438\u0435\u043d\u0442 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442 GS2 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a \u043a initialMessage \u0438 \u043a\u043e\u0434\u0438\u0440\u0443\u0435\u0442 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u043e\u0435 \u0432 base64 \u0438 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442 \u044d\u0442\u043e \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0441\u0432\u043e\u0435\u0433\u043e \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f<\/p>\n<\/li>\n<\/ol>\n<pre><code>     biwsbj1yb21lbyxyPTZkNDQyYjVkOWU1MWE3NDBmMzY5ZTNkY2VjZjMxNzhl  <\/code><\/pre>\n<ol start=\"5\">\n<li>\n<p>\u0421\u0435\u0440\u0432\u0435\u0440 \u043e\u0442\u0432\u0435\u0447\u0430\u0435\u0442 \u0432\u044b\u0437\u043e\u0432\u043e\u043c. \u0414\u0430\u043d\u043d\u044b\u0435 \u0437\u0430\u043a\u043e\u0434\u0438\u0440\u043e\u0432\u0430\u043d\u044b \u0432 base64<\/p>\n<\/li>\n<\/ol>\n<pre><code>     cj02ZDQ0MmI1ZDllNTFhNzQwZjM2OWUzZGNlY2YzMTc4ZWMxMmIzOTg1YmJkNGE4ZTZmODE0YjQyMmFiNzY2NTczLHM9UVNYQ1IrUTZzZWs4YmY5MixpPTQwOTY=  <\/code><\/pre>\n<ol start=\"6\">\n<li>\n<p>\u041a\u043b\u0438\u0435\u043d\u0442 \u0434\u0435\u043a\u043e\u0434\u0438\u0440\u0443\u0435\u0442 \u044d\u0442\u043e<code>r=6d442b5d9e51a740f369e3dcecf3178ec12b3985bbd4a8e6f814b422ab766573,s=QSXCR+Q6sek8bf92,i=4096<\/code><\/p>\n<\/li>\n<li>\n<p>\u041a\u043b\u0438\u0435\u043d\u0442 \u043f\u0430\u0440\u0441\u0438\u0442 \u043e\u0442\u0441\u044e\u0434\u0430: <\/p>\n<ul>\n<li>\n<p>r = \u042d\u0442\u043e serverNonce, \u043a\u043b\u0438\u0435\u043d\u0442 \u0434\u043e\u043b\u0436\u0435\u043d \u0443\u0431\u0435\u0434\u0438\u0442\u044c\u0441\u044f \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u043e\u043d \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442\u0441\u044f \u0441 clientNonce, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043e\u043d \u043e\u0442\u043f\u0440\u0430\u0432\u0438\u043b \u0432 \u0441\u0432\u043e\u0435\u043c \u043f\u0435\u0440\u0432\u043e\u043c \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0438<\/p>\n<\/li>\n<li>\n<p>s = \u042d\u0442\u043e \u0441\u043e\u043b\u044c, \u0437\u0430\u043a\u043e\u0434\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u0430\u044f \u0432 base64<\/p>\n<\/li>\n<li>\n<p>i = \u042d\u0442\u043e \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0438\u0442\u0435\u0440\u0430\u0446\u0438\u0439<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<p>\u041a\u043b\u0438\u0435\u043d\u0442 \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u0435\u0442:<\/p>\n<\/li>\n<\/ol>\n<pre><code>clientFinalMessageBare = \"c=biws,r=\" .. serverNonce saltedPassword = PBKDF2-SHA-1(normalizedPassword, salt, i) clientKey = HMAC-SHA-1(saltedPassword, \"Client Key\") storedKey = SHA-1(clientKey) authMessage = initialMessage .. \",\" .. serverFirstMessage .. \",\" .. clientFinalMessageBare clientSignature = HMAC-SHA-1(storedKey, authMessage) clientProof = clientKey XOR clientSignature serverKey = HMAC-SHA-1(saltedPassword, \"Server Key\") serverSignature = HMAC-SHA-1(serverKey, authMessage) clientFinalMessage = clientFinalMessageBare .. \",p=\" .. base64(clientProof) <\/code><\/pre>\n<ol start=\"9\">\n<li>\n<p>\u041a\u043b\u0438\u0435\u043d\u0442 \u043a\u043e\u0434\u0438\u0440\u0443\u0435\u0442 \u0432 base64 <code>clientFinalMessage<\/code> \u0438 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442 \u044d\u0442\u043e \u043a\u0430\u043a \u043e\u0442\u0432\u0435\u0442<\/p>\n<\/li>\n<\/ol>\n<pre><code>  Yz1iaXdzLHI9NmQ0NDJiNWQ5ZTUxYTc0MGYzNjllM2RjZWNmMzE3OGVjMTJiMzk4NWJiZDRhOGU2ZjgxNGI0MjJhYjc2NjU3MyxwPXlxbTcyWWxmc2hFTmpQUjFYeGFucG5IUVA4bz0=  <\/code><\/pre>\n<ol start=\"10\">\n<li>\n<p>\u0415\u0441\u043b\u0438 \u0432\u0441\u0435 \u043f\u0440\u043e\u0448\u043b\u043e \u0443\u0441\u043f\u0435\u0448\u043d\u043e, \u0442\u043e \u0432\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0435 \u043e\u0442 \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u043e\u0442\u0432\u0435\u0442 &#171;:<\/p>\n<\/li>\n<\/ol>\n<pre><code> dj1wTk5ERlZFUXh1WHhDb1NFaVc4R0VaKzFSU289  <\/code><\/pre>\n<p>\u0415\u0441\u043b\u0438 \u0434\u0435\u043a\u043e\u0434\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0438\u0437 base64 \u044d\u0442\u043e \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435, \u0442\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u043c:<br \/> <code>v=pNNDFVEQxuXxCoSEiW8GEZ+1RSo=<\/code><br \/> 11.  \u041a\u043b\u0438\u0435\u043d\u0442 \u0434\u043e\u043b\u0436\u0435\u043d \u0443\u0431\u0435\u0434\u0438\u0442\u044c\u0441\u044f, \u0447\u0442\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 v &#8212; \u044d\u0442\u043e serverSignature \u0437\u0430\u043a\u043e\u0434\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u0432 base64.<br \/> \u0418 \u0432\u043e\u0442 \u0438 \u0432\u0441\u0435, \u0434\u0430\u043b\u044c\u0448\u0435 \u043c\u043e\u0436\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043f\u0440\u0438\u0432\u044f\u0437\u043a\u0443 \u043a\u0430\u043d\u0430\u043b\u0430(channel binding), \u0434\u043b\u044f \u0443\u043b\u0443\u0447\u0448\u0435\u043d\u0438\u044f \u0437\u0430\u0449\u0438\u0442\u044b(\u043f\u0440\u0435\u0434\u043e\u0442\u0432\u0440\u0430\u0449\u0435\u043d\u0438\u044f \u043f\u0440\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u044f MitM \u0430\u0442\u0430\u043a).<\/p>\n<figure class=\"full-width\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/fd3\/20f\/285\/fd320f28506483893e2fc42deb5c8efa.png\" width=\"820\" height=\"755\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/upload_files\/fd3\/20f\/285\/fd320f28506483893e2fc42deb5c8efa.png 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/fd3\/20f\/285\/fd320f28506483893e2fc42deb5c8efa.png 781w\" loading=\"lazy\" decode=\"async\"\/><\/figure>\n<p><strong>GS2\u2011\u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a<\/strong> \u2014 \u043a\u043e\u0440\u043e\u0442\u043a\u0438\u0439 \u043f\u0440\u0435\u0444\u0438\u043a\u0441, \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c\u044b\u0439 \u043a\u043b\u0438\u0435\u043d\u0442\u043e\u043c \u043a \u0441\u0432\u043e\u0435\u043c\u0443 \u043f\u0435\u0440\u0432\u043e\u043c\u0443 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044e \u0432 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0435 \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438. \u042f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0447\u0430\u0441\u0442\u044c\u044e \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0430 GS2, \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0432\u0430\u044e\u0449\u0435\u0433\u043e \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c\u043e\u0441\u0442\u044c \u043c\u0435\u0436\u0434\u0443 \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c\u0430\u043c\u0438 SASL (Simple Authentication and Security Layer) \u0438 GSS\u2011API (Generic Security Service Application Program Interface). \u041c\u043e\u0436\u0435\u0442 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442\u044c \u0444\u043b\u0430\u0433\u0438 <code>gs2-cb-flag<\/code> \u0438 <code>gs2-authzid<\/code>.<\/p>\n<p>PLAIN &#8212; \u043d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c \u0430\u0443\u043d\u0442\u0435\u0444\u0438\u043a\u0430\u0446\u0438\u0438, \u0432\u0441\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u0434\u043b\u044f \u0430\u0443\u043d\u0442\u0435\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u043f\u0435\u0440\u0435\u0434\u0430\u044e\u0442\u0441\u044f \u0437\u0430\u043a\u043e\u0434\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u043c\u0438 \u0432 base64, \u043f\u043e \u0444\u0430\u043a\u0442\u0443 \u0432 \u043e\u0442\u043a\u0440\u044b\u0442\u043e\u043c \u0432\u0438\u0434\u0435.<br \/> <code>[authzid]\\x00[username]\\x00[password]<\/code><br \/> \u0438 \u043f\u0440\u0438 \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0435 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0442\u0430\u043a<\/p>\n<pre><code>AGhhYnJfcmVhZGVyAGhlbGxvX3dvcmxk<\/code><\/pre>\n<p>\u041b\u044e\u0431\u043e\u043c\u0443 \u0431\u043e\u043b\u0435\u0435 \u0438\u043b\u0438 \u043c\u0435\u043d\u0435\u0435 \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043b\u0435\u043d\u043d\u043e\u043c\u0443 \u0447\u0435\u043b\u043e\u0432\u0435\u043a\u0443 \u0441\u0442\u0430\u043d\u0435\u0442 \u043e\u0447\u0435\u0432\u0438\u0434\u043d\u043e, \u0447\u0442\u043e \u044d\u0442\u043e \u043d\u0435\u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u044b\u0439 \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c \u0430\u0443\u043d\u0442\u0435\u0444\u0438\u043a\u0430\u0446\u0438\u0438, \u0432\u0435\u0434\u044c \u043f\u0430\u0440\u043e\u043b\u044c \u043f\u0435\u0440\u0435\u0434\u0430\u0435\u0442\u0441\u044f \u0432 \u043e\u0442\u043a\u0440\u044b\u0442\u043e\u043c \u0432\u0438\u0434\u0435, \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0435\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442 \u0432 \u0441\u0432\u044f\u0437\u043a\u0435 <code>PLAIN + TLS<\/code>, \u0442\u0430\u043a \u0437\u0430\u0434\u0430\u0447\u0438 \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0433\u043e \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u043f\u0430\u0440\u043e\u043b\u044f \u0434\u0435\u043b\u0435\u0433\u0438\u0440\u0443\u044e\u0442\u0441\u044f \u0441\u0435\u0440\u0432\u0435\u0440\u0443, \u0430 \u0437\u0430\u0449\u0438\u0442\u0430 \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0438 \u0434\u0435\u043b\u0435\u0433\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0441\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u043c\u0443 \u0441\u043f\u043e\u0441\u043e\u0431\u0443 \u0448\u0438\u0444\u0440\u043e\u0432\u0430\u043d\u0438\u044f.<\/p>\n<figure class=\"full-width\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/3d5\/a6a\/68e\/3d5a6a68eb3021c6ad862bb391e0d226.png\" width=\"681\" height=\"201\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/upload_files\/3d5\/a6a\/68e\/3d5a6a68eb3021c6ad862bb391e0d226.png 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/3d5\/a6a\/68e\/3d5a6a68eb3021c6ad862bb391e0d226.png 781w\" loading=\"lazy\" decode=\"async\"\/><\/figure>\n<p>DIGEST-MD5 &#8212; \u0441\u0430\u043c\u044b\u0435 \u043d\u0435\u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u044b\u0439 \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c \u0438\u0437 \u0441\u043f\u0438\u0441\u043a\u0430, \u0441\u0447\u0438\u0442\u0430\u0435\u0442\u0441\u044f \u0434\u0430\u0432\u043d\u043e \u0443\u0441\u0442\u0430\u0440\u0435\u0432\u0448\u0438\u043c \u0438 \u043d\u0435 \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u0435\u0442\u0441\u044f \u043a \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044e. \u0414\u0430\u043d\u043d\u044b\u0435 \u0434\u043b\u044f \u0430\u0443\u043d\u0442\u0435\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u043f\u0435\u0440\u0435\u0434\u0430\u044e\u0442\u0441\u044f \u0443\u0436\u0435 \u0432 \u0437\u0430\u043a\u0440\u044b\u0442\u043e\u043c \u0432\u0438\u0434\u0435, \u043d\u043e \u043a\u0430\u043c\u043d\u0435\u043c \u043f\u0440\u0435\u0442\u043a\u043d\u043e\u0432\u0435\u043d\u0438\u044f \u0441\u0442\u0430\u043b\u043e \u0442\u043e, \u0447\u0442\u043e \u0434\u043b\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u044d\u0442\u043e\u0433\u043e \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c\u0430 \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0445\u0440\u0430\u043d\u0438\u0442\u044c \u043f\u0430\u0440\u043e\u043b\u044c \u043a\u043b\u0438\u0435\u043d\u0442\u0430 \u0432 \u043e\u0442\u043a\u0440\u044b\u0442\u043e\u043c \u0432\u0438\u0434\u0435, \u043b\u0438\u0431\u043e \u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u0445\u0435\u0448\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f <code>MD5(user:realm:password)<\/code>.<\/p>\n<p>\u0418 \u0432\u043e\u0442 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0435 \u043f\u043e\u044f\u0441\u043d\u0435\u043d\u0438\u0435 \u0434\u043b\u044f \u0442\u0435\u0445, \u043a\u0442\u043e \u0435\u0449\u0435 \u043d\u0435 \u0432\u043a\u0430\u0442\u0438\u043b\u0441\u044f, \u043f\u043e\u0447\u0435\u043c\u0443 PLAIN \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u0435\u0439 DIGEST-MD5, \u0435\u0441\u043b\u0438 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0443 PLAIN \u0441 \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0435\u0439 \u0432 \u043e\u0442\u043a\u0440\u044b\u0442\u043e\u043c \u0432\u0438\u0434\u0435 \u043c\u043e\u0436\u043d\u043e \u0440\u0435\u0448\u0438\u0442\u044c \u0432\u043d\u0435\u0434\u0440\u0435\u043d\u0438\u0435\u043c TLS, \u0442\u043e \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0443 DIGEST-MD5 \u0441 \u043d\u0435\u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u044b\u043c \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u0435\u043c \u043f\u0430\u0440\u043e\u043b\u044f \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0435 \u043d\u0438\u043a\u0430\u043a \u043d\u0435 \u0440\u0435\u0448\u0438\u0442\u044c, \u043a\u0440\u043e\u043c\u0435 \u043a\u0430\u043a \u0441\u043c\u0435\u043d\u043e\u0439 \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c\u0430 \u0430\u0443\u043d\u0442\u0435\u0444\u0438\u043a\u0430\u0446\u0438\u0438. \u041d\u043e \u043c\u043e\u0436\u043d\u043e \u0432\u043e\u0437\u0440\u0430\u0437\u0438\u0442\u044c, \u0447\u0442\u043e PLAIN \u0442\u043e\u0436\u0435 \u0445\u0440\u0430\u043d\u0438\u0442 \u043f\u0430\u0440\u043e\u043b\u044c \u0432 \u043e\u0442\u043a\u0440\u044b\u0442\u043e\u043c \u0432\u0438\u0434\u0435, \u043d\u043e \u0432 \u043e\u0442\u043b\u0438\u0447\u0438\u0435 \u043e\u0442 DIGEST-MD5, \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c PLAIN \u043d\u0435 \u043d\u0430\u0432\u044f\u0437\u044b\u0432\u0430\u0435\u0442 \u0441\u0435\u0440\u0432\u0435\u0440\u0443 \u0441\u043f\u043e\u0441\u043e\u0431 \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u043f\u0430\u0440\u043e\u043b\u0435\u0439. \u0421\u0435\u0440\u0432\u0435\u0440 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442 \u043f\u0430\u0440\u043e\u043b\u044c \u0438 \u0432\u043e\u043b\u0435\u043d \u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0435\u0433\u043e \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u0441\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u0441\u0442\u043e\u0439\u043a\u0438\u0445 \u0445\u0435\u0448-\u0444\u0443\u043d\u043a\u0446\u0438\u0439, \u0442\u0430\u043a\u0438\u0445, \u043a\u0430\u043a bcrypt \u0438\u043b\u0438 Argon2, \u0447\u0442\u043e \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043e\u043c \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u0438<\/p>\n<h3>OAuth 2.0<\/h3>\n<p>\u0428\u0430\u0433\u043d\u0435\u043c \u043d\u0430\u0437\u0430\u0434, OAuth 2.0 &#8212; \u044d\u0442\u043e \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u0438, \u0430 \u043d\u0435 \u0430\u0443\u043d\u0442\u0435\u0444\u0438\u043a\u0430\u0446\u0438\u0438. \u0415\u0433\u043e \u0437\u0430\u0434\u0430\u0447\u0430 &#8212; \u043f\u043e\u0437\u0432\u043e\u043b\u0438\u0442\u044c \u043e\u0434\u043d\u043e\u043c\u0443 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u043d\u044b\u0439 \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u0434\u0430\u043d\u043d\u044b\u043c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0432 \u0434\u0440\u0443\u0433\u043e\u043c \u0441\u0435\u0440\u0432\u0438\u0441\u0435, \u043d\u0435 \u0441\u043f\u0440\u0430\u0448\u0438\u0432\u0430\u044f \u0443 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0435\u0433\u043e \u043f\u0430\u0440\u043e\u043b\u044c \u043e\u0442 \u044d\u0442\u043e\u0433\u043e \u0441\u0435\u0440\u0432\u0438\u0441\u0430.<\/p>\n<p>\u041a\u0430\u043a \u043e\u043d\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u043e \u0432 XMPP?<br \/> \u0427\u0442\u043e\u0431\u044b \u0432\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u044d\u0442\u043e\u0442 \u0432\u0435\u0431-\u043e\u0440\u0438\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u043f\u043e\u0434\u0445\u043e\u0434 \u0432 XMPP, \u0431\u044b\u043b \u0441\u043e\u0437\u0434\u0430\u043d \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0439 \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c SASL \u2014\u00a0OAUTHBEARER. \u0415\u0433\u043e \u043b\u043e\u0433\u0438\u043a\u0430 \u043a\u0430\u0440\u0434\u0438\u043d\u0430\u043b\u044c\u043d\u043e \u043e\u0442\u043b\u0438\u0447\u0430\u0435\u0442\u0441\u044f \u043e\u0442\u00a0PLAIN\u00a0\u0438\u043b\u0438\u00a0SCRAM.<\/p>\n<p>\u042d\u0442\u0430\u043f 1:<\/p>\n<ol>\n<li>\n<p>\u041f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0432 \u043d\u0430\u0448\u0435\u043c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438 \u043d\u0430\u0436\u0438\u043c\u0430\u0435\u0442 \u043a\u043d\u043e\u043f\u043a\u0443 &#171;\u0412\u043e\u0439\u0442\u0438 \u0447\u0435\u0440\u0435\u0437 Google&#187;.<\/p>\n<\/li>\n<li>\n<p>\u041f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043f\u0435\u0440\u0435\u043d\u0430\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442 \u0435\u0433\u043e \u043d\u0430 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0443 \u0432\u0445\u043e\u0434\u0430 Google \u0432 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0435.<\/p>\n<\/li>\n<li>\n<p>\u041f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0432\u0432\u043e\u0434\u0438\u0442 \u0441\u0432\u043e\u0439 \u043b\u043e\u0433\u0438\u043d\/\u043f\u0430\u0440\u043e\u043b\u044c \u043e\u0442 Google, \u043f\u0440\u043e\u0445\u043e\u0434\u0438\u0442 2FA (\u0435\u0441\u043b\u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043d\u043e).<\/p>\n<\/li>\n<li>\n<p>Google \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u044d\u043a\u0440\u0430\u043d \u0441\u043e\u0433\u043b\u0430\u0441\u0438\u044f: &#171;\u041f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 &#8216;XXXXX&#8217; \u0437\u0430\u043f\u0440\u0430\u0448\u0438\u0432\u0430\u0435\u0442 \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u0432\u0430\u0448\u0435\u043c\u0443 \u0438\u043c\u0435\u043d\u0438 \u0438 \u0430\u0434\u0440\u0435\u0441\u0443 \u044d\u043b\u0435\u043a\u0442\u0440\u043e\u043d\u043d\u043e\u0439 \u043f\u043e\u0447\u0442\u044b. \u0420\u0430\u0437\u0440\u0435\u0448\u0438\u0442\u044c?&#187;<\/p>\n<\/li>\n<li>\n<p>\u041f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u043d\u0430\u0436\u0438\u043c\u0430\u0435\u0442 &#171;\u0420\u0430\u0437\u0440\u0435\u0448\u0438\u0442\u044c&#187;.<\/p>\n<\/li>\n<li>\n<p>Google \u043f\u0435\u0440\u0435\u043d\u0430\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u043e\u0431\u0440\u0430\u0442\u043d\u043e \u0432 \u043d\u0430\u0448\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435, \u043f\u0440\u0438\u043a\u0440\u0435\u043f\u0438\u0432 \u043a \u0440\u0435\u0434\u0438\u0440\u0435\u043a\u0442\u0443\u00a0authorization_code.<\/p>\n<\/li>\n<li>\n<p>\u041d\u0430\u0448\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 (\u0435\u0433\u043e \u0431\u044d\u043a\u0435\u043d\u0434)\u00a0\u043e\u0431\u043c\u0435\u043d\u0438\u0432\u0430\u0435\u0442 \u044d\u0442\u043e\u0442 \u043a\u043e\u0434 \u043d\u0430\u00a0access_token\u00a0\u0438\u00a0refresh_token, \u0441\u0434\u0435\u043b\u0430\u0432 \u043f\u0440\u044f\u043c\u043e\u0439 \u0437\u0430\u043f\u0440\u043e\u0441 \u043a API Google.<\/p>\n<\/li>\n<\/ol>\n<p>\u042d\u0442\u0430\u043f 2:<\/p>\n<ol>\n<li>\n<p>\u041a\u043b\u0438\u0435\u043d\u0442 \u0432\u044b\u0431\u0438\u0440\u0430\u0435\u0442 OAUTHBEARER \u0438 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442 auth-\u0441\u0442\u0430\u043d\u0437\u0443. \u0412\u043d\u0443\u0442\u0440\u0438, \u0432 base64, \u043e\u043d \u043f\u0435\u0440\u0435\u0434\u0430\u0435\u0442 <code>access_token<\/code>. <\/p>\n<p><code>n,<\/code><a href=\"mailto:a=user@example.com\" rel=\"noopener noreferrer nofollow\"><code>a=user@example.com<\/code><\/a><code>,^Aauth=Bearer a_very_long_token^A^A<\/code><\/p>\n<\/li>\n<\/ol>\n<pre><code>&lt;auth xmlns='urn:ietf:params:xml:ns:xmpp-sasl'       mechanism='OAUTHBEARER'&gt; bixhPWhhYnJfcmVhZGVyQGhhYnIuY29tLAFhdXRoPUJlYXJlciB0aGVyZSBzaG91bGQgaGF2ZSBiZWVuIHRva2VuLCBidXQgaXQgd291bGQgbm90IGJlOiBEAQA= &lt;\/auth&gt;<\/code><\/pre>\n<ol start=\"2\">\n<li>\n<p>\u0421\u0435\u0440\u0432\u0435\u0440 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442 auth-\u0441\u0442\u0430\u043d\u0437\u0443, \u0434\u0435\u043a\u043e\u0434\u0438\u0440\u0443\u0435\u0442 \u0441\u0442\u0440\u043e\u043a\u0443 \u0438 \u0438\u0437\u0432\u043b\u0435\u043a\u0430\u0435\u0442 access_token.<\/p>\n<\/li>\n<li>\n<p>\u0421\u0435\u0440\u0432\u0435\u0440 \u0434\u0435\u043b\u0430\u0435\u0442 \u0437\u0430\u043f\u0440\u043e\u0441 \u043a API Google \u0438 \u043f\u0440\u0438\u043a\u0440\u0435\u043f\u043b\u044f\u0435\u0442 \u0442\u043e\u043a\u0435\u043d \u043a\u043b\u0438\u0435\u043d\u0442\u0430<\/p>\n<\/li>\n<li>\n<p>\u0421\u0435\u0440\u0432\u0435\u0440 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442 \u043e\u0442\u0432\u0435\u0442 \u043e\u0442 API \u0438 \u043f\u043e\u043d\u0438\u043c\u0430\u0435\u0442, \u0447\u0442\u043e \u044d\u0442\u043e\u0442 \u0442\u043e\u043a\u0435\u043d \u0432\u0430\u043b\u0438\u0434\u0435\u043d \u0438 \u0431\u044b\u043b \u0432\u044b\u043f\u0443\u0449\u0435\u043d \u0434\u043b\u044f \u043d\u0443\u0436\u043d\u043e\u0433\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f<\/p>\n<\/li>\n<li>\n<p>\u0421\u0435\u0440\u0432\u0435\u0440 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442 \u043a\u043b\u0438\u0435\u043d\u0442\u0443 &lt;success\/&gt;<\/p>\n<\/li>\n<\/ol>\n<p>\u0421 \u0430\u0443\u043d\u0442\u0435\u0444\u0438\u043a\u0430\u0446\u0438\u0435\u0439 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u043f\u043e\u043a\u043e\u043d\u0447\u0435\u043d\u043e, \u0432 \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u0435 \u0438 \u0441\u0442\u0430\u0442\u044c\u044e \u043c\u043e\u0436\u043d\u043e \u043d\u0430 \u044d\u0442\u043e\u043c \u0437\u0430\u043a\u0430\u043d\u0447\u0438\u0432\u0430\u0442\u044c, \u0432\u0435\u0434\u044c \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u0438\u0434\u0435\u0435\u0439 \u0431\u044b\u043b\u043e \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u0442\u044c \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c\u044b \u0430\u0443\u043d\u0442\u0435\u0444\u0438\u043a\u0430\u0446\u0438\u0438 SASL, \u0430 XMPP \u0432\u044b\u0441\u0442\u0443\u043f\u0430\u043b \u0432 \u0440\u043e\u043b\u0438 \u043f\u043e\u0434\u043e\u043f\u044b\u0442\u043d\u043e\u0433\u043e \u043a\u0440\u043e\u043b\u0438\u043a\u0430.<\/p>\n<h4>\u0418\u0442\u043e\u0433<\/h4>\n<p>\u0427\u0442\u043e \u0432 \u0438\u0442\u043e\u0433\u0435? \u041f\u0440\u043e\u0432\u0435\u043b\u0438 \u0440\u0435\u0441\u0435\u0440\u0447, \u0432\u044b\u044f\u0441\u043d\u0438\u043b\u0438, \u0447\u0442\u043e \u0443\u0441\u0442\u0430\u0440\u0435\u0432\u0448\u0438\u0435 \u0442\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043d\u0435\u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e, \u0447\u0442\u043e \u0442\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0430 \u043f\u0435\u0440\u0432\u044b\u0439 \u0432\u0437\u0433\u043b\u044f\u0434 \u043d\u0435\u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u044b(PLAIN) \u043c\u043e\u0436\u043d\u043e \u0443\u0441\u043e\u0432\u0435\u0440\u0448\u0435\u043d\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c \u0438 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0438\u0445 \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u044b\u043c\u0438. \u0410 \u043c\u043e\u0436\u043d\u043e \u0432\u0437\u044f\u0442\u044c \u043b\u0443\u0447\u0448\u0435\u0435 \u0438\u0437 \u043b\u0443\u0447\u0448\u0438\u0445 \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043b\u0443\u0447\u0448\u0438\u0435 \u0441\u043f\u043e\u0441\u043e\u0431\u044b \u0437\u0430\u0449\u0438\u0442\u044b \u043f\u0430\u0440\u043e\u043b\u044f. \u0412\u043e\u0442 \u0442\u0430\u043a \u043d\u0430\u0447\u0438\u043d\u0430\u044f \u0441 CTF-\u0437\u0430\u0434\u0430\u0447\u043a\u0438, \u043f\u0435\u0440\u0435\u0448\u043b\u0438 \u043a \u0441\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \u043a\u0440\u0438\u043f\u0442\u043e\u0433\u0440\u0430\u0444\u0438\u0438 \u0438 \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c\u0430\u043c \u0437\u0430\u0449\u0438\u0442\u044b. \u0415\u0441\u043b\u0438 \u044d\u0442\u0430 \u0441\u0442\u0430\u0442\u044c\u044f \u043a\u043e\u043c\u0443-\u0442\u043e \u043f\u043e\u043c\u043e\u0433\u043b\u0430 \u043b\u0443\u0447\u0448\u0435 \u043f\u043e\u043d\u044f\u0442\u044c \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c\u044b \u0430\u0443\u043d\u0442\u0435\u0444\u0438\u043a\u0430\u0446\u0438\u0438 SASL \u0438\u043b\u0438 \u0442\u043e, \u043a\u0430\u043a \u043e\u043d\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u043e \u0432 XMPP, \u0431\u0443\u0434\u0443 \u0431\u0435\u0437\u043c\u0435\u0440\u043d\u043e \u0441\u0447\u0430\u0441\u0442\u043b\u0438\u0432, \u0432\u0435\u0434\u044c \u044d\u0442\u043e \u043c\u043e\u044f \u043f\u0435\u0440\u0432\u0430\u044f \u0441\u0442\u0430\u0442\u044c\u044f \ud83d\ude00<\/p>\n<p>P.S. \u0415\u0441\u043b\u0438 \u0435\u0441\u0442\u044c \u043a\u0430\u043a\u0438\u0435-\u0442\u043e \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043f\u043e \u0443\u043b\u0443\u0447\u0448\u0435\u043d\u0438\u044e \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0438 \u0438\u043b\u0438 \u0431\u0443\u0434\u0443\u0449\u0438\u0445 \u0441\u0442\u0430\u0442\u0435\u0439, \u043f\u0438\u0448\u0438\u0442\u0435, \u043d\u0430 \u0432\u0441\u0435 \u043f\u043e\u0441\u0442\u0430\u0440\u0430\u044e\u0441\u044c \u043e\u0442\u0432\u0435\u0442\u0438\u0442\u044c<\/p>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/920912\/\"> https:\/\/habr.com\/ru\/articles\/920912\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<h4>\u041f\u0440\u0435\u0434\u0438\u0441\u0442\u043e\u0440\u0438\u044f:<\/h4>\n<p>\u0420\u0435\u0448\u0430\u043b \u044f \u0442\u0430\u0441\u043a\u0438 \u043d\u0430 <a href=\"https:\/\/www.root-me.org\/\" rel=\"noopener noreferrer nofollow\">Root-Me<\/a> \u0438 \u043f\u043e\u043f\u0430\u043b\u0430\u0441\u044c \u0442\u0430\u0441\u043a\u0430 <a href=\"https:\/\/www.root-me.org\/en\/Challenges\/Network\/XMPP-authentication-197\" rel=\"noopener noreferrer nofollow\">XMPP &#8212; authentication<\/a>. \u041e\u0441\u043d\u043e\u0432\u043d\u0430\u044f \u0446\u0435\u043b\u044c \u0442\u0430\u0441\u043a\u0438 \u0441\u043e\u0441\u0442\u043e\u044f\u043b\u0430 \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e\u0431\u044b \u043f\u043e \u0437\u0430\u0445\u0432\u0430\u0442\u0443 \u043f\u0430\u043a\u0435\u0442\u043e\u0432 \u0432\u044b\u0442\u0430\u0449\u0438\u0442\u044c \u043f\u0430\u0440\u043e\u043b\u044c, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0441\u044f \u043f\u0440\u0438 \u0430\u0443\u043d\u0442\u0435\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u0438 \u044f \u043d\u0430\u0447\u0430\u043b \u0438\u0441\u043a\u0430\u0442\u044c \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044e \u043a \u0442\u043e\u043c\u0443, \u043a\u0430\u043a \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0430\u0443\u043d\u0442\u0435\u0444\u0438\u043a\u0430\u0446\u0438\u044f \u043a\u043b\u0438\u0435\u043d\u0442\u0430.<\/p>\n<figure class=\"full-width\"><\/figure>\n<p>\u041d\u0430\u0442\u043a\u043d\u0443\u043b\u0441\u044f \u043d\u0430 <a href=\"https:\/\/wiki.xmpp.org\/\" rel=\"noopener noreferrer nofollow\">xmpp wiki<\/a> \u0438 \u0442\u0430\u043c \u0436\u0435 \u043d\u0430\u0448\u0435\u043b \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044e \u043d\u0430 \u0430\u0443\u043d\u0442\u0435\u0444\u0438\u043a\u0430\u0446\u0438\u044e \u043a\u043b\u0438\u0435\u043d\u0442\u0430 <a href=\"https:\/\/wiki.xmpp.org\/web\/SASL_Authentication_and_SCRAM\" rel=\"noopener noreferrer nofollow\">SASL_Authentication_and_SCRAM<\/a>. \u0418\u0437 \u043d\u0435\u0435 \u044f \u0432\u044b\u044f\u0441\u043d\u0438\u043b \u0442\u043e, \u043a\u0430\u043a \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0440\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u0432\u0430\u043d\u0438\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u043a\u043b\u0438\u0435\u043d\u0442 \u0437\u043d\u0430\u0435\u0442 \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u044b\u0439 \u043f\u0430\u0440\u043e\u043b\u044c \u0438 \u0447\u0442\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u0442\u0430\u043a \u0438\u0437 \u043f\u0430\u043a\u0435\u0442\u043e\u0432 \u043f\u0430\u0440\u043e\u043b\u044c \u044f \u043d\u0435 \u0432\u044b\u0442\u0430\u0449\u0443. \u0418 \u0442\u0443\u0442 \u044f \u0437\u0430\u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043e\u0432\u0430\u043b\u0441\u044f \u0442\u0435\u043c, \u043a\u0430\u043a \u0432\u043e\u043e\u0431\u0449\u0435 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u043f\u043e\u0434\u0442\u0432\u0435\u0440\u0436\u0434\u0435\u043d\u0438\u0435 \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e\u0433\u043e \u043f\u0430\u0440\u043e\u043b\u044f. \u0418\u043c\u0435\u043d\u043d\u043e \u044d\u0442\u043e \u0438 \u043f\u043e\u0431\u0443\u0434\u0438\u043b\u043e \u043c\u0435\u043d\u044f \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u044d\u0442\u0443 \u0441\u0442\u0430\u0442\u044c\u044e.<\/p>\n<h4>\u041f\u043e\u0432\u0435\u0441\u0442\u0432\u043e\u0432\u0430\u043d\u0438\u0435 \u043e \u0442\u043e\u043c, \u0447\u0442\u043e \u0442\u0430\u043a\u043e\u0435 \u044d\u0442\u043e\u0442 \u0432\u0430\u0448 XMPP<\/h4>\n<p>XMPP(\u0440\u0430\u043d\u0435\u0435 jabber) &#8212; \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b \u043e\u0431\u043c\u0435\u043d\u0430 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f\u043c\u0438 \u0441 \u043e\u0442\u043a\u0440\u044b\u0442\u044b\u043c \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u043c \u043a\u043e\u0434\u043e\u043c, \u043f\u0443\u0431\u043b\u0438\u043a\u0443\u0435\u043c\u044b\u0439 \u043f\u043e\u0434 Apache License 2.0, \u043e\u0441\u043d\u043e\u0432\u0430\u043d \u043d\u0430 XML. \u041f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043c\u0433\u043d\u043e\u0432\u0435\u043d\u043d\u043e \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0442\u044c \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f \u0438 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043e \u043f\u0440\u0438\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u0438, \u0442\u0430\u043a\u0436\u0435 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0439 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0442\u044c \u0444\u0430\u0439\u043b\u044b(XEP-0363 HTTP File Upload; XEP-0096 SI File Transfer; XEP-0065 SOCKS5 Bytestreams; XEP-0166: Jingle \u0438 \u0442.\u0434.), \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u043a\u043e\u043c\u043d\u0430\u0442\u044b(XEP-0045: Multi-User Chat), \u043e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043b\u044f\u0442\u044c \u0433\u043e\u043b\u043e\u0441\u043e\u0432\u044b\u0435 \u0438 \u0432\u0438\u0434\u0435\u043e \u0437\u0432\u043e\u043d\u043a\u0438(XEP-0166: Jingle), \u0445\u0440\u0430\u043d\u0438\u0442\u044c \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u043b\u044c\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0435(XEP-0049 Private XML Storage) \u0438 \u0442.\u0434.<\/p>\n<figure class=\"full-width\"><\/figure>\n<h4>\u0410 \u0442\u0435\u043f\u0435\u0440\u044c \u043e \u0442\u043e\u043c, \u0447\u0442\u043e \u044f \u0445\u043e\u0442\u0435\u043b \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u0430\u0442\u044c \u0432 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435<\/h4>\n<p>\u0423 XMPP \u0435\u0441\u0442\u044c 2 \u0441\u043f\u043e\u0441\u043e\u0431\u0430 \u0430\u0443\u043d\u0442\u0435\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u043a\u043b\u0438\u0435\u043d\u0442\u0430 SASL \u0438 OAuth 2.0. \u041d\u0430\u0447\u043d\u0435\u043c \u043f\u043e \u043f\u043e\u0440\u044f\u0434\u043a\u0443 &#8212; \u0441 \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c\u043e\u0432 \u0430\u0443\u043d\u0442\u0435\u0444\u0438\u043a\u0430\u0446\u0438\u0438 SASL, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0435 \u0432 XMPP.<\/p>\n<p><strong>SASL<\/strong> (Simple Authentication and Security Layer) \u2014 \u0443\u043d\u0438\u0444\u0438\u0446\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a \u0434\u043b\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c\u043e\u0432 \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u0438 \u043e\u043f\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0448\u0438\u0444\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043f\u0440\u0438 \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 \u043f\u043e \u0441\u0435\u0442\u0438.<\/p>\n<h3>SASL:<\/h3>\n<p>\u041c\u0435\u0445\u0430\u043d\u0438\u0437\u043c\u044b SASL, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u0432 XMPP:<\/p>\n<ol>\n<li>\n<p>External<\/p>\n<\/li>\n<li>\n<p>SCRAM (Salted Challenge Response Authentication Mechanism)<\/p>\n<\/li>\n<li>\n<p>PLAIN<\/p>\n<\/li>\n<li>\n<p>DIGEST-MD5 <\/p>\n<p>(\u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u044b \u0432 \u043f\u043e\u0440\u044f\u0434\u043a\u0435 \u0443\u0431\u044b\u0432\u0430\u043d\u0438\u044f \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u0438)<\/p>\n<\/li>\n<\/ol>\n<p>\u0410 \u0442\u0435\u043f\u0435\u0440\u044c \u043f\u043e\u043f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0439 \u043f\u0440\u043e \u043a\u0430\u0436\u0434\u044b\u0439 \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c:<br \/> External &#8212; \u042d\u0442\u043e\u0442 \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043a\u043b\u0438\u0435\u043d\u0442\u0443 \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u0446\u0438\u0440\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0432\u043d\u0435\u0448\u043d\u0438\u0445 \u0441\u0440\u0435\u0434\u0441\u0442\u0432. \u041e\u043d \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0432\u0445\u043e\u0434\u0438\u0442\u044c \u0432 \u0441\u0438\u0441\u0442\u0435\u043c\u0443 \u0431\u0435\u0437 \u043f\u0430\u0440\u043e\u043b\u044f, \u043f\u043e\u0434\u0442\u0432\u0435\u0440\u0436\u0434\u0430\u044f \u0441\u0432\u043e\u044e \u043b\u0438\u0447\u043d\u043e\u0441\u0442\u044c \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0443\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0446\u0438\u0444\u0440\u043e\u0432\u043e\u0433\u043e \u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u0430<\/p>\n<p>SCRAM(\u041d\u0430 \u043d\u0435\u043c \u044f \u0438 \u0437\u0430\u043e\u0441\u0442\u0440\u044e \u0441\u0432\u043e\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435) &#8212; \u041d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u0440\u0430\u0441\u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0435\u043d\u043d\u044b\u0439 \u0438 \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u0434\u043b\u044f \u0441\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0433\u043e \u041f\u041e XMPP \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c. \u041e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0432\u0430\u0435\u0442 \u043d\u0430\u0434\u0435\u0436\u043d\u0443\u044e \u0437\u0430\u0449\u0438\u0442\u0443 \u043f\u0430\u0440\u043e\u043b\u044f. \u0427\u0442\u043e \u043c\u0435\u043d\u044f \u0437\u0430\u0446\u0435\u043f\u0438\u043b\u043e \u0438\u043c\u0435\u043d\u043d\u043e \u0432 \u044d\u0442\u043e\u043c \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c\u0435, \u044d\u0442\u043e \u0442\u043e, \u0447\u0442\u043e \u043a\u043b\u0438\u0435\u043d\u0442 \u043d\u0435 \u043f\u0435\u0440\u0435\u0434\u0430\u0435\u0442 \u043f\u0430\u0440\u043e\u043b\u044c \u0432 \u043e\u0442\u043a\u0440\u044b\u0442\u043e\u043c \u0432\u0438\u0434\u0435, \u0430 \u043f\u043e\u0434\u0442\u0432\u0435\u0440\u0436\u0434\u0430\u0435\u0442 \u0441\u0432\u043e\u0435 \u0437\u043d\u0430\u043d\u0438\u0435 \u043f\u0430\u0440\u043e\u043b\u044f.<\/p>\n<p>\u041a\u0430\u043a \u043e\u043d\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442?<\/p>\n<ol>\n<li>\n<p>\u041a\u043b\u0438\u0435\u043d\u0442 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442 \u0438\u043c\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f, \u043f\u043e\u0434 \u043a\u043e\u0442\u043e\u0440\u044b\u043c \u043e\u043d \u0445\u043e\u0447\u0435\u0442 \u0430\u0443\u043d\u0442\u0435\u0444\u0438\u0446\u0438\u0440\u043e\u0432\u0430\u0442\u044c\u0441\u044f<\/p>\n<\/li>\n<li>\n<p>\u0421\u0435\u0440\u0432\u0435\u0440 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442 \u043e\u0431\u0440\u0430\u0442\u043d\u043e \u0441\u043e\u043b\u044c \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0438 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0438\u0442\u0435\u0440\u0430\u0446\u0438\u0439<\/p>\n<\/li>\n<li>\n<p>\u041a\u043b\u0438\u0435\u043d\u0442 \u0445\u044d\u0448\u0438\u0440\u0443\u0435\u0442 \u043f\u0430\u0440\u043e\u043b\u044c \u0441 \u0437\u0430\u0434\u0430\u043d\u043d\u043e\u0439 \u0441\u043e\u043b\u044c\u044e \u0434\u043b\u044f \u0437\u0430\u0434\u0430\u043d\u043d\u043e\u0433\u043e \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u0438\u0442\u0435\u0440\u0430\u0446\u0438\u0439<\/p>\n<\/li>\n<li>\n<p>\u041a\u043b\u0438\u0435\u043d\u0442 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u043e\u0431\u0440\u0430\u0442\u043d\u043e<\/p>\n<\/li>\n<li>\n<p>\u0421\u0435\u0440\u0432\u0435\u0440 \u0445\u044d\u0448\u0438\u0440\u0443\u0435\u0442 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0438 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442 \u043a\u043b\u0438\u0435\u043d\u0442\u0443, \u0434\u0430\u0431\u044b \u043a\u043b\u0438\u0435\u043d\u0442 \u043c\u043e\u0433 \u0443\u0434\u043e\u0441\u0442\u043e\u0432\u0435\u0440\u0438\u0442\u044c\u0441\u044f \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u0443 \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u0431\u044b\u043b \u043f\u0430\u0440\u043e\u043b\u044c\/\u0445\u044d\u0448 \u043f\u0430\u0440\u043e\u043b\u044f<\/p>\n<\/li>\n<\/ol>\n<p>\u0421\u043e\u043b\u044c \u2014 \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435, \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c\u043e\u0435 \u043a \u0438\u0441\u0445\u043e\u0434\u043d\u043e\u043c\u0443 \u043f\u0430\u0440\u043e\u043b\u044e \u043f\u0435\u0440\u0435\u0434 \u0445\u0435\u0448\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435\u043c. \u041e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0432\u0430\u0435\u0442 \u0443\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0445\u0435\u0448\u0430 \u0434\u043b\u044f \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u044b\u0445 \u043f\u0430\u0440\u043e\u043b\u0435\u0439 \u0438 \u0437\u0430\u0449\u0438\u0449\u0430\u0435\u0442 \u043e\u0442 \u0430\u0442\u0430\u043a \u043f\u043e \u043f\u0440\u0435\u0434\u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u043d\u044b\u043c \u0442\u0430\u0431\u043b\u0438\u0446\u0430\u043c.<br \/>\u0418\u0442\u0435\u0440\u0430\u0446\u0438\u0438 \u2014 \u0447\u0438\u0441\u043b\u043e \u043f\u043e\u0432\u0442\u043e\u0440\u043d\u044b\u0445 \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u0439 \u0445\u0435\u0448\u2011\u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043a \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0443 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0433\u043e \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f. \u0423\u0432\u0435\u043b\u0438\u0447\u0438\u0432\u0430\u0435\u0442 \u0432\u044b\u0447\u0438\u0441\u043b\u0438\u0442\u0435\u043b\u044c\u043d\u0443\u044e \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043f\u043e\u0434\u0431\u043e\u0440\u0430 \u043f\u0430\u0440\u043e\u043b\u044f, \u0437\u0430\u043c\u0435\u0434\u043b\u044f\u044f \u0430\u0442\u0430\u043a\u0438 \u0433\u0440\u0443\u0431\u043e\u0439 \u0441\u0438\u043b\u044b.<\/p>\n<p>\u041a\u0430\u043a\u0438\u0435 \u0432\u0430\u0440\u0438\u0430\u0446\u0438\u0438 SCRAM \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 XMPP?<\/p>\n<ul>\n<li>\n<p>SCRAM-SHA-256-PLUS<\/p>\n<\/li>\n<li>\n<p>SCRAM-SHA-1-PLUS<\/p>\n<\/li>\n<li>\n<p>SCRAM-SHA-256<\/p>\n<\/li>\n<li>\n<p>SCRAM-SHA-1 <\/p>\n<p>(\u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u044b \u0432 \u043f\u043e\u0440\u044f\u0434\u043a\u0435 \u0443\u0431\u044b\u0432\u0430\u043d\u0438\u044f \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u0438, \u0442\u0430\u043a\u0436\u0435 \u0435\u0441\u0442\u044c SCRAM-SHA512(-PLUS) \u0438 SCRAM-SHA3-512(-PLUS), \u043d\u043e \u043d\u0430 \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0439 \u0432\u0438\u043a\u0438 \u0438 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0435, \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043e\u043d\u0430 \u0441\u0441\u044b\u043b\u0430\u0435\u0442\u0441\u044f, \u043d\u0435\u0442 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u043e \u0442\u043e\u043c, \u043d\u0430\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043e\u043d\u0438 \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u044b)<\/p>\n<\/li>\n<\/ul>\n<p>\u0410 \u0442\u0435\u043f\u0435\u0440\u044c \u043e \u0442\u043e\u043c, \u043a\u0430\u043a \u043e\u043d\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043f\u043e\u0434 \u043a\u0430\u043f\u043e\u0442\u043e\u043c<\/p>\n<ol>\n<li>\n<p>\u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u043d\u043e\u0440\u043c\u0430\u043b\u0438\u0437\u0443\u0435\u0442\u0441\u044f \u043f\u0430\u0440\u043e\u043b\u044c(\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f <a href=\"https:\/\/datatracker.ietf.org\/doc\/html\/rfc4013\" rel=\"noopener noreferrer nofollow\">SASLprep<\/a>)<\/p>\n<\/li>\n<li>\n<p>\u0411\u0435\u0440\u0435\u0442\u0441\u044f \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u0430\u044f \u0441\u0442\u0440\u043e\u043a\u0430(\u0434\u043b\u044f \u043f\u0440\u0438\u043c\u0435\u0440\u0430 \u0431\u0443\u0434\u0435\u0442 32 \u0431\u0430\u0439\u0442\u0430 \u0432 Hex \u043a\u043e\u0434\u0438\u0440\u043e\u0432\u043a\u0435). \u042d\u0442\u043e \u0431\u0443\u0434\u0435\u0442 clientNonce<\/p>\n<\/li>\n<li>\n<p>\u041a\u043b\u0438\u0435\u043d\u0442 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442 \u043f\u0435\u0440\u0432\u043e\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435(initialMessage) <code>\"n=\" .. username .. \",r=\" .. clientNonce<\/code><\/p>\n<\/li>\n<li>\n<p>\u041a\u043b\u0438\u0435\u043d\u0442 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442 GS2 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a \u043a initialMessage \u0438 \u043a\u043e\u0434\u0438\u0440\u0443\u0435\u0442 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u043e\u0435 \u0432 base64 \u0438 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442 \u044d\u0442\u043e \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0441\u0432\u043e\u0435\u0433\u043e \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f<\/p>\n<\/li>\n<\/ol>\n<pre><code>     biwsbj1yb21lbyxyPTZkNDQyYjVkOWU1MWE3NDBmMzY5ZTNkY2VjZjMxNzhl  <\/code><\/pre>\n<ol start=\"5\">\n<li>\n<p>\u0421\u0435\u0440\u0432\u0435\u0440 \u043e\u0442\u0432\u0435\u0447\u0430\u0435\u0442 \u0432\u044b\u0437\u043e\u0432\u043e\u043c. \u0414\u0430\u043d\u043d\u044b\u0435 \u0437\u0430\u043a\u043e\u0434\u0438\u0440\u043e\u0432\u0430\u043d\u044b \u0432 base64<\/p>\n<\/li>\n<\/ol>\n<pre><code>     cj02ZDQ0MmI1ZDllNTFhNzQwZjM2OWUzZGNlY2YzMTc4ZWMxMmIzOTg1YmJkNGE4ZTZmODE0YjQyMmFiNzY2NTczLHM9UVNYQ1IrUTZzZWs4YmY5MixpPTQwOTY=  <\/code><\/pre>\n<ol start=\"6\">\n<li>\n<p>\u041a\u043b\u0438\u0435\u043d\u0442 \u0434\u0435\u043a\u043e\u0434\u0438\u0440\u0443\u0435\u0442 \u044d\u0442\u043e<code>r=6d442b5d9e51a740f369e3dcecf3178ec12b3985bbd4a8e6f814b422ab766573,s=QSXCR+Q6sek8bf92,i=4096<\/code><\/p>\n<\/li>\n<li>\n<p>\u041a\u043b\u0438\u0435\u043d\u0442 \u043f\u0430\u0440\u0441\u0438\u0442 \u043e\u0442\u0441\u044e\u0434\u0430: <\/p>\n<ul>\n<li>\n<p>r = \u042d\u0442\u043e serverNonce, \u043a\u043b\u0438\u0435\u043d\u0442 \u0434\u043e\u043b\u0436\u0435\u043d \u0443\u0431\u0435\u0434\u0438\u0442\u044c\u0441\u044f \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u043e\u043d \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442\u0441\u044f \u0441 clientNonce, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043e\u043d \u043e\u0442\u043f\u0440\u0430\u0432\u0438\u043b \u0432 \u0441\u0432\u043e\u0435\u043c \u043f\u0435\u0440\u0432\u043e\u043c \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0438<\/p>\n<\/li>\n<li>\n<p>s = \u042d\u0442\u043e \u0441\u043e\u043b\u044c, \u0437\u0430\u043a\u043e\u0434\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u0430\u044f \u0432 base64<\/p>\n<\/li>\n<li>\n<p>i = \u042d\u0442\u043e \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0438\u0442\u0435\u0440\u0430\u0446\u0438\u0439<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<p>\u041a\u043b\u0438\u0435\u043d\u0442 \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u0435\u0442:<\/p>\n<\/li>\n<\/ol>\n<pre><code>clientFinalMessageBare = \"c=biws,r=\" .. serverNonce saltedPassword = PBKDF2-SHA-1(normalizedPassword, salt, i) clientKey = HMAC-SHA-1(saltedPassword, \"Client Key\") storedKey = SHA-1(clientKey) authMessage = initialMessage .. \",\" .. serverFirstMessage .. \",\" .. clientFinalMessageBare clientSignature = HMAC-SHA-1(storedKey, authMessage) clientProof = clientKey XOR clientSignature serverKey = HMAC-SHA-1(saltedPassword, \"Server Key\") serverSignature = HMAC-SHA-1(serverKey, authMessage) clientFinalMessage = clientFinalMessageBare .. \",p=\" .. base64(clientProof) <\/code><\/pre>\n<ol start=\"9\">\n<li>\n<p>\u041a\u043b\u0438\u0435\u043d\u0442 \u043a\u043e\u0434\u0438\u0440\u0443\u0435\u0442 \u0432 base64 <code>clientFinalMessage<\/code> \u0438 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442 \u044d\u0442\u043e \u043a\u0430\u043a \u043e\u0442\u0432\u0435\u0442<\/p>\n<\/li>\n<\/ol>\n<pre><code>  Yz1iaXdzLHI9NmQ0NDJiNWQ5ZTUxYTc0MGYzNjllM2RjZWNmMzE3OGVjMTJiMzk4NWJiZDRhOGU2ZjgxNGI0MjJhYjc2NjU3MyxwPXlxbTcyWWxmc2hFTmpQUjFYeGFucG5IUVA4bz0=  <\/code><\/pre>\n<ol start=\"10\">\n<li>\n<p>\u0415\u0441\u043b\u0438 \u0432\u0441\u0435 \u043f\u0440\u043e\u0448\u043b\u043e \u0443\u0441\u043f\u0435\u0448\u043d\u043e, \u0442\u043e \u0432\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0435 \u043e\u0442 \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u043e\u0442\u0432\u0435\u0442 &#171;:<\/p>\n<\/li>\n<\/ol>\n<pre><code> dj1wTk5ERlZFUXh1WHhDb1NFaVc4R0VaKzFSU289  <\/code><\/pre>\n<p>\u0415\u0441\u043b\u0438 \u0434\u0435\u043a\u043e\u0434\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0438\u0437 base64 \u044d\u0442\u043e \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435, \u0442\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u043c:<br \/> <code>v=pNNDFVEQxuXxCoSEiW8GEZ+1RSo=<\/code><br \/> 11.  \u041a\u043b\u0438\u0435\u043d\u0442 \u0434\u043e\u043b\u0436\u0435\u043d \u0443\u0431\u0435\u0434\u0438\u0442\u044c\u0441\u044f, \u0447\u0442\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 v &#8212; \u044d\u0442\u043e serverSignature \u0437\u0430\u043a\u043e\u0434\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u0432 base64.<br \/> \u0418 \u0432\u043e\u0442 \u0438 \u0432\u0441\u0435, \u0434\u0430\u043b\u044c\u0448\u0435 \u043c\u043e\u0436\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043f\u0440\u0438\u0432\u044f\u0437\u043a\u0443 \u043a\u0430\u043d\u0430\u043b\u0430(channel binding), \u0434\u043b\u044f \u0443\u043b\u0443\u0447\u0448\u0435\u043d\u0438\u044f \u0437\u0430\u0449\u0438\u0442\u044b(\u043f\u0440\u0435\u0434\u043e\u0442\u0432\u0440\u0430\u0449\u0435\u043d\u0438\u044f \u043f\u0440\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u044f MitM \u0430\u0442\u0430\u043a).<\/p>\n<figure class=\"full-width\"><\/figure>\n<p><strong>GS2\u2011\u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a<\/strong> \u2014 \u043a\u043e\u0440\u043e\u0442\u043a\u0438\u0439 \u043f\u0440\u0435\u0444\u0438\u043a\u0441, \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c\u044b\u0439 \u043a\u043b\u0438\u0435\u043d\u0442\u043e\u043c \u043a \u0441\u0432\u043e\u0435\u043c\u0443 \u043f\u0435\u0440\u0432\u043e\u043c\u0443 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044e \u0432 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0435 \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438. \u042f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0447\u0430\u0441\u0442\u044c\u044e \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0430 GS2, \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0432\u0430\u044e\u0449\u0435\u0433\u043e \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c\u043e\u0441\u0442\u044c \u043c\u0435\u0436\u0434\u0443 \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c\u0430\u043c\u0438 SASL (Simple Authentication and Security Layer) \u0438 GSS\u2011API (Generic Security Service Application Program Interface). \u041c\u043e\u0436\u0435\u0442 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442\u044c \u0444\u043b\u0430\u0433\u0438 <code>gs2-cb-flag<\/code> \u0438 <code>gs2-authzid<\/code>.<\/p>\n<p>PLAIN &#8212; \u043d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c \u0430\u0443\u043d\u0442\u0435\u0444\u0438\u043a\u0430\u0446\u0438\u0438, \u0432\u0441\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u0434\u043b\u044f \u0430\u0443\u043d\u0442\u0435\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u043f\u0435\u0440\u0435\u0434\u0430\u044e\u0442\u0441\u044f \u0437\u0430\u043a\u043e\u0434\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u043c\u0438 \u0432 base64, \u043f\u043e \u0444\u0430\u043a\u0442\u0443 \u0432 \u043e\u0442\u043a\u0440\u044b\u0442\u043e\u043c \u0432\u0438\u0434\u0435.<br \/> <code>[authzid]\\x00[username]\\x00[password]<\/code><br \/> \u0438 \u043f\u0440\u0438 \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0435 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0442\u0430\u043a<\/p>\n<pre><code>AGhhYnJfcmVhZGVyAGhlbGxvX3dvcmxk<\/code><\/pre>\n<p>\u041b\u044e\u0431\u043e\u043c\u0443 \u0431\u043e\u043b\u0435\u0435 \u0438\u043b\u0438 \u043c\u0435\u043d\u0435\u0435 \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043b\u0435\u043d\u043d\u043e\u043c\u0443 \u0447\u0435\u043b\u043e\u0432\u0435\u043a\u0443 \u0441\u0442\u0430\u043d\u0435\u0442 \u043e\u0447\u0435\u0432\u0438\u0434\u043d\u043e, \u0447\u0442\u043e \u044d\u0442\u043e \u043d\u0435\u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u044b\u0439 \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c \u0430\u0443\u043d\u0442\u0435\u0444\u0438\u043a\u0430\u0446\u0438\u0438, \u0432\u0435\u0434\u044c \u043f\u0430\u0440\u043e\u043b\u044c \u043f\u0435\u0440\u0435\u0434\u0430\u0435\u0442\u0441\u044f \u0432 \u043e\u0442\u043a\u0440\u044b\u0442\u043e\u043c \u0432\u0438\u0434\u0435, \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0435\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442 \u0432 \u0441\u0432\u044f\u0437\u043a\u0435 <code>PLAIN + TLS<\/code>, \u0442\u0430\u043a \u0437\u0430\u0434\u0430\u0447\u0438 \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0433\u043e \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u043f\u0430\u0440\u043e\u043b\u044f \u0434\u0435\u043b\u0435\u0433\u0438\u0440\u0443\u044e\u0442\u0441\u044f \u0441\u0435\u0440\u0432\u0435\u0440\u0443, \u0430 \u0437\u0430\u0449\u0438\u0442\u0430 \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0438 \u0434\u0435\u043b\u0435\u0433\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0441\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u043c\u0443 \u0441\u043f\u043e\u0441\u043e\u0431\u0443 \u0448\u0438\u0444\u0440\u043e\u0432\u0430\u043d\u0438\u044f.<\/p>\n<figure class=\"full-width\"><\/figure>\n<p>DIGEST-MD5 &#8212; \u0441\u0430\u043c\u044b\u0435 \u043d\u0435\u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u044b\u0439 \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c \u0438\u0437 \u0441\u043f\u0438\u0441\u043a\u0430, \u0441\u0447\u0438\u0442\u0430\u0435\u0442\u0441\u044f \u0434\u0430\u0432\u043d\u043e \u0443\u0441\u0442\u0430\u0440\u0435\u0432\u0448\u0438\u043c \u0438 \u043d\u0435 \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u0435\u0442\u0441\u044f \u043a \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044e. \u0414\u0430\u043d\u043d\u044b\u0435 \u0434\u043b\u044f \u0430\u0443\u043d\u0442\u0435\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u043f\u0435\u0440\u0435\u0434\u0430\u044e\u0442\u0441\u044f \u0443\u0436\u0435 \u0432 \u0437\u0430\u043a\u0440\u044b\u0442\u043e\u043c \u0432\u0438\u0434\u0435, \u043d\u043e \u043a\u0430\u043c\u043d\u0435\u043c \u043f\u0440\u0435\u0442\u043a\u043d\u043e\u0432\u0435\u043d\u0438\u044f \u0441\u0442\u0430\u043b\u043e \u0442\u043e, \u0447\u0442\u043e \u0434\u043b\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u044d\u0442\u043e\u0433\u043e \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c\u0430 \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0445\u0440\u0430\u043d\u0438\u0442\u044c \u043f\u0430\u0440\u043e\u043b\u044c \u043a\u043b\u0438\u0435\u043d\u0442\u0430 \u0432 \u043e\u0442\u043a\u0440\u044b\u0442\u043e\u043c \u0432\u0438\u0434\u0435, \u043b\u0438\u0431\u043e \u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u0445\u0435\u0448\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f <code>MD5(user:realm:password)<\/code>.<\/p>\n<p>\u0418 \u0432\u043e\u0442 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0435 \u043f\u043e\u044f\u0441\u043d\u0435\u043d\u0438\u0435 \u0434\u043b\u044f \u0442\u0435\u0445, \u043a\u0442\u043e \u0435\u0449\u0435 \u043d\u0435 \u0432\u043a\u0430\u0442\u0438\u043b\u0441\u044f, \u043f\u043e\u0447\u0435\u043c\u0443 PLAIN \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u0435\u0439 DIGEST-MD5, \u0435\u0441\u043b\u0438 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0443 PLAIN \u0441 \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0435\u0439 \u0432 \u043e\u0442\u043a\u0440\u044b\u0442\u043e\u043c \u0432\u0438\u0434\u0435 \u043c\u043e\u0436\u043d\u043e \u0440\u0435\u0448\u0438\u0442\u044c \u0432\u043d\u0435\u0434\u0440\u0435\u043d\u0438\u0435\u043c TLS, \u0442\u043e \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0443 DIGEST-MD5 \u0441 \u043d\u0435\u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u044b\u043c \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u0435\u043c \u043f\u0430\u0440\u043e\u043b\u044f \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0435 \u043d\u0438\u043a\u0430\u043a \u043d\u0435 \u0440\u0435\u0448\u0438\u0442\u044c, \u043a\u0440\u043e\u043c\u0435 \u043a\u0430\u043a \u0441\u043c\u0435\u043d\u043e\u0439 \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c\u0430 \u0430\u0443\u043d\u0442\u0435\u0444\u0438\u043a\u0430\u0446\u0438\u0438. \u041d\u043e \u043c\u043e\u0436\u043d\u043e \u0432\u043e\u0437\u0440\u0430\u0437\u0438\u0442\u044c, \u0447\u0442\u043e PLAIN \u0442\u043e\u0436\u0435 \u0445\u0440\u0430\u043d\u0438\u0442 \u043f\u0430\u0440\u043e\u043b\u044c \u0432 \u043e\u0442\u043a\u0440\u044b\u0442\u043e\u043c \u0432\u0438\u0434\u0435, \u043d\u043e \u0432 \u043e\u0442\u043b\u0438\u0447\u0438\u0435 \u043e\u0442 DIGEST-MD5, \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c PLAIN \u043d\u0435 \u043d\u0430\u0432\u044f\u0437\u044b\u0432\u0430\u0435\u0442 \u0441\u0435\u0440\u0432\u0435\u0440\u0443 \u0441\u043f\u043e\u0441\u043e\u0431 \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u043f\u0430\u0440\u043e\u043b\u0435\u0439. \u0421\u0435\u0440\u0432\u0435\u0440 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442 \u043f\u0430\u0440\u043e\u043b\u044c \u0438 \u0432\u043e\u043b\u0435\u043d \u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0435\u0433\u043e \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u0441\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u0441\u0442\u043e\u0439\u043a\u0438\u0445 \u0445\u0435\u0448-\u0444\u0443\u043d\u043a\u0446\u0438\u0439, \u0442\u0430\u043a\u0438\u0445, \u043a\u0430\u043a bcrypt \u0438\u043b\u0438 Argon2, \u0447\u0442\u043e \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043e\u043c \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u0438<\/p>\n<h3>OAuth 2.0<\/h3>\n<p>\u0428\u0430\u0433\u043d\u0435\u043c \u043d\u0430\u0437\u0430\u0434, OAuth 2.0 &#8212; \u044d\u0442\u043e \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u0438, \u0430 \u043d\u0435 \u0430\u0443\u043d\u0442\u0435\u0444\u0438\u043a\u0430\u0446\u0438\u0438. \u0415\u0433\u043e \u0437\u0430\u0434\u0430\u0447\u0430 &#8212; \u043f\u043e\u0437\u0432\u043e\u043b\u0438\u0442\u044c \u043e\u0434\u043d\u043e\u043c\u0443 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u043d\u044b\u0439 \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u0434\u0430\u043d\u043d\u044b\u043c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0432 \u0434\u0440\u0443\u0433\u043e\u043c \u0441\u0435\u0440\u0432\u0438\u0441\u0435, \u043d\u0435 \u0441\u043f\u0440\u0430\u0448\u0438\u0432\u0430\u044f \u0443 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0435\u0433\u043e \u043f\u0430\u0440\u043e\u043b\u044c \u043e\u0442 \u044d\u0442\u043e\u0433\u043e \u0441\u0435\u0440\u0432\u0438\u0441\u0430.<\/p>\n<p>\u041a\u0430\u043a \u043e\u043d\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u043e \u0432 XMPP?<br \/> \u0427\u0442\u043e\u0431\u044b \u0432\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u044d\u0442\u043e\u0442 \u0432\u0435\u0431-\u043e\u0440\u0438\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u043f\u043e\u0434\u0445\u043e\u0434 \u0432 XMPP, \u0431\u044b\u043b \u0441\u043e\u0437\u0434\u0430\u043d \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0439 \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c SASL \u2014\u00a0OAUTHBEARER. \u0415\u0433\u043e \u043b\u043e\u0433\u0438\u043a\u0430 \u043a\u0430\u0440\u0434\u0438\u043d\u0430\u043b\u044c\u043d\u043e \u043e\u0442\u043b\u0438\u0447\u0430\u0435\u0442\u0441\u044f \u043e\u0442\u00a0PLAIN\u00a0\u0438\u043b\u0438\u00a0SCRAM.<\/p>\n<p>\u042d\u0442\u0430\u043f 1:<\/p>\n<ol>\n<li>\n<p>\u041f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0432 \u043d\u0430\u0448\u0435\u043c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438 \u043d\u0430\u0436\u0438\u043c\u0430\u0435\u0442 \u043a\u043d\u043e\u043f\u043a\u0443 &#171;\u0412\u043e\u0439\u0442\u0438 \u0447\u0435\u0440\u0435\u0437 Google&#187;.<\/p>\n<\/li>\n<li>\n<p>\u041f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043f\u0435\u0440\u0435\u043d\u0430\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442 \u0435\u0433\u043e \u043d\u0430 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0443 \u0432\u0445\u043e\u0434\u0430 Google \u0432 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0435.<\/p>\n<\/li>\n<li>\n<p>\u041f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0432\u0432\u043e\u0434\u0438\u0442 \u0441\u0432\u043e\u0439 \u043b\u043e\u0433\u0438\u043d\/\u043f\u0430\u0440\u043e\u043b\u044c \u043e\u0442 Google, \u043f\u0440\u043e\u0445\u043e\u0434\u0438\u0442 2FA (\u0435\u0441\u043b\u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043d\u043e).<\/p>\n<\/li>\n<li>\n<p>Google \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u044d\u043a\u0440\u0430\u043d \u0441\u043e\u0433\u043b\u0430\u0441\u0438\u044f: &#171;\u041f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 &#8216;XXXXX&#8217; \u0437\u0430\u043f\u0440\u0430\u0448\u0438\u0432\u0430\u0435\u0442 \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u0432\u0430\u0448\u0435\u043c\u0443 \u0438\u043c\u0435\u043d\u0438 \u0438 \u0430\u0434\u0440\u0435\u0441\u0443 \u044d\u043b\u0435\u043a\u0442\u0440\u043e\u043d\u043d\u043e\u0439 \u043f\u043e\u0447\u0442\u044b. \u0420\u0430\u0437\u0440\u0435\u0448\u0438\u0442\u044c?&#187;<\/p>\n<\/li>\n<li>\n<p>\u041f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u043d\u0430\u0436\u0438\u043c\u0430\u0435\u0442 &#171;\u0420\u0430\u0437\u0440\u0435\u0448\u0438\u0442\u044c&#187;.<\/p>\n<\/li>\n<li>\n<p>Google \u043f\u0435\u0440\u0435\u043d\u0430\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u043e\u0431\u0440\u0430\u0442\u043d\u043e \u0432 \u043d\u0430\u0448\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435, \u043f\u0440\u0438\u043a\u0440\u0435\u043f\u0438\u0432 \u043a \u0440\u0435\u0434\u0438\u0440\u0435\u043a\u0442\u0443\u00a0authorization_code.<\/p>\n<\/li>\n<li>\n<p>\u041d\u0430\u0448\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 (\u0435\u0433\u043e \u0431\u044d\u043a\u0435\u043d\u0434)\u00a0\u043e\u0431\u043c\u0435\u043d\u0438\u0432\u0430\u0435\u0442 \u044d\u0442\u043e\u0442 \u043a\u043e\u0434 \u043d\u0430\u00a0access_token\u00a0\u0438\u00a0refresh_token, \u0441\u0434\u0435\u043b\u0430\u0432 \u043f\u0440\u044f\u043c\u043e\u0439 \u0437\u0430\u043f\u0440\u043e\u0441 \u043a API Google.<\/p>\n<\/li>\n<\/ol>\n<p>\u042d\u0442\u0430\u043f 2:<\/p>\n<ol>\n<li>\n<p>\u041a\u043b\u0438\u0435\u043d\u0442 \u0432\u044b\u0431\u0438\u0440\u0430\u0435\u0442 OAUTHBEARER \u0438 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442 auth-\u0441\u0442\u0430\u043d\u0437\u0443. \u0412\u043d\u0443\u0442\u0440\u0438, \u0432 base64, \u043e\u043d \u043f\u0435\u0440\u0435\u0434\u0430\u0435\u0442 <code>access_token<\/code>. <\/p>\n<p><code>n,<\/code><a href=\"mailto:a=user@example.com\" rel=\"noopener noreferrer nofollow\"><code>a=user@example.com<\/code><\/a><code>,^Aauth=Bearer a_very_long_token^A^A<\/code><\/p>\n<\/li>\n<\/ol>\n<pre><code>&lt;auth xmlns='urn:ietf:params:xml:ns:xmpp-sasl'       mechanism='OAUTHBEARER'&gt; bixhPWhhYnJfcmVhZGVyQGhhYnIuY29tLAFhdXRoPUJlYXJlciB0aGVyZSBzaG91bGQgaGF2ZSBiZWVuIHRva2VuLCBidXQgaXQgd291bGQgbm90IGJlOiBEAQA= &lt;\/auth&gt;<\/code><\/pre>\n<ol start=\"2\">\n<li>\n<p>\u0421\u0435\u0440\u0432\u0435\u0440 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442 auth-\u0441\u0442\u0430\u043d\u0437\u0443, \u0434\u0435\u043a\u043e\u0434\u0438\u0440\u0443\u0435\u0442 \u0441\u0442\u0440\u043e\u043a\u0443 \u0438 \u0438\u0437\u0432\u043b\u0435\u043a\u0430\u0435\u0442 access_token.<\/p>\n<\/li>\n<li>\n<p>\u0421\u0435\u0440\u0432\u0435\u0440 \u0434\u0435\u043b\u0430\u0435\u0442 \u0437\u0430\u043f\u0440\u043e\u0441 \u043a API Google \u0438 \u043f\u0440\u0438\u043a\u0440\u0435\u043f\u043b\u044f\u0435\u0442 \u0442\u043e\u043a\u0435\u043d \u043a\u043b\u0438\u0435\u043d\u0442\u0430<\/p>\n<\/li>\n<li>\n<p>\u0421\u0435\u0440\u0432\u0435\u0440 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442 \u043e\u0442\u0432\u0435\u0442 \u043e\u0442 API \u0438 \u043f\u043e\u043d\u0438\u043c\u0430\u0435\u0442, \u0447\u0442\u043e \u044d\u0442\u043e\u0442 \u0442\u043e\u043a\u0435\u043d \u0432\u0430\u043b\u0438\u0434\u0435\u043d \u0438 \u0431\u044b\u043b \u0432\u044b\u043f\u0443\u0449\u0435\u043d \u0434\u043b\u044f \u043d\u0443\u0436\u043d\u043e\u0433\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f<\/p>\n<\/li>\n<li>\n<p>\u0421\u0435\u0440\u0432\u0435\u0440 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442 \u043a\u043b\u0438\u0435\u043d\u0442\u0443 &lt;success\/&gt;<\/p>\n<\/li>\n<\/ol>\n<p>\u0421 \u0430\u0443\u043d\u0442\u0435\u0444\u0438\u043a\u0430\u0446\u0438\u0435\u0439 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u043f\u043e\u043a\u043e\u043d\u0447\u0435\u043d\u043e, \u0432 \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u0435 \u0438 \u0441\u0442\u0430\u0442\u044c\u044e \u043c\u043e\u0436\u043d\u043e \u043d\u0430 \u044d\u0442\u043e\u043c \u0437\u0430\u043a\u0430\u043d\u0447\u0438\u0432\u0430\u0442\u044c, \u0432\u0435\u0434\u044c \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u0438\u0434\u0435\u0435\u0439 \u0431\u044b\u043b\u043e \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u0442\u044c \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c\u044b \u0430\u0443\u043d\u0442\u0435\u0444\u0438\u043a\u0430\u0446\u0438\u0438 SASL, \u0430 XMPP \u0432\u044b\u0441\u0442\u0443\u043f\u0430\u043b \u0432 \u0440\u043e\u043b\u0438 \u043f\u043e\u0434\u043e\u043f\u044b\u0442\u043d\u043e\u0433\u043e \u043a\u0440\u043e\u043b\u0438\u043a\u0430.<\/p>\n<h4>\u0418\u0442\u043e\u0433<\/h4>\n<p>\u0427\u0442\u043e \u0432 \u0438\u0442\u043e\u0433\u0435? \u041f\u0440\u043e\u0432\u0435\u043b\u0438 \u0440\u0435\u0441\u0435\u0440\u0447, \u0432\u044b\u044f\u0441\u043d\u0438\u043b\u0438, \u0447\u0442\u043e \u0443\u0441\u0442\u0430\u0440\u0435\u0432\u0448\u0438\u0435 \u0442\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043d\u0435\u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e, \u0447\u0442\u043e \u0442\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0430 \u043f\u0435\u0440\u0432\u044b\u0439 \u0432\u0437\u0433\u043b\u044f\u0434 \u043d\u0435\u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u044b(PLAIN) \u043c\u043e\u0436\u043d\u043e \u0443\u0441\u043e\u0432\u0435\u0440\u0448\u0435\u043d\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c \u0438 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0438\u0445 \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u044b\u043c\u0438. \u0410 \u043c\u043e\u0436\u043d\u043e \u0432\u0437\u044f\u0442\u044c \u043b\u0443\u0447\u0448\u0435\u0435 \u0438\u0437 \u043b\u0443\u0447\u0448\u0438\u0445 \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043b\u0443\u0447\u0448\u0438\u0435 \u0441\u043f\u043e\u0441\u043e\u0431\u044b \u0437\u0430\u0449\u0438\u0442\u044b \u043f\u0430\u0440\u043e\u043b\u044f. \u0412\u043e\u0442 \u0442\u0430\u043a \u043d\u0430\u0447\u0438\u043d\u0430\u044f \u0441 CTF-\u0437\u0430\u0434\u0430\u0447\u043a\u0438, \u043f\u0435\u0440\u0435\u0448\u043b\u0438 \u043a \u0441\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \u043a\u0440\u0438\u043f\u0442\u043e\u0433\u0440\u0430\u0444\u0438\u0438 \u0438 \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c\u0430\u043c \u0437\u0430\u0449\u0438\u0442\u044b. \u0415\u0441\u043b\u0438 \u044d\u0442\u0430 \u0441\u0442\u0430\u0442\u044c\u044f \u043a\u043e\u043c\u0443-\u0442\u043e \u043f\u043e\u043c\u043e\u0433\u043b\u0430 \u043b\u0443\u0447\u0448\u0435 \u043f\u043e\u043d\u044f\u0442\u044c \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c\u044b \u0430\u0443\u043d\u0442\u0435\u0444\u0438\u043a\u0430\u0446\u0438\u0438 SASL \u0438\u043b\u0438 \u0442\u043e, \u043a\u0430\u043a \u043e\u043d\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u043e \u0432 XMPP, \u0431\u0443\u0434\u0443 \u0431\u0435\u0437\u043c\u0435\u0440\u043d\u043e \u0441\u0447\u0430\u0441\u0442\u043b\u0438\u0432, \u0432\u0435\u0434\u044c \u044d\u0442\u043e \u043c\u043e\u044f \u043f\u0435\u0440\u0432\u0430\u044f \u0441\u0442\u0430\u0442\u044c\u044f \ud83d\ude00<\/p>\n<p>P.S. \u0415\u0441\u043b\u0438 \u0435\u0441\u0442\u044c \u043a\u0430\u043a\u0438\u0435-\u0442\u043e \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043f\u043e \u0443\u043b\u0443\u0447\u0448\u0435\u043d\u0438\u044e \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0438 \u0438\u043b\u0438 \u0431\u0443\u0434\u0443\u0449\u0438\u0445 \u0441\u0442\u0430\u0442\u0435\u0439, \u043f\u0438\u0448\u0438\u0442\u0435, \u043d\u0430 \u0432\u0441\u0435 \u043f\u043e\u0441\u0442\u0430\u0440\u0430\u044e\u0441\u044c \u043e\u0442\u0432\u0435\u0442\u0438\u0442\u044c<\/p>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 <\/br><\/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-464203","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/464203","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=464203"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/464203\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=464203"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=464203"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=464203"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}