{"id":363839,"date":"2024-05-21T02:04:37","date_gmt":"2024-05-21T02:04:37","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=363839"},"modified":"-0001-11-30T00:00:00","modified_gmt":"2024-05-21T02:04:37","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=363839","title":{"rendered":"<span>\u041f\u0438\u0448\u0435\u043c \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u043a\u043e\u043d\u0441\u043e\u043b\u044c\u043d\u044b\u0439 \u043c\u0435\u0441\u0441\u0435\u043d\u0434\u0436\u0435\u0440 \u0441 end-to-end \u0448\u0438\u0444\u0440\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u043f\u043e\u0432\u0435\u0440\u0445 \u00abHidden Lake\u00bb \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432<\/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<p>\u0412 \u0441\u0432\u043e\u0431\u043e\u0434\u043d\u043e\u0435 \u043e\u0442 \u0440\u0430\u0431\u043e\u0442\u044b \u0432\u0440\u0435\u043c\u044f \u044f \u043f\u0438\u0448\u0443 \u0430\u043d\u043e\u043d\u0438\u043c\u043d\u0443\u044e \u0441\u0435\u0442\u044c <strong>Hidden Lake<\/strong>, \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u044e \u0432 \u043d\u0435\u0451 \u043d\u043e\u0432\u044b\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0438 \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u043e \u0438\u0441\u043f\u0440\u0430\u0432\u043b\u044f\u044e \u0440\u0430\u043d\u0435\u0435 \u043c\u043d\u043e\u0439 \u0436\u0435 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0435 \u0431\u0430\u0433\u0438. \u0412\u0441\u044f \u0444\u0438\u043b\u043e\u0441\u043e\u0444\u0438\u044f \u0441\u0435\u0442\u0438 Hidden Lake \u0434\u0435\u0440\u0436\u0438\u0442\u0441\u044f \u043d\u0430 \u043c\u0438\u043a\u0440\u043e\u0441\u0435\u0440\u0432\u0438\u0441\u043d\u043e\u0439 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0435, \u043d\u0430 \u043a\u043e\u043d\u0446\u0435\u043f\u0446\u0438\u0438 \u043d\u0435\u0437\u0430\u0432\u0438\u0441\u0438\u043c\u044b\u0445 (\u043d\u0430\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u044d\u0442\u043e \u0442\u043e\u043b\u044c\u043a\u043e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e) \u0434\u0440\u0443\u0433 \u043e\u0442 \u0434\u0440\u0443\u0433\u0430 \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432. \u0412 \u043e\u0434\u043d\u043e\u0439 \u0438\u0437 \u043c\u043e\u0438\u0445 <a href=\"https:\/\/habr.com\/ru\/articles\/765464\/\" rel=\"noopener noreferrer nofollow\">\u0441\u0442\u0430\u0442\u0435\u0439<\/a> \u0443\u0436\u0435 \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u043b\u0441\u044f \u043f\u0440\u0438\u043c\u0435\u0440 \u0442\u043e\u0433\u043e, \u043a\u0430\u043a \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439 \u0441\u0435\u0440\u0432\u0438\u0441 \u0432 \u0430\u043d\u043e\u043d\u0438\u043c\u043d\u043e\u0439 \u0441\u0435\u0442\u0438 HL, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u0441\u0432\u043e\u0438 \u0442\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u0438 \u0438 \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u043d\u0435 \u043e\u0431\u0440\u0430\u0449\u0430\u044f\u0441\u044c \u043a \u044f\u0437\u044b\u043a\u0443 Go (\u0440\u043e\u0434\u043d\u043e\u043c\u0443 \u044f\u0437\u044b\u043a\u0443 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439 Hidden Lake). <\/p>\n<p>\u041d\u043e \u0432 \u0442\u043e\u0442 \u043c\u043e\u043c\u0435\u043d\u0442 \u043f\u0440\u0438\u0441\u0443\u0442\u0441\u0442\u0432\u043e\u0432\u0430\u043b\u0430 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u043d\u043e\u0441\u0442\u044c \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u044b Hidden Lake \u043f\u043e \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044e \u043d\u0435\u0430\u043d\u043e\u043d\u0438\u043c\u043d\u044b\u0445, \u043d\u043e \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u044b\u0445 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439. \u0418\u043d\u044b\u043c\u0438 \u0441\u043b\u043e\u0432\u0430\u043c\u0438, \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0430\u043d\u043e\u043d\u0438\u043c\u043d\u044b\u0439 \u0438 \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u044b\u0439 \u043c\u0435\u0441\u0441\u0435\u043d\u0434\u0436\u0435\u0440 (\u043f\u0440\u0438\u043c\u0435\u0440 \u0442\u043e\u043c\u0443 <a href=\"https:\/\/habr.com\/ru\/articles\/701488\/\" rel=\"noopener noreferrer nofollow\">HLM<\/a>), \u043d\u043e \u043d\u0435\u043b\u044c\u0437\u044f \u0431\u044b\u043b\u043e \u0443\u0431\u0440\u0430\u0442\u044c \u0430\u043d\u043e\u043d\u0438\u043c\u043d\u043e\u0441\u0442\u044c \u0438\u0437 \u044d\u0442\u043e\u0433\u043e \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u0430. \u041e\u0442 \u0447\u0430\u0441\u0442\u0438 \u044d\u0442\u043e \u043b\u043e\u0433\u0438\u0447\u043d\u043e\u0435 \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435, \u0432\u0435\u0434\u044c HL \u043a\u0430\u043a-\u043d\u0438\u043a\u0430\u043a \u0430\u043d\u043e\u043d\u0438\u043c\u043d\u0430\u044f \u0441\u0435\u0442\u044c. \u041f\u0440\u043e\u0442\u0438\u0432\u043e\u0440\u0435\u0447\u0438\u0435\u043c \u0436\u0435 \u0437\u0434\u0435\u0441\u044c \u044f\u0432\u043b\u044f\u043b\u043e\u0441\u044c \u0442\u043e, \u0447\u0442\u043e \u0440\u0430\u0437 \u0441\u0435\u0442\u044c \u0441\u0442\u0440\u043e\u0438\u0442\u0441\u044f \u043d\u0430 \u043d\u0435\u0437\u0430\u0432\u0438\u0441\u0438\u043c\u044b\u0445 \u0434\u0440\u0443\u0433 \u043e\u0442 \u0434\u0440\u0443\u0433\u0430 \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432, \u0442\u043e \u0447\u0438\u0441\u0442\u043e \u0442\u0435\u0445\u043d\u0438\u0447\u0435\u0441\u043a\u0438 \u0438 \u0442\u0435\u043e\u0440\u0435\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0434\u043e\u043b\u0436\u043d\u0430 \u0431\u044b\u043b\u0430 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0438\u0437\u0431\u0430\u0432\u0438\u0442\u044c\u0441\u044f \u043e\u0442 \u0441\u0435\u0440\u0432\u0438\u0441\u0430 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0449\u0435\u0433\u043e \u0430\u043d\u043e\u043d\u0438\u043c\u043d\u043e\u0441\u0442\u044c. \u0418 \u0442\u0430\u043a\u043e\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u043d\u0430\u0448\u043b\u043e\u0441\u044c.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/a41\/fa9\/f26\/a41fa9f265b521953e5b70b504b51168.png\" width=\"3884\" height=\"1260\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/a41\/fa9\/f26\/a41fa9f265b521953e5b70b504b51168.png\"\/><\/figure>\n<h2>\u041f\u0430\u0440\u0430 \u0441\u043b\u043e\u0432 \u043e\u0431 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0445 \u0441\u0435\u0440\u0432\u0438\u0441\u0430\u0445<\/h2>\n<p>\u0411\u0443\u0434\u0443\u0449\u0438\u0439 \u043d\u0430\u043c\u0438 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u043c\u0435\u0441\u0441\u0435\u043d\u0434\u0436\u0435\u0440 \u0441\u043e \u0441\u043a\u0432\u043e\u0437\u043d\u044b\u043c \u0448\u0438\u0444\u0440\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u0431\u0443\u0434\u0435\u0442 \u043d\u0430\u043f\u0438\u0441\u0430\u043d \u043d\u0430 \u044f\u0437\u044b\u043a\u0435 Python \u0441 \u0442\u043e\u0439 \u043b\u0438\u0448\u044c \u0435\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0439 \u0446\u0435\u043b\u044c\u044e, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u043b\u044e\u0431\u044b\u0445 \u0443\u0434\u043e\u0431\u043d\u044b\u0445 \u0432\u0430\u043c\u0438 \u0442\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u0439 \u043f\u043e\u0432\u0435\u0440\u0445 \u0443\u0436\u0435 \u0433\u043e\u0442\u043e\u0432\u044b\u0445 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0439. <\/p>\n<p>\u0414\u0430\u043d\u043d\u044b\u0439 \u043c\u0435\u0441\u0441\u0435\u043d\u0434\u0436\u0435\u0440 \u0431\u0443\u0434\u0435\u0442 \u0437\u0430\u0432\u044f\u0437\u0430\u043d \u043d\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 \u0434\u0432\u0443\u0445 HL \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432: <strong>HLT<\/strong> (traffic) \u0438 <strong>HLE<\/strong> (encryptor). \u0412\u043a\u0440\u0430\u0442\u0446\u0435, HLT &#8212; \u044d\u0442\u043e \u0441\u0435\u0440\u0432\u0438\u0441-\u0440\u0435\u0442\u0440\u0430\u043d\u0441\u043b\u044f\u0442\u043e\u0440 \u0438 \u0441\u0435\u0440\u0432\u0438\u0441-\u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0435 \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0433\u043e \u0442\u0440\u0430\u0444\u0438\u043a\u0430. \u0411\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f \u0435\u043c\u0443 \u043c\u043e\u0436\u043d\u043e \u0432\u043e\u0441\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0442\u044c \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0443\u0436\u0435 \u0431\u044b\u043b\u0438 \u0437\u0430\u0431\u044b\u0442\u044b \u0441\u0435\u0442\u044c\u044e. \u042d\u0442\u043e \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e \u043d\u0430\u043c \u043a\u0430\u043a \u0440\u0430\u0437 \u0432 \u0431\u0443\u0434\u0443\u0449\u0435\u043c \u0438 \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u0441\u044f. \u041f\u043e\u0434\u0440\u043e\u0431\u043d\u043e \u043e HLT \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0447\u0438\u0442\u0430\u0442\u044c <a href=\"https:\/\/habr.com\/ru\/articles\/717184\/\" rel=\"noopener noreferrer nofollow\">\u0442\u0443\u0442<\/a> \u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/720544\/\" rel=\"noopener noreferrer nofollow\">\u0442\u0443\u0442<\/a>. <\/p>\n<p>\u0421\u0435\u0440\u0432\u0438\u0441 HLE \u0432 \u0441\u0432\u043e\u044e \u043e\u0447\u0435\u0440\u0435\u0434\u044c \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043e\u0447\u0435\u043d\u044c \u043f\u0440\u043e\u0441\u0442\u044b\u043c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435\u043c, \u043e\u043d \u0441\u043f\u043e\u0441\u043e\u0431\u0435\u043d \u0442\u043e\u043b\u044c\u043a\u043e \u0448\u0438\u0444\u0440\u043e\u0432\u0430\u0442\u044c \u0438 \u0440\u0430\u0441\u0448\u0438\u0444\u0440\u043e\u0432\u044b\u0432\u0430\u0442\u044c \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f \u0447\u0438\u0442\u0430\u0435\u043c\u044b\u0435 \u0441\u0435\u0442\u044c\u044e HL, \u043d\u0438 \u0431\u043e\u043b\u0435\u0435 \u043d\u0438 \u043c\u0435\u043d\u0435\u0435. \u041d\u043e \u043a\u0430\u043a \u0440\u0430\u0437 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0433\u043e \u0441\u0435\u0440\u0432\u0438\u0441\u0430 \u0438 \u043d\u0435 \u0445\u0432\u0430\u0442\u0430\u043b\u043e \u0434\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u043f\u0438\u0441\u0430\u0442\u044c \u0438\u0441\u043a\u043b\u044e\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043a\u043b\u0438\u0435\u043d\u0442-\u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u044b\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0431\u0435\u0437 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430 \u0430\u043d\u043e\u043d\u0438\u043c\u043d\u043e\u0441\u0442\u0438, \u043b\u0438\u0431\u043e \u0431\u043e\u043b\u0435\u0435 \u0433\u0438\u0431\u043a\u0438\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u0441 \u0434\u0440\u0443\u0433\u0438\u043c \u0434\u043e\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c\u0441\u0442\u0432\u043e\u043c \u0430\u043d\u043e\u043d\u0438\u043c\u043d\u043e\u0441\u0442\u0438.<\/p>\n<h2>\u0420\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f<\/h2>\n<h3>1. \u041a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044f<\/h3>\n<p>\u041f\u0435\u0440\u0432\u043e\u0435 \u0441 \u0447\u0435\u0433\u043e \u043c\u044b \u043d\u0430\u0447\u043d\u0451\u043c &#8212; \u044d\u0442\u043e \u0441 \u0444\u0430\u0439\u043b\u0430 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438. \u0412 \u043d\u0451\u043c \u0434\u043e\u043b\u0436\u043d\u043e \u0431\u044b\u0442\u044c \u0442\u0440\u0438 \u043f\u043e\u043b\u044f: <strong>hlt_host<\/strong>, <strong>hle_host<\/strong> \u0438 <strong>friends<\/strong>. \u041f\u0435\u0440\u0432\u044b\u0435 \u0434\u0432\u0430 \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u044e\u0442 \u043d\u0430 \u0430\u0434\u0440\u0435\u0441\u0430 \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432 HLT \u0438 HLE \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e. \u0421\u0435\u0440\u0432\u0438\u0441 HLT \u043c\u043e\u0436\u0435\u0442 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u044c\u0441\u044f \u0432 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u043e\u0439 \u0441\u0435\u0442\u0438, \u0432 \u0442\u043e \u0432\u0440\u0435\u043c\u044f \u043a\u0430\u043a HLE \u043e\u0431\u044f\u0437\u0430\u043d \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u044c\u0441\u044f \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e \u043d\u0430 \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\u0435. \u0421\u0443\u0442\u044c \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e HLE \u043e\u0431\u0440\u0430\u0449\u0430\u0435\u0442\u0441\u044f \u043a \u043f\u0440\u0438\u0432\u0430\u0442\u043d\u043e\u043c\u0443 \u043a\u043b\u044e\u0447\u0443, \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u043c\u0443 \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\u0443 \u0432 \u0441\u0435\u0442\u0438. \u0415\u0433\u043e \u043f\u043e\u0442\u0435\u0440\u044f \u0432\u0435\u0434\u0451\u0442 \u043d\u0435\u043c\u0438\u043d\u0443\u0435\u043c\u043e \u043a \u043a\u043e\u043c\u043f\u0440\u043e\u043c\u0435\u0442\u0430\u0446\u0438\u0438 \u0441\u0432\u044f\u0437\u0438. <\/p>\n<p>\u041f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0435 \u043f\u043e\u043b\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0441\u043e\u0431\u043e\u0439 \u043c\u0430\u043f\u0443 (\u0441\u043b\u043e\u0432\u0430\u0440\u044c) \u043f\u043e \u0442\u0438\u043f\u0443 <strong>\u0438\u043c\u044f:\u043f\u0443\u0431\u043b\u0438\u0447\u043d\u044b\u0439_\u043a\u043b\u044e\u0447<\/strong>. \u0421\u0443\u0449\u0435\u0441\u0442\u0432\u043e\u0432\u0430\u043d\u0438\u0435 \u0434\u0440\u0443\u0437\u0435\u0439 \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u0442 \u043d\u0430\u0441 \u043a \u0441\u0435\u0442\u0438 \u0442\u0438\u043f\u0430 <strong>friend-to-friend<\/strong>, \u043a\u043e\u0433\u0434\u0430 \u0443\u0447\u0430\u0441\u0442\u043d\u0438\u043a\u0438 \u043a\u043e\u043c\u043c\u0443\u043d\u0438\u043a\u0430\u0446\u0438\u0438 \u0437\u0430\u0440\u0430\u043d\u0435\u0435 \u0432\u044b\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0442 \u0441 \u043a\u0435\u043c \u043e\u043d\u0438 \u043c\u043e\u0433\u0443\u0442 \u043e\u0431\u0449\u0430\u0442\u044c\u0441\u044f \u0438 \u043e\u0442 \u043a\u043e\u0433\u043e \u043c\u043e\u0433\u0443\u0442 \u043f\u043e\u043b\u0443\u0447\u0430\u0442\u044c \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f. \u0422\u0430\u043a\u043e\u0435 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0438\u0437\u0431\u0430\u0432\u043b\u044f\u0442\u044c\u0441\u044f \u043e\u0442 \u0441\u043f\u0430\u043c\u0430 \u0441\u043e \u0441\u0442\u043e\u0440\u043e\u043d\u044b \u0434\u0440\u0443\u0433\u0438\u0445 \u0443\u0447\u0430\u0441\u0442\u043d\u0438\u043a\u043e\u0432 \u0441\u0435\u0442\u0438, \u0430 \u0442\u0430\u043a\u0436\u0435 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0431\u043e\u043b\u0435\u0435 \u043b\u0435\u0433\u043a\u043e \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u0446\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0430\u0431\u043e\u043d\u0435\u043d\u0442\u043e\u0432 \u043f\u043e \u0441\u0430\u043c\u043e\u0441\u0442\u043e\u044f\u0442\u0435\u043b\u044c\u043d\u043e \u0432\u044b\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u043d\u043e\u043c\u0443 \u0438\u043c\u0435\u043d\u0438.<\/p>\n<p>\u0418\u0442\u043e\u0433\u043e, \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0439 \u0444\u0430\u0439\u043b:<\/p>\n<pre><code class=\"yaml\">hlt_host: localhost:9582 hle_host: localhost:9551 friends:    Alice: PubKey{3082020A02820201...3324D10203010001}<\/code><\/pre>\n<p>\u0415\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0435 \u0437\u0434\u0435\u0441\u044c \u043d\u0435\u0438\u0437\u0432\u0435\u0441\u0442\u043d\u043e\u0435 \u0434\u043b\u044f \u043d\u0430\u0441 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 &#8212; \u044d\u0442\u043e \u0441\u0430\u043c \u043f\u0443\u0431\u043b\u0438\u0447\u043d\u044b\u0439 \u043a\u043b\u044e\u0447, \u0430 \u0438\u043c\u0435\u043d\u043d\u043e \u0441\u043f\u043e\u0441\u043e\u0431 \u0435\u0433\u043e \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f. \u041c\u044b \u0434\u043e\u043b\u0436\u043d\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0439 \u043a\u043b\u044e\u0447 \u043e\u0442 \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u0430\u0433\u0430\u0435\u043c\u043e\u0433\u043e \u0430\u0431\u043e\u043d\u0435\u043d\u0442\u0430, \u043d\u043e \u043a\u0430\u043a \u043e\u043d \u0434\u043e\u043b\u0436\u0435\u043d \u0435\u0433\u043e \u0434\u043e\u0431\u044b\u0442\u044c? \u0417\u0434\u0435\u0441\u044c \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u0434\u0432\u0430 \u0441\u043f\u043e\u0441\u043e\u0431\u0430: <\/p>\n<ol>\n<li>\n<p>\u041f\u0440\u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0435 HLE, \u0435\u0441\u043b\u0438 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0439 \u043d\u0435 \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0438\u0442 \u043d\u0430\u043b\u0438\u0447\u0438\u0435 \u043f\u0440\u0438\u0432\u0430\u0442\u043d\u043e\u0433\u043e \u043a\u043b\u044e\u0447\u0430, \u0442\u043e \u043e\u043d \u0441\u0430\u043c \u0435\u0433\u043e <strong>\u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u0442<\/strong> \u0438 \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442 \u0432 \u0441\u0432\u043e\u0451 \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0435\u0435 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435. \u0412\u0441\u0451 \u0447\u0442\u043e \u043e\u0441\u0442\u0430\u0451\u0442\u0441\u044f &#8212; \u044d\u0442\u043e \u0437\u0430\u043f\u0440\u043e\u0441\u0438\u0442\u044c \u0443 HLE \u043f\u0443\u0431\u043b\u0438\u0447\u043d\u044b\u0439 \u043a\u043b\u044e\u0447 \u043f\u043e \u0435\u0433\u043e <strong>API<\/strong>.<\/p>\n<p><code>curl -i -X GET -H 'Accept: application\/json' http:\/\/localhost:9551\/api\/service\/pubkey<\/code><\/p>\n<\/li>\n<li>\n<p>\u041c\u043e\u0436\u043d\u043e \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u0430\u0440\u0443 \u043f\u0440\u0438\u0432\u0430\u0442\u043d\u044b\u0439 \/ \u043f\u0443\u0431\u043b\u0438\u0447\u043d\u044b\u0439 \u043a\u043b\u044e\u0447 \u0441\u0430\u043c\u043e\u0441\u0442\u043e\u044f\u0442\u0435\u043b\u044c\u043d\u043e, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 <a href=\"https:\/\/github.com\/number571\/go-peer\/tree\/master\/cmd\/tools\/keygen\" rel=\"noopener noreferrer nofollow\">cmd\/tools\/keygen<\/a> \u0438\u0437 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u044f <strong>go-peer<\/strong>. \u0412 \u0442\u0430\u043a\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u043e\u043f\u0438\u0441\u0430\u0442\u044c \u043b\u0438\u0448\u044c \u0434\u043b\u0438\u043d\u0443 RSA \u043a\u043b\u044e\u0447\u0430. \u0414\u043b\u0438\u043d\u0430 \u043a\u043b\u044e\u0447\u0430 \u0432 \u0441\u0435\u0442\u0438 HL \u0440\u0430\u0432\u043d\u0430 4096 \u0431\u0438\u0442. \u041f\u043e\u0441\u043b\u0435 \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u0431\u0443\u0434\u0435\u0442 \u0441\u043e\u0437\u0434\u0430\u043d\u043e \u0434\u0432\u0430 \u0444\u0430\u0439\u043b\u0430 <strong>priv.key<\/strong> \u0438 <strong>pub.key<\/strong>. \u041f\u0435\u0440\u0432\u044b\u0439 \u043a\u043b\u044e\u0447 \u043f\u043e\u0434\u0430\u0451\u043c \u043d\u0430 \u0432\u0445\u043e\u0434 HLE, \u0430 \u0432\u0442\u043e\u0440\u043e\u0439 \u0440\u0430\u0437\u0433\u043b\u0430\u0448\u0430\u0435\u043c \u0441\u0432\u043e\u0435\u043c\u0443 \u0441\u043e\u0431\u0435\u0441\u0435\u0434\u043d\u0438\u043a\u0443. <\/p>\n<p><code>go run . 4096<\/code> <\/p>\n<\/li>\n<\/ol>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c, \u0432\u0441\u0451 \u0447\u0442\u043e \u043d\u0430\u043c \u043e\u0441\u0442\u0430\u0451\u0442\u0441\u044f &#8212; \u044d\u0442\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u043d\u0430 \u043f\u0438\u0442\u043e\u043d\u0435 \u0447\u0442\u0435\u043d\u0438\u0435 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u043e\u0433\u043e \u0444\u0430\u0439\u043b\u0430. \u0414\u043b\u044f \u043f\u0440\u043e\u0441\u0442\u043e\u0442\u044b \u044f \u0432\u044b\u043d\u0435\u0441 \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u043d\u043d\u044b\u0435 \u043f\u043e\u043b\u044f \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u0432 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435. \u041f\u043e\u0441\u043b\u0435 \u043f\u0440\u043e\u0447\u0442\u0435\u043d\u0438\u044f, \u044d\u0442\u0438 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0441\u0447\u0438\u0442\u0430\u044e\u0442\u0441\u044f \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043e\u0439. \u0421\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e, \u043a \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u043c\u0443 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044e \u0433\u043e\u043d\u043a\u0438 \u0434\u0430\u043d\u043d\u044b\u0439 \u043f\u043e\u0434\u0445\u043e\u0434 \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u0442\u044c \u043d\u0435 \u0431\u0443\u0434\u0435\u0442.  <\/p>\n<pre><code class=\"python\">import yaml  HLE_URL = \"\" # it is being overwritten HLT_URL = \"\" # it is being overwritten FRIENDS = {} # it is being overwritten  def init_load_config(cfg_path):     global HLE_URL, HLT_URL, FRIENDS      with open(cfg_path, \"r\") as stream:         try:             config_loaded = yaml.safe_load(stream)         except yaml.YAMLError as e:             print(\"@ failed load config\")             exit(3)          HLT_URL = \"http:\/\/\" + config_loaded[\"hlt_host\"]     HLE_URL = \"http:\/\/\" + config_loaded[\"hle_host\"]     FRIENDS = config_loaded[\"friends\"]  ...<\/code><\/pre>\n<h3>2. \u0427\u0442\u0435\u043d\u0438\u0435 \u0432\u0432\u043e\u0434\u0430<\/h3>\n<p>\u041c\u0435\u0441\u0441\u0435\u043d\u0434\u0436\u0435\u0440 \u0431\u0443\u0434\u0435\u0442 \u0441\u043e\u0441\u0442\u043e\u044f\u0442\u044c \u0438\u0437 \u0434\u0432\u0443\u0445 \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u044b\u0445 \u043f\u0440\u043e\u0446\u0435\u0434\u0443\u0440: <strong>input_task<\/strong> \u0438 <strong>output_task<\/strong>. \u041f\u0435\u0440\u0432\u0430\u044f \u043f\u0440\u043e\u0446\u0435\u0434\u0443\u0440\u0430 \u0441\u0432\u043e\u0434\u0438\u0442\u0441\u044f \u043a \u0432\u0432\u043e\u0434\u0443 \u0434\u0430\u043d\u043d\u044b\u0445 \/ \u043a\u043e\u043c\u0430\u043d\u0434 \u043e\u0442 \u0441\u0430\u043c\u043e\u0433\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f. \u041a\u043e\u043c\u0430\u043d\u0434\u0430 \u0431\u0443\u0434\u0435\u0442 \u0432\u0441\u0435\u0433\u043e \u043e\u0434\u043d\u0430: <strong>\/friend<\/strong>. \u041e\u043d\u0430 \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u0442 \u0434\u0440\u0443\u0433\u0430 \u043a\u043e\u0442\u043e\u0440\u043e\u043c\u0443 \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f. \u0412\u0442\u043e\u0440\u0430\u044f \u043f\u0440\u043e\u0446\u0435\u0434\u0443\u0440\u0430 \u0441\u0432\u043e\u0434\u0438\u0442\u0441\u044f \u043a \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044e \u0434\u0430\u043d\u043d\u044b\u0445 \u0438\u0437 \u0441\u0435\u0442\u0438 \u0438 \u043a \u0438\u0445 \u0432\u044b\u0432\u043e\u0434\u0443.<\/p>\n<pre><code class=\"python\">...  import multiprocessing  ...  def main():     init_load_config(\"config.yml\")     parallel_run(input_task, output_task)  def parallel_run(*fns):     proc = []     for fn in fns:         p = multiprocessing.Process(target=fn)         p.start()         proc.append(p)     for p in proc:         p.join()  ...  if __name__ == \"__main__\":     main() <\/code><\/pre>\n<p>\u0421\u0430\u043c \u043a\u043e\u0434 \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0441\u044f \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u044b\u043c. \u0415\u0441\u0442\u044c \u0437\u0434\u0435\u0441\u044c \u043b\u0438\u0448\u044c \u043e\u0434\u0438\u043d \u043c\u043e\u043c\u0435\u043d\u0442, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0441\u0442\u043e\u0438\u0442 \u043f\u0440\u043e\u044f\u0441\u043d\u0438\u0442\u044c, \u0430 \u0438\u043c\u0435\u043d\u043d\u043e <code>sys.stdin = open(0)<\/code>. \u041f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u0430\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u043f\u0440\u043e\u0446\u0435\u0434\u0443\u0440 \u0441\u0432\u043e\u0434\u0438\u0442\u0441\u044f \u043a \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044e \u043c\u043e\u0434\u0443\u043b\u044f multiprocessing, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432 \u0441\u0432\u043e\u044e \u043e\u0447\u0435\u0440\u0435\u0434\u044c \u043d\u0435 \u043f\u0440\u043e\u0442\u0430\u043b\u043a\u0438\u0432\u0430\u0435\u0442 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0439 \u043f\u043e\u0442\u043e\u043a \u0432\u0432\u043e\u0434\u0430 \u0434\u0430\u043b\u044c\u0448\u0435 \u0432 \u043a\u043b\u0430\u0441\u0441 Proccess. \u0412\u0441\u043b\u0435\u0434\u0441\u0442\u0432\u0438\u0435 \u044d\u0442\u043e\u0433\u043e, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u044f\u0432\u043d\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0439 \u043f\u043e\u0442\u043e\u043a (0) \u0432 \u0441\u0430\u043c\u043e\u0439 \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u043e\u0439 \u043f\u0440\u043e\u0446\u0435\u0434\u0443\u0440\u0435. \u0411\u0435\u0437 \u044d\u0442\u043e\u0439 \u0447\u0430\u0441\u0442\u0438 \u043a\u043e\u0434\u0430 input \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u0442\u044c \u043a \u043e\u0448\u0438\u0431\u043a\u0430\u043c <code>EOFError: EOF when reading a line<\/code>. \u0411\u043e\u043b\u0435\u0435 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e \u043f\u0440\u043e \u044d\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0447\u0438\u0442\u0430\u0442\u044c <a href=\"https:\/\/stackoverflow.com\/questions\/63893634\/how-to-use-multiprocessing-with-input-function-and-avoid-eoferror-eof-when-r\" rel=\"noopener noreferrer nofollow\">\u0442\u0443\u0442<\/a>.<\/p>\n<pre><code class=\"python\">...  import sys  def input_task():     friend = \"\"      sys.stdin = open(0)     while True:         msg = input(\"> \")         if len(msg) == 0:             print(\"@ got null message\")             continue          if msg.startswith(\"\/friend \"):             try:                 _friend = FRIENDS[msg[len(\"\/friend \"):].strip()]             except KeyError:                 print(\"@ got invalid friend name\")                 continue             friend = _friend             continue          if friend == \"\":             print(\"@ friend is null, use \/friend to set\")             continue           ...<\/code><\/pre>\n<p>\u0414\u0430\u043b\u0435\u0435, \u043a\u0430\u043a \u0442\u043e\u043b\u044c\u043a\u043e \u0443 \u043d\u0430\u0441 \u0443\u0436\u0435 \u0435\u0441\u0442\u044c \u043f\u0443\u0431\u043b\u0438\u0447\u043d\u044b\u0439 \u043a\u043b\u044e\u0447 \u0434\u0440\u0443\u0433\u0430 \u0438 \u0441\u0430\u043c\u043e \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043c\u044b \u043f\u043b\u0430\u043d\u0438\u0440\u0443\u0435\u043c \u043e\u0442\u043f\u0440\u0430\u0432\u0438\u0442\u044c, \u043c\u044b \u0434\u043e\u043b\u0436\u043d\u044b \u043e\u0431\u0440\u0430\u0442\u0438\u0442\u044c\u0441\u044f \u043a API \u0441\u043d\u0430\u0447\u0430\u043b\u0430 HLE, \u0447\u0442\u043e\u0431\u044b \u0437\u0430\u0448\u0438\u0444\u0440\u043e\u0432\u0430\u0442\u044c \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435, \u0430 \u0434\u0430\u043b\u0435\u0435 \u043a API HLT, \u0447\u0442\u043e\u0431\u044b \u043e\u0442\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u043f\u043e\u043b\u0443\u0447\u0438\u0432\u0448\u0438\u0439\u0441\u044f \u0448\u0438\u0444\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0432 \u0441\u0435\u0442\u044c.<\/p>\n<pre><code class=\"python\">        ...                resp_hle = requests.post(             HLE_URL+\"\/api\/message\/encrypt\",              json={\"public_key\": friend, \"hex_data\": msg.encode(\"utf-8\").hex()}         )         if resp_hle.status_code != 200:             print(\"@ got response error from HLE (\/api\/message\/encrypt)\")             continue                   resp_hlt = requests.post(             HLT_URL+\"\/api\/network\/message\",              data=resp_hle.content         )         if resp_hlt.status_code != 200:             print(\"@ got response error from HLT (\/api\/network\/message)\")             continue     ...<\/code><\/pre>\n<p>\u0411\u043e\u043b\u0435\u0435 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e \u0441 API HLE \u0438 HLT \u043c\u043e\u0436\u043d\u043e \u043e\u0437\u043d\u0430\u043a\u043e\u043c\u0438\u0442\u044c\u0441\u044f \u0432 \u0438\u0445 README <a href=\"https:\/\/github.com\/number571\/go-peer\/tree\/master\/cmd\/hidden_lake\/helpers\/encryptor\" rel=\"noopener noreferrer nofollow\">\u0442\u0443\u0442<\/a> \u0438 <a href=\"https:\/\/github.com\/number571\/go-peer\/tree\/master\/cmd\/hidden_lake\/traffic\" rel=\"noopener noreferrer nofollow\">\u0437\u0434\u0435\u0441\u044c<\/a>. <\/p>\n<h3>3. \u0427\u0442\u0435\u043d\u0438\u0435 \u0438\u0437 \u0441\u0435\u0442\u0438<\/h3>\n<p>\u0427\u0442\u0435\u043d\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 \u0438\u0437 \u0441\u0435\u0442\u0438 \u0443\u0436\u0435 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0431\u043e\u043b\u0435\u0435 \u0441\u043b\u043e\u0436\u043d\u043e\u0439 \u0437\u0430\u0434\u0430\u0447\u0435\u0439, \u0447\u0435\u043c \u043e\u0431\u044b\u0447\u043d\u044b\u0439 \u0432\u0432\u043e\u0434, \u043d\u043e \u043d\u0435 \u0447\u0435\u043c-\u0442\u043e \u0441\u0432\u0435\u0440\u0445\u044a\u0435\u0441\u0442\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u043c. \u041f\u0440\u043e\u0441\u0442\u043e \u043d\u0430\u0434\u043e \u0431\u0443\u0434\u0435\u0442 \u0447\u0430\u0449\u0435 \u043e\u0431\u0440\u0430\u0449\u0430\u0442\u044c\u0441\u044f \u043a API HLT. <\/p>\n<p>\u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u043d\u0430\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043e\u0442 HLT \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0443 \u0442\u043e\u0433\u043e, \u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0441\u0430\u043c HLT \u0441\u0435\u0440\u0432\u0438\u0441 \u0441\u043f\u043e\u0441\u043e\u0431\u0435\u043d \u0445\u0440\u0430\u043d\u0438\u0442\u044c \u043d\u0430 \u0441\u0432\u043e\u0435\u0439 \u0441\u0442\u043e\u0440\u043e\u043d\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439 (<strong>messages_capacity<\/strong>). \u0422.\u043a. \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e HLT \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0442 \u0441\u043e\u0431\u043e\u0439 \u0434\u0435\u0446\u0435\u043d\u0442\u0440\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u0443\u044e \u0441\u0435\u0442\u044c, \u0442\u043e \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u043c\u043e\u0433\u0443\u0442 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0440\u0430\u0437\u043b\u0438\u0447\u0430\u0442\u044c\u0441\u044f. \u041a\u0442\u043e-\u0442\u043e \u043c\u043e\u0436\u0435\u0442 \u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0442\u044b\u0441\u044f\u0447\u0438 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439, \u0430 \u043a\u0442\u043e-\u0442\u043e \u043c\u0438\u043b\u043b\u0438\u043e\u043d. \u041f\u043e\u0441\u043b\u0435 \u043f\u0440\u0435\u0432\u044b\u0448\u0435\u043d\u0438\u044f \u0437\u0430\u0434\u0430\u043d\u043d\u043e\u0433\u043e \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430, \u0441\u0435\u0440\u0432\u0438\u0441 HLT \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442 \u043f\u0435\u0440\u0435\u0437\u0430\u0442\u0438\u0440\u0430\u0442\u044c \u0441\u0442\u0430\u0440\u044b\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f \u043d\u043e\u0432\u044b\u043c\u0438.  <\/p>\n<pre><code class=\"python\">...  import requests, json  def output_task():     # GET SETTING = MESSAGES_CAPACITY     resp_hlt = requests.get(         HLT_URL+\"\/api\/config\/settings\"     )     if resp_hlt.status_code != 200:         print(\"@ got response error from HLT (\/api\/config\/settings)\")         exit(1)          try:         messages_capacity = json.loads(resp_hlt.content)[\"messages_capacity\"]     except ValueError:         print(\"@ got response invalid data from HLT (\/api\/config\/settings)\")         exit(2)          ...<\/code><\/pre>\n<p>\u041f\u043e\u0441\u043b\u0435 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u044f, \u043d\u0430\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0432\u044b\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0442\u0435\u043a\u0443\u0449\u0438\u0439 <strong>\u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c<\/strong> (\u0432 \u0442\u0435\u0440\u043c\u0438\u043d\u043e\u043b\u043e\u0433\u0438\u0438 HL) \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0441\u0430\u043c HLT. \u0423\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c &#8212; \u044d\u0442\u043e \u0438\u043d\u0434\u0435\u043a\u0441 \u043f\u043e \u043c\u0430\u0441\u0441\u0438\u0432\u0443 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0442\u043e\u043b\u044c\u043a\u043e \u0443\u0432\u0435\u043b\u0438\u0447\u0438\u0432\u0430\u0435\u0442\u0441\u044f, \u043d\u043e \u0432 \u043a\u043e\u043b\u044c\u0446\u0435. \u0418\u043d\u044b\u043c\u0438 \u0441\u043b\u043e\u0432\u0430\u043c\u0438, \u0434\u043e\u0441\u0442\u0438\u0433\u0430\u044f messages_capacity, \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u0431\u0443\u0434\u0435\u0442 \u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c\u0441\u044f \u0432\u043d\u043e\u0432\u044c \u043d\u0443\u043b\u0435\u0432\u044b\u043c. \u041f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u043e\u0435 \u0438\u043d\u043a\u0440\u0435\u043c\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0444\u043e\u0440\u043c\u0443\u043b\u043e\u0439: <em>(i + 1) mod messages_capacity<\/em>.<\/p>\n<p>\u041f\u043e\u0441\u043b\u0435 \u0432\u044b\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f, \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0442\u044c \u043d\u0435 \u0441\u043c\u0435\u0441\u0442\u0438\u043b\u0441\u044f \u043b\u0438 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u043e\u0439 \u043d\u0430\u043c\u0438 \u0440\u0430\u043d\u0435\u0435 \u043f\u043e\u0437\u0438\u0446\u0438\u0438. \u0415\u0441\u043b\u0438 \u0441\u043c\u0435\u0441\u0442\u0438\u043b\u0441\u044f, \u0442\u043e \u043d\u0443\u0436\u043d\u043e \u0441\u0430\u043c\u043e\u0441\u0442\u043e\u044f\u0442\u0435\u043b\u044c\u043d\u043e \u0438\u043d\u043a\u0440\u0435\u043c\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u0434\u043e \u0442\u0435\u0445 \u043f\u043e\u0440, \u043f\u043e\u043a\u0430 \u043e\u043d \u043d\u0435 \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0432\u0435\u043d \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u043e\u043c\u0443. \u042d\u0442\u043e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0441 \u0442\u043e\u0439 \u043b\u0438\u0448\u044c \u0446\u0435\u043b\u044c\u044e, \u0447\u0442\u043e\u0431\u044b \u043f\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044e \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0445\u0435\u0448 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f, \u0430 \u0434\u0430\u043b\u0435\u0435 \u0438 \u0441\u0430\u043c\u043e \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435. \u0415\u0441\u043b\u0438 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u043d\u0435 \u0441\u043c\u0435\u0449\u0430\u0435\u0442\u0441\u044f, \u0442\u043e\u0433\u0434\u0430 \u043d\u0443\u0436\u043d\u043e \u0432\u044b\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u043b\u0438\u043c\u0438\u0442 \u043e\u0436\u0438\u0434\u0430\u043d\u0438\u044f \u043f\u0435\u0440\u0435\u0434 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u043c. \u0422\u0430\u043a\u043e\u0439 \u043b\u0438\u043c\u0438\u0442 \u043c\u043e\u0436\u043d\u043e \u0432\u044b\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0432 \u043e\u0434\u043d\u0443 \u0441\u0435\u043a\u0443\u043d\u0434\u0443.<\/p>\n<pre><code class=\"python\">import time   ...     ...        global_pointer = -1     while True:         # GET INITIAL POINTER OF MESSAGES         resp_hlt = requests.get(             HLT_URL+\"\/api\/storage\/pointer\"         )         if resp_hlt.status_code != 200:             print(\"@ got response error from HLT (\/api\/storage\/pointer)\")             time.sleep(1)             continue           try:             pointer = int(resp_hlt.content)         except ValueError:             print(\"@ got response invalid data from HLT (\/api\/storage\/pointer)\")             time.sleep(1)             continue          if global_pointer == -1:             global_pointer = pointer          if global_pointer == pointer:             time.sleep(1)             continue              # GET ALL MESSAGES FROM CURRENT POINTER TO GOT POINTER         while global_pointer != pointer:             global_pointer = (global_pointer + 1) % messages_capacity              ...<\/code><\/pre>\n<p>\u041d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u043b\u043e\u0433\u0438\u043a\u0438 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u0435\u0439 \u043c\u044b \u043f\u0438\u0448\u0435\u043c \u0444\u0438\u043d\u0430\u043b\u044c\u043d\u0443\u044e \u043b\u043e\u0433\u0438\u043a\u0443 &#8212; \u043b\u043e\u0433\u0438\u043a\u0443 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0438 \u0440\u0430\u0441\u0448\u0438\u0444\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f. \u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u043f\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044e \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0445\u0435\u0448 \u043e\u0442 HLT, \u0434\u0430\u043b\u0435\u0435 \u043f\u043e \u0445\u0435\u0448\u0443 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u0442\u0430\u043a\u0436\u0435 \u043e\u0442 HLT, \u043f\u0435\u0440\u0435\u0434\u0430\u0451\u043c \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u043e\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u043d\u0430 HLE \u0434\u043b\u044f \u0440\u0430\u0441\u0448\u0438\u0444\u0440\u043e\u0432\u0430\u043d\u0438\u044f.<\/p>\n<p>\u041f\u043e\u0441\u043b\u0435 \u0440\u0430\u0441\u0448\u0438\u0444\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043d\u0430\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u043f\u0443\u0431\u043b\u0438\u0447\u043d\u044b\u0439 \u043a\u043b\u044e\u0447 \u043e\u0442\u043f\u0440\u0430\u0432\u0438\u0442\u0435\u043b\u044f. \u0415\u0441\u043b\u0438 \u043e\u0442\u043f\u0440\u0430\u0432\u0438\u0442\u0435\u043b\u044c \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0432 \u043d\u0430\u0448\u0435\u043c \u0441\u043f\u0438\u0441\u043a\u0435 \u0434\u0440\u0443\u0437\u0435\u0439, \u0442\u043e\u0433\u0434\u0430 \u043f\u0435\u0447\u0430\u0442\u0430\u0435\u043c \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u043e\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435, \u0438\u043d\u0430\u0447\u0435 \u0438\u0433\u043d\u043e\u0440\u0438\u0440\u0443\u0435\u043c. <\/p>\n<pre><code class=\"python\">import hashlib   ...             ...                resp_hlt = requests.get(                 HLT_URL+\"\/api\/storage\/hashes?id=\"+f\"{(global_pointer - 1) % messages_capacity}\"             )             if resp_hlt.status_code != 200:                 break                           resp_hlt = requests.get(                 HLT_URL+\"\/api\/network\/message?hash=\"+resp_hlt.content.decode(\"utf8\")             )             if resp_hlt.status_code != 200:                 break               # TRY DECRYPT GOT MESSAGE             resp_hle = requests.post(                 HLE_URL+\"\/api\/message\/decrypt\",                  data=resp_hlt.content             )             if resp_hle.status_code != 200:                 continue               try:                 json_resp = json.loads(resp_hle.content)             except ValueError:                 print(\"@ got response invalid data from HLE (\/api\/message\/decrypt)\")                 continue                      # CHECK GOT PUBLIC KEY IN FRIENDS LIST             user_id = hashlib.sha256(json_resp[\"public_key\"].encode('utf-8')).hexdigest()             friend_name = get_friend_name(user_id)             if friend_name == \"\":                 continue               got_data = bytes.fromhex(json_resp[\"hex_data\"]).decode('utf-8')             print(f\"[{friend_name}]: {got_data}\\n> \", end=\"\")  def get_friend_name(user_id):   for k, v in FRIENDS.items():       friend_id = hashlib.sha256(v.encode('utf-8')).hexdigest()       if user_id == friend_id:           return k   return \"\"  ...<\/code><\/pre>\n<p>\u0418 \u044d\u0442\u043e \u0432\u0441\u0451. \u0418\u0442\u043e\u0433\u043e\u0432\u0430\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0430\u0441\u044c \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0432 <strong>160 \u0441\u0442\u0440\u043e\u043a<\/strong> \u043a\u043e\u0434\u0430.  <\/p>\n<details class=\"spoiler\">\n<summary>\u041f\u043e\u043b\u043d\u044b\u0439 \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"python\">import multiprocessing, sys, requests, time, json, hashlib, yaml  HLE_URL = \"\" # it is being overwritten HLT_URL = \"\" # it is being overwritten FRIENDS = {} # it is being overwritten  def main():     init_load_config(\"config.yml\")     parallel_run(input_task, output_task)  def init_load_config(cfg_path):     global HLE_URL, HLT_URL, FRIENDS      with open(cfg_path, \"r\") as stream:         try:             config_loaded = yaml.safe_load(stream)         except yaml.YAMLError as e:             print(\"@ failed load config\")             exit(3)          HLT_URL = \"http:\/\/\" + config_loaded[\"hlt_host\"]     HLE_URL = \"http:\/\/\" + config_loaded[\"hle_host\"]     FRIENDS = config_loaded[\"friends\"]  def parallel_run(*fns):     proc = []     for fn in fns:         p = multiprocessing.Process(target=fn)         p.start()         proc.append(p)     for p in proc:         p.join()  def output_task():     # GET SETTING = MESSAGES_CAPACITY     resp_hlt = requests.get(         HLT_URL+\"\/api\/config\/settings\"     )     if resp_hlt.status_code != 200:         print(\"@ got response error from HLT (\/api\/config\/settings)\")         exit(1)          try:         messages_capacity = json.loads(resp_hlt.content)[\"messages_capacity\"]     except ValueError:         print(\"@ got response invalid data from HLT (\/api\/config\/settings)\")         exit(2)          global_pointer = -1     while True:         # GET INITIAL POINTER OF MESSAGES         resp_hlt = requests.get(             HLT_URL+\"\/api\/storage\/pointer\"         )         if resp_hlt.status_code != 200:             print(\"@ got response error from HLT (\/api\/storage\/pointer)\")             time.sleep(1)             continue           try:             pointer = int(resp_hlt.content)         except ValueError:             print(\"@ got response invalid data from HLT (\/api\/storage\/pointer)\")             time.sleep(1)             continue          if global_pointer == -1:             global_pointer = pointer          if global_pointer == pointer:             time.sleep(1)             continue              # GET ALL MESSAGES FROM CURRENT POINTER TO GOT POINTER         while global_pointer != pointer:             global_pointer = (global_pointer + 1) % messages_capacity              resp_hlt = requests.get(                 HLT_URL+\"\/api\/storage\/hashes?id=\"+f\"{(global_pointer - 1) % messages_capacity}\"             )             if resp_hlt.status_code != 200:                 break                           resp_hlt = requests.get(                 HLT_URL+\"\/api\/network\/message?hash=\"+resp_hlt.content.decode(\"utf8\")             )             if resp_hlt.status_code != 200:                 break               # TRY DECRYPT GOT MESSAGE             resp_hle = requests.post(                 HLE_URL+\"\/api\/message\/decrypt\",                  data=resp_hlt.content             )             if resp_hle.status_code != 200:                 continue               try:                 json_resp = json.loads(resp_hle.content)             except ValueError:                 print(\"@ got response invalid data from HLE (\/api\/message\/decrypt)\")                 continue                      # CHECK GOT PUBLIC KEY IN FRIENDS LIST             user_id = hashlib.sha256(json_resp[\"public_key\"].encode('utf-8')).hexdigest()             friend_name = get_friend_name(user_id)             if friend_name == \"\":                 continue               got_data = bytes.fromhex(json_resp[\"hex_data\"]).decode('utf-8')             print(f\"[{friend_name}]: {got_data}\\n> \", end=\"\")  def input_task():     friend = \"\"      sys.stdin = open(0)     while True:         msg = input(\"> \")         if len(msg) == 0:             print(\"@ got null message\")             continue          if msg.startswith(\"\/friend \"):             try:                 _friend = FRIENDS[msg[len(\"\/friend \"):].strip()]             except KeyError:                 print(\"@ got invalid friend name\")                 continue             friend = _friend             continue          if friend == \"\":             print(\"@ friend is null, use \/friend to set\")             continue           resp_hle = requests.post(             HLE_URL+\"\/api\/message\/encrypt\",              json={\"public_key\": friend, \"hex_data\": msg.encode(\"utf-8\").hex()}         )         if resp_hle.status_code != 200:             print(\"@ got response error from HLE (\/api\/message\/encrypt)\")             continue                   resp_hlt = requests.post(             HLT_URL+\"\/api\/network\/message\",              data=resp_hle.content         )         if resp_hlt.status_code != 200:             print(\"@ got response error from HLT (\/api\/network\/message)\")             continue   def get_friend_name(user_id):     for k, v in FRIENDS.items():         friend_id = hashlib.sha256(v.encode('utf-8')).hexdigest()         if user_id == friend_id:             return k     return \"\"  if __name__ == \"__main__\":     main() <\/code><\/pre>\n<\/p>\n<\/div>\n<\/details>\n<h2>\u0417\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e \u0438 \u043d\u0430 \u043f\u0440\u043e\u0434\u0435<\/h2>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0432\u0441\u0451, \u0447\u0442\u043e \u043d\u0430\u043c \u043e\u0441\u0442\u0430\u0451\u0442\u0441\u044f \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u2014 \u044d\u0442\u043e \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0439 \u0441\u043a\u0440\u0438\u043f\u0442. \u0412 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 <strong>hlt_host<\/strong> \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0439 \u0441\u043a\u0440\u0438\u043f\u0442 \u043a\u0430\u043a \u0432 <strong>\u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u0439 <\/strong>\u0441\u0440\u0435\u0434\u0435, \u0442\u0430\u043a \u0438 \u043d\u0435\u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u043d\u0430 <strong>\u043f\u0440\u043e\u0434\u0435<\/strong>, \u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u043e\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u044b Hidden Lake. \u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u043e\u043f\u0440\u043e\u0431\u0443\u0435\u043c \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u0432\u0441\u0451 \u044d\u0442\u043e \u0447\u0443\u0434\u043e \u0432 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u043c \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u0438.<\/p>\n<p>\u0412 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0438 <strong>go-peer<\/strong> \u0443\u0436\u0435 \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043b\u0435\u043d \u043f\u0440\u0438\u043c\u0435\u0440 \u0441 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u043c \u0437\u0430\u043f\u0443\u0441\u043a\u043e\u043c \u0434\u0432\u0443\u0445 \u0443\u0437\u043b\u043e\u0432, \u0442\u043e \u0435\u0441\u0442\u044c \u0434\u0432\u0443\u0445 HLE \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432 \u0441 \u0434\u0432\u0443\u043c\u044f \u0440\u0430\u0437\u043d\u044b\u043c\u0438 config.yml \u0444\u0430\u0439\u043b\u0430\u043c\u0438. HLT \u0441\u0435\u0440\u0432\u0438\u0441 \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u043f\u043e\u0434\u043d\u0438\u043c\u0430\u0435\u0442\u0441\u044f \u043e\u0434\u0438\u043d, \u043d\u043e \u044d\u0442\u043e \u043d\u0435 \u0435\u0441\u0442\u044c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u044c. HLT \u0441\u0435\u0440\u0432\u0438\u0441\u044b \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0433\u0438\u0431\u043a\u043e \u043c\u043e\u0433\u0443\u0442 \u0441\u0432\u044f\u0437\u044b\u0432\u0430\u0442\u044c\u0441\u044f \u043c\u0435\u0436\u0434\u0443 \u0441\u043e\u0431\u043e\u0439 \u0437\u0430 \u0441\u0447\u0451\u0442 \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u0444\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043e\u043d\u0438 \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u0442\u0430\u043a\u0436\u0435 \u0440\u0435\u0442\u0440\u0430\u043d\u0441\u043b\u044f\u0442\u043e\u0440\u0430\u043c\u0438 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u043c\u044b\u0445 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u0446\u0435\u043d\u0442\u0440\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0437\u0434\u0435\u0441\u044c \u043e\u0441\u043e\u0431\u043e \u043d\u0435 \u0441\u0442\u043e\u0438\u0442. <\/p>\n<p>\u0414\u043b\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u0430 \u043d\u0430\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u0441\u043a\u0430\u0447\u0430\u0442\u044c \u0441\u0430\u043c \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0439 <a href=\"https:\/\/github.com\/number571\/go-peer\" rel=\"noopener noreferrer nofollow\">go-peer<\/a>, \u0434\u0430\u043b\u0435\u0435 \u043f\u0435\u0440\u0435\u0439\u0442\u0438 \u0432 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044e <em>examples\/secure_messenger<\/em> \u0438 \u043f\u0440\u043e\u043f\u0438\u0441\u0430\u0442\u044c \u043a\u043e\u043c\u0430\u043d\u0434\u0443 <strong>make<\/strong>. \u041f\u043e\u0441\u043b\u0435 \u0434\u0430\u043d\u043d\u043e\u0433\u043e \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u043f\u043e\u0434\u043d\u0438\u043c\u0443\u0442\u0441\u044f \u0434\u0432\u0430 HLE \u0441\u0435\u0440\u0432\u0438\u0441\u0430 \u0438 \u043e\u0434\u0438\u043d HLT. \u041f\u0440\u0438\u043c\u0435\u0440 \u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438 \u044d\u0442\u0438\u0445 \u0434\u0432\u0443\u0445 \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432, \u0447\u0442\u043e, \u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e, \u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u0430 \u044f\u0437\u044b\u043a\u0430 Go. \u0415\u0441\u043b\u0438 \u0443 \u0432\u0430\u0441 \u043d\u0435\u0442 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u0430, \u0442\u043e \u043e\u0431\u0435 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b \u043c\u043e\u0436\u043d\u043e \u0441\u043a\u0430\u0447\u0430\u0442\u044c \u0441 \u0440\u0435\u043b\u0438\u0437\u043d\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0438 go-peer \u043f\u043e <a href=\"https:\/\/github.com\/number571\/go-peer\/releases\" rel=\"noopener noreferrer nofollow\">\u0441\u0441\u044b\u043b\u043a\u0435<\/a>.<\/p>\n<pre><code class=\"bash\">$ cd examples\/secure_messenger $ make ... # \u041b\u043e\u0433\u0438 \u043e\u0447\u0438\u0441\u0442\u043a\u0438, \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438, \u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f [INFO] 2023\/12\/25 01:41:34 HLE is running... [INFO] 2023\/12\/25 01:41:34 HLE is running... [INFO] 2023\/12\/25 01:41:34 HLT is running...<\/code><\/pre>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0441\u043e\u0437\u0434\u0430\u0451\u043c \u0434\u0432\u0430 \u0442\u0435\u0440\u043c\u0438\u043d\u0430\u043b\u0430. \u0418\u0437-\u043f\u043e\u0434 \u043e\u0434\u043d\u043e\u0433\u043e \u0442\u0435\u0440\u043c\u0438\u043d\u0430\u043b\u0430 \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u043c \u0432 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044e <em>examples\/secure_messenger\/node1<\/em>, \u0438\u0437-\u043f\u043e\u0434 \u0434\u0440\u0443\u0433\u043e\u0433\u043e \u0432 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044e <em>examples\/secure_messenger\/node2<\/em>. \u041f\u0440\u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c \u043d\u0430 \u043f\u0435\u0440\u0432\u043e\u043c \u0443\u0437\u043b\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u0443 <strong>\/friend Alice<\/strong>, \u043d\u0430 \u0432\u0442\u043e\u0440\u043e\u043c \u043a\u043e\u043c\u0430\u043d\u0434\u0443 <strong>\/friend Bob<\/strong>. \u041f\u043e\u0441\u043b\u0435 \u043f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u043d\u0430\u0447\u0438\u043d\u0430\u0442\u044c \u043f\u0438\u0441\u0430\u0442\u044c \u0434\u0440\u0443\u0433 \u0434\u0440\u0443\u0433\u0443 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f. \u0421\u0430\u043c\u043e \u0436\u0435 \u043f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u0433\u043e\u0432\u043e\u0440\u0438\u0442 \u043b\u0438\u0448\u044c \u043e \u0442\u043e\u043c \u043a\u043e\u043c\u0443 \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u043f\u0438\u0441\u0430\u0442\u044c \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435. \u041d\u0430 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439 \u043e\u043d\u043e \u043d\u0438\u043a\u0430\u043a \u043d\u0435 \u0432\u043b\u0438\u044f\u0435\u0442.  <\/p>\n<pre><code class=\"bash\"># \u0422\u0435\u0440\u043c\u0438\u043d\u0430\u043b#1 $ python3 main.py                                                                               \ue0b2 INT \u2718 \ue0b2 16s \uf252  > \/friend Alice > hello > [Alice]: world >  # \u0422\u0435\u0440\u043c\u0438\u043d\u0430\u043b#2 $ python3 main.py                                                                               \ue0b2 INT \u2718 \ue0b2 13s \uf252  > \/friend Bob > [Bob]: hello > world ><\/code><\/pre>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/7d9\/298\/28a\/7d929828a49c5a34c23d2e090ec079c3.gif\" alt=\"\u041f\u0440\u0438\u043c\u0435\u0440 \u0447\u0430\u0442\u0430 \u0441 \u0434\u0432\u0443\u043c\u044f \u0443\u0437\u043b\u0430\u043c\u0438\" title=\"\u041f\u0440\u0438\u043c\u0435\u0440 \u0447\u0430\u0442\u0430 \u0441 \u0434\u0432\u0443\u043c\u044f \u0443\u0437\u043b\u0430\u043c\u0438\" width=\"1467\" height=\"519\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/7d9\/298\/28a\/7d929828a49c5a34c23d2e090ec079c3.gif\"\/><\/p>\n<div><figcaption>\u041f\u0440\u0438\u043c\u0435\u0440 \u0447\u0430\u0442\u0430 \u0441 \u0434\u0432\u0443\u043c\u044f \u0443\u0437\u043b\u0430\u043c\u0438<\/figcaption><\/div>\n<\/figure>\n<p>\u041f\u043e\u0441\u043b\u0435 \u0443\u0441\u043f\u0435\u0448\u043d\u043e\u0433\u043e \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u043c\u044b \u0442\u0430\u043a\u0436\u0435 \u043c\u043e\u0436\u0435\u043c \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u0440\u0430\u0431\u043e\u0442\u0443 \u043d\u0430\u0448\u0435\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0443\u0436\u0435 \u043d\u0430 \u043f\u0440\u043e\u0434\u0435, \u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u043e\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0433\u043e\u0442\u043e\u0432\u043e\u0439 Hidden Lake \u0441\u0435\u0442\u0438. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043d\u0430\u0434\u043e \u0432\u0437\u044f\u0442\u044c \u0441\u043f\u0438\u0441\u043e\u043a \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0445 HLT \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432. \u0412\u0441\u0435 \u043e\u043d\u0438 \u043d\u0430\u0445\u043e\u0434\u044f\u0442\u0441\u044f \u0432 <a href=\"https:\/\/github.com\/number571\/go-peer\/tree\/master\/cmd\/hidden_lake\" rel=\"noopener noreferrer nofollow\">README<\/a>. <\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/210\/be3\/303\/210be3303dcbcc8f0418c36ae4638808.png\" alt=\"\u0421\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0435 HLT \u0441\u0435\u0440\u0432\u0438\u0441\u044b \u0432 \u0441\u0435\u0442\u0438 Hidden Lake\" title=\"\u0421\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0435 HLT \u0441\u0435\u0440\u0432\u0438\u0441\u044b \u0432 \u0441\u0435\u0442\u0438 Hidden Lake\" width=\"928\" height=\"317\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/210\/be3\/303\/210be3303dcbcc8f0418c36ae4638808.png\"\/><\/p>\n<div><figcaption>\u0421\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0435 HLT \u0441\u0435\u0440\u0432\u0438\u0441\u044b \u0432 \u0441\u0435\u0442\u0438 Hidden Lake<\/figcaption><\/div>\n<\/figure>\n<p>\u0427\u0442\u043e\u0431\u044b \u043f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0438\u0442\u044c\u0441\u044f \u043d\u0430 \u0441\u0442\u043e\u0440\u043e\u043d\u043d\u0438\u0439 \u0441\u0435\u0440\u0432\u0438\u0441, \u043d\u0430\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043f\u043e\u043c\u0435\u043d\u044f\u0442\u044c \u0432 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044f\u0445 <strong>config.yml<\/strong> \u0438 <strong>hle.yml<\/strong> \u043f\u043e \u043e\u0434\u043d\u043e\u043c\u0443 \u043f\u043e\u043b\u044e. \u0412\u043e\u0437\u044c\u043c\u0451\u043c \u043f\u044f\u0442\u044b\u0439 \u0441\u0435\u0440\u0432\u0438\u0441 HLTs, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0439 \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u0434 \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439. \u0412 config.yml \u043c\u0435\u043d\u044f\u0435\u043c \u043f\u043e\u043b\u0435 <strong>hlt_host<\/strong> \u0441 <em>localhost:6582<\/em> \u043d\u0430 <em>195.43.4.253:9582<\/em>. \u0412 hle.yml \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u043b\u0435 <strong>network_key<\/strong> \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u043e\u0432\u0430\u043b\u043e <em>j2BR39JfDf7Bajx3<\/em>. <\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/e81\/394\/301\/e8139430110292621859c13b9a2d0888.png\" alt=\"\u041b\u043e\u0433\u0438 HLE \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432. WARN - \u0431\u0435\u0437\u0443\u0441\u043f\u0435\u0448\u043d\u0430\u044f \u043f\u043e\u043f\u044b\u0442\u043a\u0430 \u0440\u0430\u0441\u0448\u0438\u0444\u0440\u043e\u0432\u0430\u0442\u044c \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435. \u041d\u0430\u0448\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u043b\u0443\u0447\u0430\u0442\u044c \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f \u043d\u0435 \u043d\u0430\u043c \u0430\u0434\u0440\u0435\u0441\u0443\u0435\u043c\u044b\u0435, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043c\u044b \u0438\u0445 \u043d\u0435 \u0441\u043c\u043e\u0436\u0435\u043c \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u0442\u044c. \" title=\"\u041b\u043e\u0433\u0438 HLE \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432. WARN - \u0431\u0435\u0437\u0443\u0441\u043f\u0435\u0448\u043d\u0430\u044f \u043f\u043e\u043f\u044b\u0442\u043a\u0430 \u0440\u0430\u0441\u0448\u0438\u0444\u0440\u043e\u0432\u0430\u0442\u044c \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435. \u041d\u0430\u0448\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u043b\u0443\u0447\u0430\u0442\u044c \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f \u043d\u0435 \u043d\u0430\u043c \u0430\u0434\u0440\u0435\u0441\u0443\u0435\u043c\u044b\u0435, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043c\u044b \u0438\u0445 \u043d\u0435 \u0441\u043c\u043e\u0436\u0435\u043c \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u0442\u044c. \" width=\"977\" height=\"420\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/e81\/394\/301\/e8139430110292621859c13b9a2d0888.png\"\/><\/p>\n<div><figcaption>\u041b\u043e\u0433\u0438 HLE \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432. WARN &#8212; \u0431\u0435\u0437\u0443\u0441\u043f\u0435\u0448\u043d\u0430\u044f \u043f\u043e\u043f\u044b\u0442\u043a\u0430 \u0440\u0430\u0441\u0448\u0438\u0444\u0440\u043e\u0432\u0430\u0442\u044c \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435. \u041d\u0430\u0448\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u043b\u0443\u0447\u0430\u0442\u044c \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f \u043d\u0435 \u043d\u0430\u043c \u0430\u0434\u0440\u0435\u0441\u0443\u0435\u043c\u044b\u0435, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043c\u044b \u0438\u0445 \u043d\u0435 \u0441\u043c\u043e\u0436\u0435\u043c \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u0442\u044c. <\/figcaption><\/div>\n<\/figure>\n<p>\u041f\u043e\u0441\u043b\u0435 \u044d\u0442\u0438\u0445 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439 \u043f\u0435\u0440\u0435\u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c HLE \u0441\u0435\u0440\u0432\u0438\u0441\u044b. \u042d\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 <code>make clean<\/code> \u0438 \u0441\u043d\u043e\u0432\u0430 <code>make<\/code>. \u0412\u0441\u0451, \u0442\u0435\u043f\u0435\u0440\u044c \u043c\u044b \u0442\u0430\u043a\u0436\u0435 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u043c \u0438 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f, \u043d\u043e \u0443\u0436\u0435 \u0431\u0443\u0434\u0443\u0447\u0438 \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u043c\u0438 \u0441 \u0432\u043d\u0435\u0448\u043d\u0438\u043c \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u043c HLT.<\/p>\n<h2>\u0417\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/h2>\n<p>\u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u043d\u0430\u043c\u0438 \u0431\u044b\u043b \u043d\u0430\u043f\u0438\u0441\u0430\u043d \u043c\u0435\u0441\u0441\u0435\u043d\u0434\u0436\u0435\u0440 \u0441 end-to-end \u0448\u0438\u0444\u0440\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u043f\u043e\u0432\u0435\u0440\u0445 Hidden Lake \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432 \u043d\u0430 \u044f\u0437\u044b\u043a\u0435 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f Python. \u0412\u0435\u0441\u044c \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434 \u0434\u0430\u043d\u043d\u043e\u0433\u043e \u043c\u0435\u0441\u0441\u0435\u043d\u0434\u0436\u0435\u0440\u0430 \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0439\u0442\u0438 <a href=\"https:\/\/github.com\/number571\/go-peer\/tree\/master\/cmd\/secpy_chat\" rel=\"noopener noreferrer nofollow\">\u0442\u0443\u0442<\/a>. \u0417\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u0435\u0433\u043e \u0440\u0430\u0431\u043e\u0442\u0443 \u0441 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u044b\u043c\u0438 \u0434\u0432\u0443\u043c\u044f \u0443\u0437\u043b\u0430\u043c\u0438 \u043c\u043e\u0436\u043d\u043e <a href=\"https:\/\/github.com\/number571\/go-peer\/tree\/master\/examples\/secure_messenger\" rel=\"noopener noreferrer nofollow\">\u0442\u0443\u0442<\/a>.<\/p>\n<\/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\/782836\/\"> https:\/\/habr.com\/ru\/articles\/782836\/<\/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<p>\u0412 \u0441\u0432\u043e\u0431\u043e\u0434\u043d\u043e\u0435 \u043e\u0442 \u0440\u0430\u0431\u043e\u0442\u044b \u0432\u0440\u0435\u043c\u044f \u044f \u043f\u0438\u0448\u0443 \u0430\u043d\u043e\u043d\u0438\u043c\u043d\u0443\u044e \u0441\u0435\u0442\u044c <strong>Hidden Lake<\/strong>, \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u044e \u0432 \u043d\u0435\u0451 \u043d\u043e\u0432\u044b\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0438 \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u043e \u0438\u0441\u043f\u0440\u0430\u0432\u043b\u044f\u044e \u0440\u0430\u043d\u0435\u0435 \u043c\u043d\u043e\u0439 \u0436\u0435 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0435 \u0431\u0430\u0433\u0438. \u0412\u0441\u044f \u0444\u0438\u043b\u043e\u0441\u043e\u0444\u0438\u044f \u0441\u0435\u0442\u0438 Hidden Lake \u0434\u0435\u0440\u0436\u0438\u0442\u0441\u044f \u043d\u0430 \u043c\u0438\u043a\u0440\u043e\u0441\u0435\u0440\u0432\u0438\u0441\u043d\u043e\u0439 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0435, \u043d\u0430 \u043a\u043e\u043d\u0446\u0435\u043f\u0446\u0438\u0438 \u043d\u0435\u0437\u0430\u0432\u0438\u0441\u0438\u043c\u044b\u0445 (\u043d\u0430\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u044d\u0442\u043e \u0442\u043e\u043b\u044c\u043a\u043e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e) \u0434\u0440\u0443\u0433 \u043e\u0442 \u0434\u0440\u0443\u0433\u0430 \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432. \u0412 \u043e\u0434\u043d\u043e\u0439 \u0438\u0437 \u043c\u043e\u0438\u0445 <a href=\"https:\/\/habr.com\/ru\/articles\/765464\/\" rel=\"noopener noreferrer nofollow\">\u0441\u0442\u0430\u0442\u0435\u0439<\/a> \u0443\u0436\u0435 \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u043b\u0441\u044f \u043f\u0440\u0438\u043c\u0435\u0440 \u0442\u043e\u0433\u043e, \u043a\u0430\u043a \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439 \u0441\u0435\u0440\u0432\u0438\u0441 \u0432 \u0430\u043d\u043e\u043d\u0438\u043c\u043d\u043e\u0439 \u0441\u0435\u0442\u0438 HL, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u0441\u0432\u043e\u0438 \u0442\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u0438 \u0438 \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u043d\u0435 \u043e\u0431\u0440\u0430\u0449\u0430\u044f\u0441\u044c \u043a \u044f\u0437\u044b\u043a\u0443 Go (\u0440\u043e\u0434\u043d\u043e\u043c\u0443 \u044f\u0437\u044b\u043a\u0443 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439 Hidden Lake). <\/p>\n<p>\u041d\u043e \u0432 \u0442\u043e\u0442 \u043c\u043e\u043c\u0435\u043d\u0442 \u043f\u0440\u0438\u0441\u0443\u0442\u0441\u0442\u0432\u043e\u0432\u0430\u043b\u0430 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u043d\u043e\u0441\u0442\u044c \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u044b Hidden Lake \u043f\u043e \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044e \u043d\u0435\u0430\u043d\u043e\u043d\u0438\u043c\u043d\u044b\u0445, \u043d\u043e \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u044b\u0445 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439. \u0418\u043d\u044b\u043c\u0438 \u0441\u043b\u043e\u0432\u0430\u043c\u0438, \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0430\u043d\u043e\u043d\u0438\u043c\u043d\u044b\u0439 \u0438 \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u044b\u0439 \u043c\u0435\u0441\u0441\u0435\u043d\u0434\u0436\u0435\u0440 (\u043f\u0440\u0438\u043c\u0435\u0440 \u0442\u043e\u043c\u0443 <a href=\"https:\/\/habr.com\/ru\/articles\/701488\/\" rel=\"noopener noreferrer nofollow\">HLM<\/a>), \u043d\u043e \u043d\u0435\u043b\u044c\u0437\u044f \u0431\u044b\u043b\u043e \u0443\u0431\u0440\u0430\u0442\u044c \u0430\u043d\u043e\u043d\u0438\u043c\u043d\u043e\u0441\u0442\u044c \u0438\u0437 \u044d\u0442\u043e\u0433\u043e \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u0430. \u041e\u0442 \u0447\u0430\u0441\u0442\u0438 \u044d\u0442\u043e \u043b\u043e\u0433\u0438\u0447\u043d\u043e\u0435 \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435, \u0432\u0435\u0434\u044c HL \u043a\u0430\u043a-\u043d\u0438\u043a\u0430\u043a \u0430\u043d\u043e\u043d\u0438\u043c\u043d\u0430\u044f \u0441\u0435\u0442\u044c. \u041f\u0440\u043e\u0442\u0438\u0432\u043e\u0440\u0435\u0447\u0438\u0435\u043c \u0436\u0435 \u0437\u0434\u0435\u0441\u044c \u044f\u0432\u043b\u044f\u043b\u043e\u0441\u044c \u0442\u043e, \u0447\u0442\u043e \u0440\u0430\u0437 \u0441\u0435\u0442\u044c \u0441\u0442\u0440\u043e\u0438\u0442\u0441\u044f \u043d\u0430 \u043d\u0435\u0437\u0430\u0432\u0438\u0441\u0438\u043c\u044b\u0445 \u0434\u0440\u0443\u0433 \u043e\u0442 \u0434\u0440\u0443\u0433\u0430 \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432, \u0442\u043e \u0447\u0438\u0441\u0442\u043e \u0442\u0435\u0445\u043d\u0438\u0447\u0435\u0441\u043a\u0438 \u0438 \u0442\u0435\u043e\u0440\u0435\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0434\u043e\u043b\u0436\u043d\u0430 \u0431\u044b\u043b\u0430 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0438\u0437\u0431\u0430\u0432\u0438\u0442\u044c\u0441\u044f \u043e\u0442 \u0441\u0435\u0440\u0432\u0438\u0441\u0430 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0449\u0435\u0433\u043e \u0430\u043d\u043e\u043d\u0438\u043c\u043d\u043e\u0441\u0442\u044c. \u0418 \u0442\u0430\u043a\u043e\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u043d\u0430\u0448\u043b\u043e\u0441\u044c.<\/p>\n<figure class=\"full-width\"><\/figure>\n<h2>\u041f\u0430\u0440\u0430 \u0441\u043b\u043e\u0432 \u043e\u0431 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0445 \u0441\u0435\u0440\u0432\u0438\u0441\u0430\u0445<\/h2>\n<p>\u0411\u0443\u0434\u0443\u0449\u0438\u0439 \u043d\u0430\u043c\u0438 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u043c\u0435\u0441\u0441\u0435\u043d\u0434\u0436\u0435\u0440 \u0441\u043e \u0441\u043a\u0432\u043e\u0437\u043d\u044b\u043c \u0448\u0438\u0444\u0440\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u0431\u0443\u0434\u0435\u0442 \u043d\u0430\u043f\u0438\u0441\u0430\u043d \u043d\u0430 \u044f\u0437\u044b\u043a\u0435 Python \u0441 \u0442\u043e\u0439 \u043b\u0438\u0448\u044c \u0435\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0439 \u0446\u0435\u043b\u044c\u044e, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u043b\u044e\u0431\u044b\u0445 \u0443\u0434\u043e\u0431\u043d\u044b\u0445 \u0432\u0430\u043c\u0438 \u0442\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u0439 \u043f\u043e\u0432\u0435\u0440\u0445 \u0443\u0436\u0435 \u0433\u043e\u0442\u043e\u0432\u044b\u0445 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0439. <\/p>\n<p>\u0414\u0430\u043d\u043d\u044b\u0439 \u043c\u0435\u0441\u0441\u0435\u043d\u0434\u0436\u0435\u0440 \u0431\u0443\u0434\u0435\u0442 \u0437\u0430\u0432\u044f\u0437\u0430\u043d \u043d\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 \u0434\u0432\u0443\u0445 HL \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432: <strong>HLT<\/strong> (traffic) \u0438 <strong>HLE<\/strong> (encryptor). \u0412\u043a\u0440\u0430\u0442\u0446\u0435, HLT &#8212; \u044d\u0442\u043e \u0441\u0435\u0440\u0432\u0438\u0441-\u0440\u0435\u0442\u0440\u0430\u043d\u0441\u043b\u044f\u0442\u043e\u0440 \u0438 \u0441\u0435\u0440\u0432\u0438\u0441-\u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0435 \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0433\u043e \u0442\u0440\u0430\u0444\u0438\u043a\u0430. \u0411\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f \u0435\u043c\u0443 \u043c\u043e\u0436\u043d\u043e \u0432\u043e\u0441\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0442\u044c \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0443\u0436\u0435 \u0431\u044b\u043b\u0438 \u0437\u0430\u0431\u044b\u0442\u044b \u0441\u0435\u0442\u044c\u044e. \u042d\u0442\u043e \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e \u043d\u0430\u043c \u043a\u0430\u043a \u0440\u0430\u0437 \u0432 \u0431\u0443\u0434\u0443\u0449\u0435\u043c \u0438 \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u0441\u044f. \u041f\u043e\u0434\u0440\u043e\u0431\u043d\u043e \u043e HLT \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0447\u0438\u0442\u0430\u0442\u044c <a href=\"https:\/\/habr.com\/ru\/articles\/717184\/\" rel=\"noopener noreferrer nofollow\">\u0442\u0443\u0442<\/a> \u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/720544\/\" rel=\"noopener noreferrer nofollow\">\u0442\u0443\u0442<\/a>. <\/p>\n<p>\u0421\u0435\u0440\u0432\u0438\u0441 HLE \u0432 \u0441\u0432\u043e\u044e \u043e\u0447\u0435\u0440\u0435\u0434\u044c \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043e\u0447\u0435\u043d\u044c \u043f\u0440\u043e\u0441\u0442\u044b\u043c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435\u043c, \u043e\u043d \u0441\u043f\u043e\u0441\u043e\u0431\u0435\u043d \u0442\u043e\u043b\u044c\u043a\u043e \u0448\u0438\u0444\u0440\u043e\u0432\u0430\u0442\u044c \u0438 \u0440\u0430\u0441\u0448\u0438\u0444\u0440\u043e\u0432\u044b\u0432\u0430\u0442\u044c \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f \u0447\u0438\u0442\u0430\u0435\u043c\u044b\u0435 \u0441\u0435\u0442\u044c\u044e HL, \u043d\u0438 \u0431\u043e\u043b\u0435\u0435 \u043d\u0438 \u043c\u0435\u043d\u0435\u0435. \u041d\u043e \u043a\u0430\u043a \u0440\u0430\u0437 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0433\u043e \u0441\u0435\u0440\u0432\u0438\u0441\u0430 \u0438 \u043d\u0435 \u0445\u0432\u0430\u0442\u0430\u043b\u043e \u0434\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u043f\u0438\u0441\u0430\u0442\u044c \u0438\u0441\u043a\u043b\u044e\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043a\u043b\u0438\u0435\u043d\u0442-\u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u044b\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0431\u0435\u0437 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430 \u0430\u043d\u043e\u043d\u0438\u043c\u043d\u043e\u0441\u0442\u0438, \u043b\u0438\u0431\u043e \u0431\u043e\u043b\u0435\u0435 \u0433\u0438\u0431\u043a\u0438\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u0441 \u0434\u0440\u0443\u0433\u0438\u043c \u0434\u043e\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c\u0441\u0442\u0432\u043e\u043c \u0430\u043d\u043e\u043d\u0438\u043c\u043d\u043e\u0441\u0442\u0438.<\/p>\n<h2>\u0420\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f<\/h2>\n<h3>1. \u041a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044f<\/h3>\n<p>\u041f\u0435\u0440\u0432\u043e\u0435 \u0441 \u0447\u0435\u0433\u043e \u043c\u044b \u043d\u0430\u0447\u043d\u0451\u043c &#8212; \u044d\u0442\u043e \u0441 \u0444\u0430\u0439\u043b\u0430 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438. \u0412 \u043d\u0451\u043c \u0434\u043e\u043b\u0436\u043d\u043e \u0431\u044b\u0442\u044c \u0442\u0440\u0438 \u043f\u043e\u043b\u044f: <strong>hlt_host<\/strong>, <strong>hle_host<\/strong> \u0438 <strong>friends<\/strong>. \u041f\u0435\u0440\u0432\u044b\u0435 \u0434\u0432\u0430 \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u044e\u0442 \u043d\u0430 \u0430\u0434\u0440\u0435\u0441\u0430 \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432 HLT \u0438 HLE \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e. \u0421\u0435\u0440\u0432\u0438\u0441 HLT \u043c\u043e\u0436\u0435\u0442 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u044c\u0441\u044f \u0432 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u043e\u0439 \u0441\u0435\u0442\u0438, \u0432 \u0442\u043e \u0432\u0440\u0435\u043c\u044f \u043a\u0430\u043a HLE \u043e\u0431\u044f\u0437\u0430\u043d \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u044c\u0441\u044f \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e \u043d\u0430 \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\u0435. \u0421\u0443\u0442\u044c \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e HLE \u043e\u0431\u0440\u0430\u0449\u0430\u0435\u0442\u0441\u044f \u043a \u043f\u0440\u0438\u0432\u0430\u0442\u043d\u043e\u043c\u0443 \u043a\u043b\u044e\u0447\u0443, \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u043c\u0443 \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\u0443 \u0432 \u0441\u0435\u0442\u0438. \u0415\u0433\u043e \u043f\u043e\u0442\u0435\u0440\u044f \u0432\u0435\u0434\u0451\u0442 \u043d\u0435\u043c\u0438\u043d\u0443\u0435\u043c\u043e \u043a \u043a\u043e\u043c\u043f\u0440\u043e\u043c\u0435\u0442\u0430\u0446\u0438\u0438 \u0441\u0432\u044f\u0437\u0438. <\/p>\n<p>\u041f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0435 \u043f\u043e\u043b\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0441\u043e\u0431\u043e\u0439 \u043c\u0430\u043f\u0443 (\u0441\u043b\u043e\u0432\u0430\u0440\u044c) \u043f\u043e \u0442\u0438\u043f\u0443 <strong>\u0438\u043c\u044f:\u043f\u0443\u0431\u043b\u0438\u0447\u043d\u044b\u0439_\u043a\u043b\u044e\u0447<\/strong>. \u0421\u0443\u0449\u0435\u0441\u0442\u0432\u043e\u0432\u0430\u043d\u0438\u0435 \u0434\u0440\u0443\u0437\u0435\u0439 \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u0442 \u043d\u0430\u0441 \u043a \u0441\u0435\u0442\u0438 \u0442\u0438\u043f\u0430 <strong>friend-to-friend<\/strong>, \u043a\u043e\u0433\u0434\u0430 \u0443\u0447\u0430\u0441\u0442\u043d\u0438\u043a\u0438 \u043a\u043e\u043c\u043c\u0443\u043d\u0438\u043a\u0430\u0446\u0438\u0438 \u0437\u0430\u0440\u0430\u043d\u0435\u0435 \u0432\u044b\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0442 \u0441 \u043a\u0435\u043c \u043e\u043d\u0438 \u043c\u043e\u0433\u0443\u0442 \u043e\u0431\u0449\u0430\u0442\u044c\u0441\u044f \u0438 \u043e\u0442 \u043a\u043e\u0433\u043e \u043c\u043e\u0433\u0443\u0442 \u043f\u043e\u043b\u0443\u0447\u0430\u0442\u044c \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f. \u0422\u0430\u043a\u043e\u0435 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0438\u0437\u0431\u0430\u0432\u043b\u044f\u0442\u044c\u0441\u044f \u043e\u0442 \u0441\u043f\u0430\u043c\u0430 \u0441\u043e \u0441\u0442\u043e\u0440\u043e\u043d\u044b \u0434\u0440\u0443\u0433\u0438\u0445 \u0443\u0447\u0430\u0441\u0442\u043d\u0438\u043a\u043e\u0432 \u0441\u0435\u0442\u0438, \u0430 \u0442\u0430\u043a\u0436\u0435 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0431\u043e\u043b\u0435\u0435 \u043b\u0435\u0433\u043a\u043e \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u0446\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0430\u0431\u043e\u043d\u0435\u043d\u0442\u043e\u0432 \u043f\u043e \u0441\u0430\u043c\u043e\u0441\u0442\u043e\u044f\u0442\u0435\u043b\u044c\u043d\u043e \u0432\u044b\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u043d\u043e\u043c\u0443 \u0438\u043c\u0435\u043d\u0438.<\/p>\n<p>\u0418\u0442\u043e\u0433\u043e, \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0439 \u0444\u0430\u0439\u043b:<\/p>\n<pre><code class=\"yaml\">hlt_host: localhost:9582 hle_host: localhost:9551 friends:    Alice: PubKey{3082020A02820201...3324D10203010001}<\/code><\/pre>\n<p>\u0415\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0435 \u0437\u0434\u0435\u0441\u044c \u043d\u0435\u0438\u0437\u0432\u0435\u0441\u0442\u043d\u043e\u0435 \u0434\u043b\u044f \u043d\u0430\u0441 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 &#8212; \u044d\u0442\u043e \u0441\u0430\u043c \u043f\u0443\u0431\u043b\u0438\u0447\u043d\u044b\u0439 \u043a\u043b\u044e\u0447, \u0430 \u0438\u043c\u0435\u043d\u043d\u043e \u0441\u043f\u043e\u0441\u043e\u0431 \u0435\u0433\u043e \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f. \u041c\u044b \u0434\u043e\u043b\u0436\u043d\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0439 \u043a\u043b\u044e\u0447 \u043e\u0442 \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u0430\u0433\u0430\u0435\u043c\u043e\u0433\u043e \u0430\u0431\u043e\u043d\u0435\u043d\u0442\u0430, \u043d\u043e \u043a\u0430\u043a \u043e\u043d \u0434\u043e\u043b\u0436\u0435\u043d \u0435\u0433\u043e \u0434\u043e\u0431\u044b\u0442\u044c? \u0417\u0434\u0435\u0441\u044c \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u0434\u0432\u0430 \u0441\u043f\u043e\u0441\u043e\u0431\u0430: <\/p>\n<ol>\n<li>\n<p>\u041f\u0440\u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0435 HLE, \u0435\u0441\u043b\u0438 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0439 \u043d\u0435 \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0438\u0442 \u043d\u0430\u043b\u0438\u0447\u0438\u0435 \u043f\u0440\u0438\u0432\u0430\u0442\u043d\u043e\u0433\u043e \u043a\u043b\u044e\u0447\u0430, \u0442\u043e \u043e\u043d \u0441\u0430\u043c \u0435\u0433\u043e <strong>\u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u0442<\/strong> \u0438 \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442 \u0432 \u0441\u0432\u043e\u0451 \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0435\u0435 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435. \u0412\u0441\u0451 \u0447\u0442\u043e \u043e\u0441\u0442\u0430\u0451\u0442\u0441\u044f &#8212; \u044d\u0442\u043e \u0437\u0430\u043f\u0440\u043e\u0441\u0438\u0442\u044c \u0443 HLE \u043f\u0443\u0431\u043b\u0438\u0447\u043d\u044b\u0439 \u043a\u043b\u044e\u0447 \u043f\u043e \u0435\u0433\u043e <strong>API<\/strong>.<\/p>\n<p><code>curl -i -X GET -H 'Accept: application\/json' http:\/\/localhost:9551\/api\/service\/pubkey<\/code><\/p>\n<\/li>\n<li>\n<p>\u041c\u043e\u0436\u043d\u043e \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u0430\u0440\u0443 \u043f\u0440\u0438\u0432\u0430\u0442\u043d\u044b\u0439 \/ \u043f\u0443\u0431\u043b\u0438\u0447\u043d\u044b\u0439 \u043a\u043b\u044e\u0447 \u0441\u0430\u043c\u043e\u0441\u0442\u043e\u044f\u0442\u0435\u043b\u044c\u043d\u043e, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 <a href=\"https:\/\/github.com\/number571\/go-peer\/tree\/master\/cmd\/tools\/keygen\" rel=\"noopener noreferrer nofollow\">cmd\/tools\/keygen<\/a> \u0438\u0437 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u044f <strong>go-peer<\/strong>. \u0412 \u0442\u0430\u043a\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u043e\u043f\u0438\u0441\u0430\u0442\u044c \u043b\u0438\u0448\u044c \u0434\u043b\u0438\u043d\u0443 RSA \u043a\u043b\u044e\u0447\u0430. \u0414\u043b\u0438\u043d\u0430 \u043a\u043b\u044e\u0447\u0430 \u0432 \u0441\u0435\u0442\u0438 HL \u0440\u0430\u0432\u043d\u0430 4096 \u0431\u0438\u0442. \u041f\u043e\u0441\u043b\u0435 \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u0431\u0443\u0434\u0435\u0442 \u0441\u043e\u0437\u0434\u0430\u043d\u043e \u0434\u0432\u0430 \u0444\u0430\u0439\u043b\u0430 <strong>priv.key<\/strong> \u0438 <strong>pub.key<\/strong>. \u041f\u0435\u0440\u0432\u044b\u0439 \u043a\u043b\u044e\u0447 \u043f\u043e\u0434\u0430\u0451\u043c \u043d\u0430 \u0432\u0445\u043e\u0434 HLE, \u0430 \u0432\u0442\u043e\u0440\u043e\u0439 \u0440\u0430\u0437\u0433\u043b\u0430\u0448\u0430\u0435\u043c \u0441\u0432\u043e\u0435\u043c\u0443 \u0441\u043e\u0431\u0435\u0441\u0435\u0434\u043d\u0438\u043a\u0443. <\/p>\n<p><code>go run . 4096<\/code> <\/p>\n<\/li>\n<\/ol>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c, \u0432\u0441\u0451 \u0447\u0442\u043e \u043d\u0430\u043c \u043e\u0441\u0442\u0430\u0451\u0442\u0441\u044f &#8212; \u044d\u0442\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u043d\u0430 \u043f\u0438\u0442\u043e\u043d\u0435 \u0447\u0442\u0435\u043d\u0438\u0435 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u043e\u0433\u043e \u0444\u0430\u0439\u043b\u0430. \u0414\u043b\u044f \u043f\u0440\u043e\u0441\u0442\u043e\u0442\u044b \u044f \u0432\u044b\u043d\u0435\u0441 \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u043d\u043d\u044b\u0435 \u043f\u043e\u043b\u044f \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u0432 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435. \u041f\u043e\u0441\u043b\u0435 \u043f\u0440\u043e\u0447\u0442\u0435\u043d\u0438\u044f, \u044d\u0442\u0438 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0441\u0447\u0438\u0442\u0430\u044e\u0442\u0441\u044f \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043e\u0439. \u0421\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e, \u043a \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u043c\u0443 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044e \u0433\u043e\u043d\u043a\u0438 \u0434\u0430\u043d\u043d\u044b\u0439 \u043f\u043e\u0434\u0445\u043e\u0434 \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u0442\u044c \u043d\u0435 \u0431\u0443\u0434\u0435\u0442.  <\/p>\n<pre><code class=\"python\">import yaml  HLE_URL = \"\" # it is being overwritten HLT_URL = \"\" # it is being overwritten FRIENDS = {} # it is being overwritten  def init_load_config(cfg_path):     global HLE_URL, HLT_URL, FRIENDS      with open(cfg_path, \"r\") as stream:         try:             config_loaded = yaml.safe_load(stream)         except yaml.YAMLError as e:             print(\"@ failed load config\")             exit(3)          HLT_URL = \"http:\/\/\" + config_loaded[\"hlt_host\"]     HLE_URL = \"http:\/\/\" + config_loaded[\"hle_host\"]     FRIENDS = config_loaded[\"friends\"]  ...<\/code><\/pre>\n<h3>2. \u0427\u0442\u0435\u043d\u0438\u0435 \u0432\u0432\u043e\u0434\u0430<\/h3>\n<p>\u041c\u0435\u0441\u0441\u0435\u043d\u0434\u0436\u0435\u0440 \u0431\u0443\u0434\u0435\u0442 \u0441\u043e\u0441\u0442\u043e\u044f\u0442\u044c \u0438\u0437 \u0434\u0432\u0443\u0445 \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u044b\u0445 \u043f\u0440\u043e\u0446\u0435\u0434\u0443\u0440: <strong>input_task<\/strong> \u0438 <strong>output_task<\/strong>. \u041f\u0435\u0440\u0432\u0430\u044f \u043f\u0440\u043e\u0446\u0435\u0434\u0443\u0440\u0430 \u0441\u0432\u043e\u0434\u0438\u0442\u0441\u044f \u043a \u0432\u0432\u043e\u0434\u0443 \u0434\u0430\u043d\u043d\u044b\u0445 \/ \u043a\u043e\u043c\u0430\u043d\u0434 \u043e\u0442 \u0441\u0430\u043c\u043e\u0433\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f. \u041a\u043e\u043c\u0430\u043d\u0434\u0430 \u0431\u0443\u0434\u0435\u0442 \u0432\u0441\u0435\u0433\u043e \u043e\u0434\u043d\u0430: <strong>\/friend<\/strong>. \u041e\u043d\u0430 \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u0442 \u0434\u0440\u0443\u0433\u0430 \u043a\u043e\u0442\u043e\u0440\u043e\u043c\u0443 \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f. \u0412\u0442\u043e\u0440\u0430\u044f \u043f\u0440\u043e\u0446\u0435\u0434\u0443\u0440\u0430 \u0441\u0432\u043e\u0434\u0438\u0442\u0441\u044f \u043a \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044e \u0434\u0430\u043d\u043d\u044b\u0445 \u0438\u0437 \u0441\u0435\u0442\u0438 \u0438 \u043a \u0438\u0445 \u0432\u044b\u0432\u043e\u0434\u0443.<\/p>\n<pre><code class=\"python\">...  import multiprocessing  ...  def main():     init_load_config(\"config.yml\")     parallel_run(input_task, output_task)  def parallel_run(*fns):     proc = []     for fn in fns:         p = multiprocessing.Process(target=fn)         p.start()         proc.append(p)     for p in proc:         p.join()  ...  if __name__ == \"__main__\":     main() <\/code><\/pre>\n<p>\u0421\u0430\u043c \u043a\u043e\u0434 \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0441\u044f \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u044b\u043c. \u0415\u0441\u0442\u044c \u0437\u0434\u0435\u0441\u044c \u043b\u0438\u0448\u044c \u043e\u0434\u0438\u043d \u043c\u043e\u043c\u0435\u043d\u0442, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0441\u0442\u043e\u0438\u0442 \u043f\u0440\u043e\u044f\u0441\u043d\u0438\u0442\u044c, \u0430 \u0438\u043c\u0435\u043d\u043d\u043e <code>sys.stdin = open(0)<\/code>. \u041f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u0430\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u043f\u0440\u043e\u0446\u0435\u0434\u0443\u0440 \u0441\u0432\u043e\u0434\u0438\u0442\u0441\u044f \u043a \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044e \u043c\u043e\u0434\u0443\u043b\u044f multiprocessing, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432 \u0441\u0432\u043e\u044e \u043e\u0447\u0435\u0440\u0435\u0434\u044c \u043d\u0435 \u043f\u0440\u043e\u0442\u0430\u043b\u043a\u0438\u0432\u0430\u0435\u0442 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0439 \u043f\u043e\u0442\u043e\u043a \u0432\u0432\u043e\u0434\u0430 \u0434\u0430\u043b\u044c\u0448\u0435 \u0432 \u043a\u043b\u0430\u0441\u0441 Proccess. \u0412\u0441\u043b\u0435\u0434\u0441\u0442\u0432\u0438\u0435 \u044d\u0442\u043e\u0433\u043e, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u044f\u0432\u043d\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0439 \u043f\u043e\u0442\u043e\u043a (0) \u0432 \u0441\u0430\u043c\u043e\u0439 \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u043e\u0439 \u043f\u0440\u043e\u0446\u0435\u0434\u0443\u0440\u0435. \u0411\u0435\u0437 \u044d\u0442\u043e\u0439 \u0447\u0430\u0441\u0442\u0438 \u043a\u043e\u0434\u0430 input \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u0442\u044c \u043a \u043e\u0448\u0438\u0431\u043a\u0430\u043c <code>EOFError: EOF when reading a line<\/code>. \u0411\u043e\u043b\u0435\u0435 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e \u043f\u0440\u043e \u044d\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0447\u0438\u0442\u0430\u0442\u044c <a href=\"https:\/\/stackoverflow.com\/questions\/63893634\/how-to-use-multiprocessing-with-input-function-and-avoid-eoferror-eof-when-r\" rel=\"noopener noreferrer nofollow\">\u0442\u0443\u0442<\/a>.<\/p>\n<pre><code class=\"python\">...  import sys  def input_task():     friend = \"\"      sys.stdin = open(0)     while True:         msg = input(\"> \")         if len(msg) == 0:             print(\"@ got null message\")             continue          if msg.startswith(\"\/friend \"):             try:                 _friend = FRIENDS[msg[len(\"\/friend \"):].strip()]             except KeyError:                 print(\"@ got invalid friend name\")                 continue             friend = _friend             continue          if friend == \"\":             print(\"@ friend is null, use \/friend to set\")             continue           ...<\/code><\/pre>\n<p>\u0414\u0430\u043b\u0435\u0435, \u043a\u0430\u043a \u0442\u043e\u043b\u044c\u043a\u043e \u0443 \u043d\u0430\u0441 \u0443\u0436\u0435 \u0435\u0441\u0442\u044c \u043f\u0443\u0431\u043b\u0438\u0447\u043d\u044b\u0439 \u043a\u043b\u044e\u0447 \u0434\u0440\u0443\u0433\u0430 \u0438 \u0441\u0430\u043c\u043e \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043c\u044b \u043f\u043b\u0430\u043d\u0438\u0440\u0443\u0435\u043c \u043e\u0442\u043f\u0440\u0430\u0432\u0438\u0442\u044c, \u043c\u044b \u0434\u043e\u043b\u0436\u043d\u044b \u043e\u0431\u0440\u0430\u0442\u0438\u0442\u044c\u0441\u044f \u043a API \u0441\u043d\u0430\u0447\u0430\u043b\u0430 HLE, \u0447\u0442\u043e\u0431\u044b \u0437\u0430\u0448\u0438\u0444\u0440\u043e\u0432\u0430\u0442\u044c \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435, \u0430 \u0434\u0430\u043b\u0435\u0435 \u043a API HLT, \u0447\u0442\u043e\u0431\u044b \u043e\u0442\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u043f\u043e\u043b\u0443\u0447\u0438\u0432\u0448\u0438\u0439\u0441\u044f \u0448\u0438\u0444\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0432 \u0441\u0435\u0442\u044c.<\/p>\n<pre><code class=\"python\">        ...                resp_hle = requests.post(             HLE_URL+\"\/api\/message\/encrypt\",              json={\"public_key\": friend, \"hex_data\": msg.encode(\"utf-8\").hex()}         )         if resp_hle.status_code != 200:             print(\"@ got response error from HLE (\/api\/message\/encrypt)\")             continue                   resp_hlt = requests.post(             HLT_URL+\"\/api\/network\/message\",              data=resp_hle.content         )         if resp_hlt.status_code != 200:             print(\"@ got response error from HLT (\/api\/network\/message)\")             continue     ...<\/code><\/pre>\n<p>\u0411\u043e\u043b\u0435\u0435 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e \u0441 API HLE \u0438 HLT \u043c\u043e\u0436\u043d\u043e \u043e\u0437\u043d\u0430\u043a\u043e\u043c\u0438\u0442\u044c\u0441\u044f \u0432 \u0438\u0445 README <a href=\"https:\/\/github.com\/number571\/go-peer\/tree\/master\/cmd\/hidden_lake\/helpers\/encryptor\" rel=\"noopener noreferrer nofollow\">\u0442\u0443\u0442<\/a> \u0438 <a href=\"https:\/\/github.com\/number571\/go-peer\/tree\/master\/cmd\/hidden_lake\/traffic\" rel=\"noopener noreferrer nofollow\">\u0437\u0434\u0435\u0441\u044c<\/a>. <\/p>\n<h3>3. \u0427\u0442\u0435\u043d\u0438\u0435 \u0438\u0437 \u0441\u0435\u0442\u0438<\/h3>\n<p>\u0427\u0442\u0435\u043d\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 \u0438\u0437 \u0441\u0435\u0442\u0438 \u0443\u0436\u0435 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0431\u043e\u043b\u0435\u0435 \u0441\u043b\u043e\u0436\u043d\u043e\u0439 \u0437\u0430\u0434\u0430\u0447\u0435\u0439, \u0447\u0435\u043c \u043e\u0431\u044b\u0447\u043d\u044b\u0439 \u0432\u0432\u043e\u0434, \u043d\u043e \u043d\u0435 \u0447\u0435\u043c-\u0442\u043e \u0441\u0432\u0435\u0440\u0445\u044a\u0435\u0441\u0442\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u043c. \u041f\u0440\u043e\u0441\u0442\u043e \u043d\u0430\u0434\u043e \u0431\u0443\u0434\u0435\u0442 \u0447\u0430\u0449\u0435 \u043e\u0431\u0440\u0430\u0449\u0430\u0442\u044c\u0441\u044f \u043a API HLT. <\/p>\n<p>\u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u043d\u0430\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043e\u0442 HLT \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0443 \u0442\u043e\u0433\u043e, \u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0441\u0430\u043c HLT \u0441\u0435\u0440\u0432\u0438\u0441 \u0441\u043f\u043e\u0441\u043e\u0431\u0435\u043d \u0445\u0440\u0430\u043d\u0438\u0442\u044c \u043d\u0430 \u0441\u0432\u043e\u0435\u0439 \u0441\u0442\u043e\u0440\u043e\u043d\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439 (<strong>messages_capacity<\/strong>). \u0422.\u043a. \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e HLT \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0442 \u0441\u043e\u0431\u043e\u0439 \u0434\u0435\u0446\u0435\u043d\u0442\u0440\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u0443\u044e \u0441\u0435\u0442\u044c, \u0442\u043e \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u043c\u043e\u0433\u0443\u0442 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0440\u0430\u0437\u043b\u0438\u0447\u0430\u0442\u044c\u0441\u044f. \u041a\u0442\u043e-\u0442\u043e \u043c\u043e\u0436\u0435\u0442 \u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0442\u044b\u0441\u044f\u0447\u0438 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439, \u0430 \u043a\u0442\u043e-\u0442\u043e \u043c\u0438\u043b\u043b\u0438\u043e\u043d. \u041f\u043e\u0441\u043b\u0435 \u043f\u0440\u0435\u0432\u044b\u0448\u0435\u043d\u0438\u044f \u0437\u0430\u0434\u0430\u043d\u043d\u043e\u0433\u043e \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430, \u0441\u0435\u0440\u0432\u0438\u0441 HLT \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442 \u043f\u0435\u0440\u0435\u0437\u0430\u0442\u0438\u0440\u0430\u0442\u044c \u0441\u0442\u0430\u0440\u044b\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f \u043d\u043e\u0432\u044b\u043c\u0438.  <\/p>\n<pre><code class=\"python\">...  import requests, json  def output_task():     # GET SETTING = MESSAGES_CAPACITY     resp_hlt = requests.get(         HLT_URL+\"\/api\/config\/settings\"     )     if resp_hlt.status_code != 200:         print(\"@ got response error from HLT (\/api\/config\/settings)\")         exit(1)          try:         messages_capacity = json.loads(resp_hlt.content)[\"messages_capacity\"]     except ValueError:         print(\"@ got response invalid data from HLT (\/api\/config\/settings)\")         exit(2)          ...<\/code><\/pre>\n<p>\u041f\u043e\u0441\u043b\u0435 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u044f, \u043d\u0430\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0432\u044b\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0442\u0435\u043a\u0443\u0449\u0438\u0439 <strong>\u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c<\/strong> (\u0432 \u0442\u0435\u0440\u043c\u0438\u043d\u043e\u043b\u043e\u0433\u0438\u0438 HL) \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0441\u0430\u043c HLT. \u0423\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c &#8212; \u044d\u0442\u043e \u0438\u043d\u0434\u0435\u043a\u0441 \u043f\u043e \u043c\u0430\u0441\u0441\u0438\u0432\u0443 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0442\u043e\u043b\u044c\u043a\u043e \u0443\u0432\u0435\u043b\u0438\u0447\u0438\u0432\u0430\u0435\u0442\u0441\u044f, \u043d\u043e \u0432 \u043a\u043e\u043b\u044c\u0446\u0435. \u0418\u043d\u044b\u043c\u0438 \u0441\u043b\u043e\u0432\u0430\u043c\u0438, \u0434\u043e\u0441\u0442\u0438\u0433\u0430\u044f messages_capacity, \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u0431\u0443\u0434\u0435\u0442 \u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c\u0441\u044f \u0432\u043d\u043e\u0432\u044c \u043d\u0443\u043b\u0435\u0432\u044b\u043c. \u041f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u043e\u0435 \u0438\u043d\u043a\u0440\u0435\u043c\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0444\u043e\u0440\u043c\u0443\u043b\u043e\u0439: <em>(i + 1) mod messages_capacity<\/em>.<\/p>\n<p>\u041f\u043e\u0441\u043b\u0435 \u0432\u044b\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f, \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0442\u044c \u043d\u0435 \u0441\u043c\u0435\u0441\u0442\u0438\u043b\u0441\u044f \u043b\u0438 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u043e\u0439 \u043d\u0430\u043c\u0438 \u0440\u0430\u043d\u0435\u0435 \u043f\u043e\u0437\u0438\u0446\u0438\u0438. \u0415\u0441\u043b\u0438 \u0441\u043c\u0435\u0441\u0442\u0438\u043b\u0441\u044f, \u0442\u043e \u043d\u0443\u0436\u043d\u043e \u0441\u0430\u043c\u043e\u0441\u0442\u043e\u044f\u0442\u0435\u043b\u044c\u043d\u043e \u0438\u043d\u043a\u0440\u0435\u043c\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u0434\u043e \u0442\u0435\u0445 \u043f\u043e\u0440, \u043f\u043e\u043a\u0430 \u043e\u043d \u043d\u0435 \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0432\u0435\u043d \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u043e\u043c\u0443. \u042d\u0442\u043e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0441 \u0442\u043e\u0439 \u043b\u0438\u0448\u044c \u0446\u0435\u043b\u044c\u044e, \u0447\u0442\u043e\u0431\u044b \u043f\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044e \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0445\u0435\u0448 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f, \u0430 \u0434\u0430\u043b\u0435\u0435 \u0438 \u0441\u0430\u043c\u043e \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435. \u0415\u0441\u043b\u0438 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u043d\u0435 \u0441\u043c\u0435\u0449\u0430\u0435\u0442\u0441\u044f, \u0442\u043e\u0433\u0434\u0430 \u043d\u0443\u0436\u043d\u043e \u0432\u044b\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u043b\u0438\u043c\u0438\u0442 \u043e\u0436\u0438\u0434\u0430\u043d\u0438\u044f \u043f\u0435\u0440\u0435\u0434 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u043c. \u0422\u0430\u043a\u043e\u0439 \u043b\u0438\u043c\u0438\u0442 \u043c\u043e\u0436\u043d\u043e \u0432\u044b\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0432 \u043e\u0434\u043d\u0443 \u0441\u0435\u043a\u0443\u043d\u0434\u0443.<\/p>\n<pre><code class=\"python\">import time   ...     ...        global_pointer = -1     while True:         # GET INITIAL POINTER OF MESSAGES         resp_hlt = requests.get(             HLT_URL+\"\/api\/storage\/pointer\"         )         if resp_hlt.status_code != 200:             print(\"@ got response error from HLT (\/api\/storage\/pointer)\")             time.sleep(1)             continue           try:             pointer =<\/code><\/pre>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\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-363839","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/363839","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=363839"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/363839\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=363839"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=363839"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=363839"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}