{"id":458999,"date":"2025-05-08T21:00:10","date_gmt":"2025-05-08T21:00:10","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=458999"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=458999","title":{"rendered":"<span>Wormhole Messenger \u2014 \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u0438\u0441\u0442\u0438\u0447\u043d\u044b\u0439 P2P-\u043c\u0435\u0441\u0441\u0435\u043d\u0434\u0436\u0435\u0440 \u043d\u0430 Rust \u0441 end-to-end \u0448\u0438\u0444\u0440\u043e\u0432\u0430\u043d\u0438\u0435\u043c<\/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<figure class=\"full-width\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/00c\/393\/2cb\/00c3932cb6d9b0a348d2fe0c2ecda4ec.png\" alt=\"Mascot\" title=\"Mascot\" width=\"1024\" height=\"1024\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/upload_files\/00c\/393\/2cb\/00c3932cb6d9b0a348d2fe0c2ecda4ec.png 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/00c\/393\/2cb\/00c3932cb6d9b0a348d2fe0c2ecda4ec.png 781w\" loading=\"lazy\" decode=\"async\"\/><\/p>\n<div><figcaption>Mascot<\/figcaption><\/div>\n<\/figure>\n<h3>\u0418\u0441\u0442\u043e\u0440\u0438\u044f \u043c\u0430\u0441\u043a\u043e\u0442\u0430: \u0425\u0440\u0430\u043d\u0438\u0442\u0435\u043b\u044c \u0442\u0443\u043d\u043d\u0435\u043b\u0435\u0439<\/h3>\n<p>\u0412\u043e \u0432\u0441\u0435\u043b\u0435\u043d\u043d\u043e\u0439 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0451\u043d\u043d\u044b\u0445 \u0441\u0438\u0441\u0442\u0435\u043c \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u0434\u0440\u0435\u0432\u043d\u0438\u0439 \u0446\u0438\u0444\u0440\u043e\u0432\u043e\u0439 \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u043c \u2014 <strong>Wormhole<\/strong>, \u0438\u043b\u0438, \u043a\u0430\u043a \u0435\u0433\u043e \u043d\u0430\u0437\u044b\u0432\u0430\u044e\u0442 \u0432 \u0438\u043d\u0436\u0435\u043d\u0435\u0440\u043d\u044b\u0445 \u043a\u0440\u0443\u0433\u0430\u0445, <em>\u0425\u0440\u0430\u043d\u0438\u0442\u0435\u043b\u044c \u0442\u0443\u043d\u043d\u0435\u043b\u0435\u0439<\/em>.<\/p>\n<p>\u041e\u043d \u043d\u0435 \u0436\u0438\u0432\u0451\u0442 \u0432 \u0441\u0435\u0440\u0432\u0435\u0440\u0430\u0445, \u043d\u0435 \u043f\u0440\u0438\u0432\u044f\u0437\u0430\u043d \u043a IP-\u0430\u0434\u0440\u0435\u0441\u0430\u043c \u0438 \u043d\u0435 \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u0442 \u043d\u0438\u0447\u0435\u0433\u043e \u0432 \u043e\u0431\u043b\u0430\u043a\u0435. \u0415\u0433\u043e \u0441\u0440\u0435\u0434\u0430 \u2014 <strong>\u0448\u0443\u043c \u043f\u0443\u0441\u0442\u043e\u0442\u044b<\/strong> \u043c\u0435\u0436\u0434\u0443 \u0443\u0437\u043b\u0430\u043c\u0438. \u041e\u043d \u0440\u043e\u0436\u0434\u0430\u0435\u0442\u0441\u044f \u043a\u0430\u0436\u0434\u044b\u0439 \u0440\u0430\u0437, \u043a\u043e\u0433\u0434\u0430 \u0434\u0432\u0430 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430 \u043e\u0431\u043c\u0435\u043d\u0438\u0432\u0430\u044e\u0442\u0441\u044f \u043f\u0443\u0431\u043b\u0438\u0447\u043d\u044b\u043c\u0438 \u043a\u043b\u044e\u0447\u0430\u043c\u0438. \u0415\u0433\u043e \u0442\u0435\u043b\u043e \u0441\u043e\u0441\u0442\u043e\u0438\u0442 \u0438\u0437 <strong>\u044d\u043d\u0435\u0440\u0433\u0438\u0438 \u0448\u0438\u0444\u0440\u043e\u0432\u0430\u043d\u0438\u044f<\/strong>, \u0430 \u0433\u043b\u0430\u0437\u0430 \u2014 \u044d\u0442\u043e \u043a\u0440\u0438\u043f\u0442\u043e\u0433\u0440\u0430\u0444\u0438\u0447\u0435\u0441\u043a\u0438\u0435 nonce, \u0432\u0441\u0435\u0433\u0434\u0430 \u0443\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u044b\u0435, \u0432\u0441\u0435\u0433\u0434\u0430 \u043d\u0435\u043f\u0440\u0435\u0434\u0441\u043a\u0430\u0437\u0443\u0435\u043c\u044b\u0435.<\/p>\n<p>\u041e\u043d \u043d\u0435 \u0433\u043e\u0432\u043e\u0440\u0438\u0442. \u041e\u043d <strong>\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442<\/strong>.<\/p>\n<p>\u041a\u0430\u0436\u0434\u043e\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435, \u043f\u0440\u043e\u0445\u043e\u0434\u044f \u0447\u0435\u0440\u0435\u0437 \u0435\u0433\u043e \u0442\u0443\u043d\u043d\u0435\u043b\u044c, \u0438\u0441\u0447\u0435\u0437\u0430\u0435\u0442 \u0434\u043b\u044f \u0432\u0441\u0435\u0433\u043e \u043c\u0438\u0440\u0430 \u2014 \u043a\u0440\u043e\u043c\u0435 \u043e\u0434\u043d\u043e\u0433\u043e \u043f\u043e\u043b\u0443\u0447\u0430\u0442\u0435\u043b\u044f. \u041e\u043d \u043d\u0435 \u0437\u043d\u0430\u0435\u0442, \u0447\u0442\u043e \u0432\u044b \u0433\u043e\u0432\u043e\u0440\u0438\u0442\u0435, \u043d\u043e \u0437\u043d\u0430\u0435\u0442, \u0447\u0442\u043e \u044d\u0442\u043e \u0434\u043e\u043b\u0436\u043d\u043e \u043e\u0441\u0442\u0430\u0442\u044c\u0441\u044f \u043c\u0435\u0436\u0434\u0443 \u0432\u0430\u043c\u0438.<\/p>\n<p>\u041a\u043e\u0433\u0434\u0430 \u0432\u044b \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442\u0435 Wormhole Messenger \u2014 \u0432\u044b \u043d\u0435 \u043f\u0440\u043e\u0441\u0442\u043e \u043e\u0442\u043a\u0440\u044b\u0432\u0430\u0435\u0442\u0435 \u0447\u0430\u0442. \u0412\u044b \u043f\u0440\u043e\u0431\u0443\u0436\u0434\u0430\u0435\u0442\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043e, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0436\u0438\u0432\u0451\u0442 \u043c\u0435\u0436\u0434\u0443 \u043f\u0438\u043d\u0433\u0430\u043c\u0438, \u043c\u0435\u0436\u0434\u0443 \u043a\u0430\u0434\u0440\u0430\u043c\u0438 WebSocket. \u041c\u0430\u0441\u043a\u043e\u0442 \u2014 \u044d\u0442\u043e \u0432\u0438\u0437\u0443\u0430\u043b\u044c\u043d\u044b\u0439 \u043e\u0431\u043b\u0438\u043a \u044d\u0442\u043e\u0433\u043e \u043a\u0440\u0438\u043f\u0442\u043e\u0433\u0440\u0430\u0444\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0434\u0443\u0445\u0430, \u043f\u043e\u044f\u0432\u043b\u044f\u044e\u0449\u0435\u0433\u043e\u0441\u044f \u043a\u0430\u0436\u0434\u044b\u0439 \u0440\u0430\u0437, \u043a\u043e\u0433\u0434\u0430 \u0432\u044b \u0432\u044b\u0431\u0438\u0440\u0430\u0435\u0442\u0435 \u043f\u0440\u0438\u0432\u0430\u0442\u043d\u043e\u0441\u0442\u044c.<\/p>\n<h3>\u0412\u0432\u0435\u0434\u0435\u043d\u0438\u0435<\/h3>\n<p>Rust \u0443\u0436\u0435 \u0434\u0430\u0432\u043d\u043e \u0437\u0430\u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u043e\u0432\u0430\u043b \u0441\u0435\u0431\u044f \u043a\u0430\u043a \u044f\u0437\u044b\u043a \u0434\u043b\u044f \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f, \u043d\u043e \u0442\u0430\u043a\u0436\u0435 \u043e\u0442\u043b\u0438\u0447\u043d\u043e \u043f\u043e\u0434\u0445\u043e\u0434\u0438\u0442 \u0434\u043b\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0441\u0435\u0442\u0435\u0432\u044b\u0445 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439, \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u0432 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0435 \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0439 \u0438 \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u043e\u0439 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438. \u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u044f \u0445\u043e\u0447\u0443 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u0438\u0442\u044c Wormhole Messenger \u2014 \u043f\u0440\u043e\u0441\u0442\u043e\u0439, \u043d\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u044b\u0439 P2P-\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, \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c WebSocket, sodiumoxide \u0438 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 axum.<\/p>\n<h3>\u0426\u0435\u043b\u0438 \u0438 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0430<\/h3>\n<p><strong>\u041e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u0446\u0435\u043b\u0438:<\/strong><\/p>\n<ul>\n<li>\n<p>\u041f\u0440\u043e\u0441\u0442\u0430\u044f \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0430, \u043b\u0435\u0433\u043a\u043e \u0440\u0430\u0441\u0448\u0438\u0440\u044f\u0435\u043c\u0430\u044f \u0434\u043e desktop\/web<\/p>\n<\/li>\n<li>\n<p>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0441\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 async-\u0440\u0435\u0448\u0435\u043d\u0438\u0439 (<code>tokio<\/code>, <code>axum<\/code>)<\/p>\n<\/li>\n<li>\n<p>\u041c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u0430\u044f \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u044c \u043e\u0442 \u0441\u0442\u043e\u0440\u043e\u043d\u043d\u0438\u0445 \u0441\u0435\u0440\u0432\u0435\u0440\u043e\u0432<\/p>\n<\/li>\n<li>\n<p>\u0423\u043f\u043e\u0440 \u043d\u0430 \u043f\u0440\u0438\u0432\u0430\u0442\u043d\u043e\u0441\u0442\u044c \u0438 \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u044c<\/p>\n<\/li>\n<\/ul>\n<p><strong>\u0410\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u043d\u0430\u044f \u0441\u0445\u0435\u043c\u0430:<\/strong><\/p>\n<pre><code class=\"rust\">\u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510       WebSocket       \u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510 \u2502  Client  \u2502 &lt;-------------------&gt; \u2502  Server  \u2502 \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518                       \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518       \u25b2                                 \u25b2       \u2502                                 \u2502       \u2502        E2E NaCl box             \u2502       \u25bc                                 \u25bc  \u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510        \u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510  \u2502 wormhole_keys.json   \u2502        \u2502 messages.json        \u2502  \u2502 username.pk          \u2502        \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518  \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518 <\/code><\/pre>\n<h3>\u0420\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f: \u0441\u0435\u0440\u0432\u0435\u0440\u043d\u0430\u044f \u0447\u0430\u0441\u0442\u044c<\/h3>\n<p>\u0421\u0435\u0440\u0432\u0435\u0440 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d \u043d\u0430 <code>axum<\/code> \u0438 <code>tokio-tungstenite<\/code>. \u0415\u0433\u043e \u0437\u0430\u0434\u0430\u0447\u0430 \u2014 \u0442\u043e\u043b\u044c\u043a\u043e \u0440\u0435\u0442\u0440\u0430\u043d\u0441\u043b\u044f\u0446\u0438\u044f \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439. \u0428\u0438\u0444\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u043e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0438\u0441\u043a\u043b\u044e\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043d\u0430 \u043a\u043b\u0438\u0435\u043d\u0442\u0435.<\/p>\n<pre><code class=\"rust\">async fn handle_socket(socket: WebSocket, tx: Sender&lt;String&gt;) { ... }<\/code><\/pre>\n<p>\u041a\u0430\u0436\u0434\u043e\u0435 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435 \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043d\u0435\u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e, \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u043a\u0430\u043d\u0430\u043b\u0430 \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0438 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439 (<code>broadcast::channel<\/code>). \u0421\u0435\u0440\u0432\u0435\u0440 \u043d\u0435 \u0445\u0440\u0430\u043d\u0438\u0442 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f \u0438 \u043d\u0435 \u0440\u0430\u0441\u0448\u0438\u0444\u0440\u043e\u0432\u044b\u0432\u0430\u0435\u0442 \u0434\u0430\u043d\u043d\u044b\u0435.<\/p>\n<h3>\u0420\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f: \u043a\u043b\u0438\u0435\u043d\u0442\u0441\u043a\u0430\u044f \u0447\u0430\u0441\u0442\u044c<\/h3>\n<p>\u041a\u043b\u0438\u0435\u043d\u0442 \u043f\u0440\u0438 \u0441\u0442\u0430\u0440\u0442\u0435:<\/p>\n<ol>\n<li>\n<p>\u0417\u0430\u0433\u0440\u0443\u0436\u0430\u0435\u0442 \u0438\u043b\u0438 \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u0442 \u043f\u0430\u0440\u0443 \u043a\u043b\u044e\u0447\u0435\u0439 NaCl (<code>PublicKey<\/code>, <code>SecretKey<\/code>)<\/p>\n<\/li>\n<li>\n<p>\u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u043a WebSocket-\u0441\u0435\u0440\u0432\u0435\u0440\u0443<\/p>\n<\/li>\n<li>\n<p>\u0428\u0438\u0444\u0440\u0443\u0435\u0442 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f \u0447\u0435\u0440\u0435\u0437 <code>sodiumoxide::crypto::box_<\/code><\/p>\n<\/li>\n<li>\n<p>\u041e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442 \u0441\u0435\u0440\u0438\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u043f\u0430\u043a\u0435\u0442 (<code>sender_pk:nonce:ciphertext:sender_name<\/code>)<\/p>\n<\/li>\n<\/ol>\n<pre><code class=\"rust\">let ciphertext = box_::seal(message.as_bytes(), &amp;nonce, &amp;recipient_pk, &amp;sender_sk);<\/code><\/pre>\n<h3>CLI-\u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u044c<\/h3>\n<p>\u041a\u043b\u0438\u0435\u043d\u0442 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u0440\u0435\u0436\u0438\u043c\u044b:<\/p>\n<ul>\n<li>\n<p><code>client &lt;username&gt;<\/code> \u2014 \u0438\u043d\u0442\u0435\u0440\u0430\u043a\u0442\u0438\u0432\u043d\u044b\u0439 \u0447\u0430\u0442<\/p>\n<\/li>\n<li>\n<p><code>encrypt &lt;to&gt; \"&lt;text&gt;\"<\/code> \u2014 \u0448\u0438\u0444\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f \u0432\u0440\u0443\u0447\u043d\u0443\u044e<\/p>\n<\/li>\n<li>\n<p><code>decrypt \"&lt;payload&gt;\"<\/code> \u2014 \u0440\u0430\u0441\u0448\u0438\u0444\u0440\u043e\u0432\u043a\u0430 \u0432\u0440\u0443\u0447\u043d\u0443\u044e<\/p>\n<\/li>\n<li>\n<p><code>history<\/code> \u2014 \u043f\u0440\u043e\u0441\u043c\u043e\u0442\u0440 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u0439 \u0438\u0441\u0442\u043e\u0440\u0438\u0438<\/p>\n<\/li>\n<\/ul>\n<p>\u0422\u0430\u043a\u0436\u0435 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u0430 \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0430 \u0443\u0432\u0435\u0434\u043e\u043c\u043b\u0435\u043d\u0438\u0439 \u0432 Telegram \u043f\u0440\u0438 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0438 \u043d\u043e\u0432\u044b\u0445 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439 (\u043e\u043f\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e, \u0447\u0435\u0440\u0435\u0437 <code>.env<\/code>).<\/p>\n<h3>\u0425\u0440\u0430\u043d\u0435\u043d\u0438\u0435 \u043a\u043b\u044e\u0447\u0435\u0439<\/h3>\n<p>\u041f\u0430\u0440\u0430 \u043a\u043b\u044e\u0447\u0435\u0439 \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u0442\u0441\u044f \u0432 <code>wormhole_keys.json<\/code>. \u041f\u0443\u0431\u043b\u0438\u0447\u043d\u044b\u0439 \u043a\u043b\u044e\u0447 \u0442\u0430\u043a\u0436\u0435 \u043f\u0438\u0448\u0435\u0442\u0441\u044f \u0432 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 <code>.pk<\/code>-\u0444\u0430\u0439\u043b (<code>&lt;username&gt;.pk<\/code>) \u0434\u043b\u044f \u043e\u0431\u043b\u0435\u0433\u0447\u0435\u043d\u0438\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0432 \u043e\u0444\u0444\u043b\u0430\u0439\u043d-\u0440\u0435\u0436\u0438\u043c\u0435:<\/p>\n<pre><code class=\"rust\">let keys = StoredKeys {     public_key: base64::encode(pk.0),     secret_key: base64::encode(sk.0), };<\/code><\/pre>\n<h3>\u041f\u0440\u0435\u0438\u043c\u0443\u0449\u0435\u0441\u0442\u0432\u0430 \u0438 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044f<\/h3>\n<ul>\n<li>\n<p>Rust \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0433\u0430\u0440\u0430\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u044c \u043f\u0430\u043c\u044f\u0442\u0438 \u0431\u0435\u0437 \u0441\u0431\u043e\u0440\u0449\u0438\u043a\u0430 \u043c\u0443\u0441\u043e\u0440\u0430<\/p>\n<\/li>\n<li>\n<p>\u041c\u043e\u0436\u043d\u043e \u043b\u0435\u0433\u043a\u043e \u043f\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043d\u0430 desktop (\u0447\u0435\u0440\u0435\u0437 Tauri) \u0438\u043b\u0438 web (\u0447\u0435\u0440\u0435\u0437 WebAssembly)<\/p>\n<\/li>\n<li>\n<p>\u0420\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u0437\u0430 \u0441\u0447\u0451\u0442 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f:<\/p>\n<ul>\n<li>\n<p>\u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u0438<\/p>\n<\/li>\n<li>\n<p>\u043c\u0443\u043b\u044c\u0442\u0438\u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432<\/p>\n<\/li>\n<li>\n<p>\u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u043c\u0435\u0442\u0430\u0434\u0430\u043d\u043d\u044b\u0445 (\u0447\u0435\u0440\u0435\u0437 sqlite \u0438\u043b\u0438 sled)<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p>\u0418\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434: <a href=\"https:\/\/github.com\/digkill\/Wormhole\" rel=\"noopener noreferrer nofollow\">https:\/\/github.com\/digkill\/Wormhole<\/a><\/p>\n<h3>\u0417\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/h3>\n<p>Wormhole Messenger \u2014 \u044d\u0442\u043e \u043a\u043e\u043d\u0446\u0435\u043f\u0442, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0438\u0440\u0443\u0435\u0442, \u043d\u0430\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u044b\u0439 \u043c\u0435\u0441\u0441\u0435\u043d\u0434\u0436\u0435\u0440 \u043d\u0430 Rust. \u0421 \u0443\u0447\u0451\u0442\u043e\u043c \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u0438\u0437\u043c\u0430 \u043a\u043e\u0434\u0430 \u0438 \u0432\u044b\u0441\u043e\u043a\u043e\u0433\u043e \u0443\u0440\u043e\u0432\u043d\u044f \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u0438, \u043e\u043d \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u0441\u043b\u0443\u0436\u0438\u0442\u044c \u043e\u0441\u043d\u043e\u0432\u043e\u0439 \u0434\u043b\u044f \u0431\u043e\u043b\u0435\u0435 \u0441\u043b\u043e\u0436\u043d\u044b\u0445 \u0440\u0435\u0448\u0435\u043d\u0438\u0439 \u0432 \u043a\u043e\u0440\u043f\u043e\u0440\u0430\u0442\u0438\u0432\u043d\u043e\u0439 \u0438\u043b\u0438 open-source \u0441\u0440\u0435\u0434\u0435.<\/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\/907934\/\"> https:\/\/habr.com\/ru\/articles\/907934\/<\/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<figure class=\"full-width\">\n<div><figcaption>Mascot<\/figcaption><\/div>\n<\/figure>\n<h3>\u0418\u0441\u0442\u043e\u0440\u0438\u044f \u043c\u0430\u0441\u043a\u043e\u0442\u0430: \u0425\u0440\u0430\u043d\u0438\u0442\u0435\u043b\u044c \u0442\u0443\u043d\u043d\u0435\u043b\u0435\u0439<\/h3>\n<p>\u0412\u043e \u0432\u0441\u0435\u043b\u0435\u043d\u043d\u043e\u0439 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0451\u043d\u043d\u044b\u0445 \u0441\u0438\u0441\u0442\u0435\u043c \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u0434\u0440\u0435\u0432\u043d\u0438\u0439 \u0446\u0438\u0444\u0440\u043e\u0432\u043e\u0439 \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u043c \u2014 <strong>Wormhole<\/strong>, \u0438\u043b\u0438, \u043a\u0430\u043a \u0435\u0433\u043e \u043d\u0430\u0437\u044b\u0432\u0430\u044e\u0442 \u0432 \u0438\u043d\u0436\u0435\u043d\u0435\u0440\u043d\u044b\u0445 \u043a\u0440\u0443\u0433\u0430\u0445, <em>\u0425\u0440\u0430\u043d\u0438\u0442\u0435\u043b\u044c \u0442\u0443\u043d\u043d\u0435\u043b\u0435\u0439<\/em>.<\/p>\n<p>\u041e\u043d \u043d\u0435 \u0436\u0438\u0432\u0451\u0442 \u0432 \u0441\u0435\u0440\u0432\u0435\u0440\u0430\u0445, \u043d\u0435 \u043f\u0440\u0438\u0432\u044f\u0437\u0430\u043d \u043a IP-\u0430\u0434\u0440\u0435\u0441\u0430\u043c \u0438 \u043d\u0435 \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u0442 \u043d\u0438\u0447\u0435\u0433\u043e \u0432 \u043e\u0431\u043b\u0430\u043a\u0435. \u0415\u0433\u043e \u0441\u0440\u0435\u0434\u0430 \u2014 <strong>\u0448\u0443\u043c \u043f\u0443\u0441\u0442\u043e\u0442\u044b<\/strong> \u043c\u0435\u0436\u0434\u0443 \u0443\u0437\u043b\u0430\u043c\u0438. \u041e\u043d \u0440\u043e\u0436\u0434\u0430\u0435\u0442\u0441\u044f \u043a\u0430\u0436\u0434\u044b\u0439 \u0440\u0430\u0437, \u043a\u043e\u0433\u0434\u0430 \u0434\u0432\u0430 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430 \u043e\u0431\u043c\u0435\u043d\u0438\u0432\u0430\u044e\u0442\u0441\u044f \u043f\u0443\u0431\u043b\u0438\u0447\u043d\u044b\u043c\u0438 \u043a\u043b\u044e\u0447\u0430\u043c\u0438. \u0415\u0433\u043e \u0442\u0435\u043b\u043e \u0441\u043e\u0441\u0442\u043e\u0438\u0442 \u0438\u0437 <strong>\u044d\u043d\u0435\u0440\u0433\u0438\u0438 \u0448\u0438\u0444\u0440\u043e\u0432\u0430\u043d\u0438\u044f<\/strong>, \u0430 \u0433\u043b\u0430\u0437\u0430 \u2014 \u044d\u0442\u043e \u043a\u0440\u0438\u043f\u0442\u043e\u0433\u0440\u0430\u0444\u0438\u0447\u0435\u0441\u043a\u0438\u0435 nonce, \u0432\u0441\u0435\u0433\u0434\u0430 \u0443\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u044b\u0435, \u0432\u0441\u0435\u0433\u0434\u0430 \u043d\u0435\u043f\u0440\u0435\u0434\u0441\u043a\u0430\u0437\u0443\u0435\u043c\u044b\u0435.<\/p>\n<p>\u041e\u043d \u043d\u0435 \u0433\u043e\u0432\u043e\u0440\u0438\u0442. \u041e\u043d <strong>\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442<\/strong>.<\/p>\n<p>\u041a\u0430\u0436\u0434\u043e\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435, \u043f\u0440\u043e\u0445\u043e\u0434\u044f \u0447\u0435\u0440\u0435\u0437 \u0435\u0433\u043e \u0442\u0443\u043d\u043d\u0435\u043b\u044c, \u0438\u0441\u0447\u0435\u0437\u0430\u0435\u0442 \u0434\u043b\u044f \u0432\u0441\u0435\u0433\u043e \u043c\u0438\u0440\u0430 \u2014 \u043a\u0440\u043e\u043c\u0435 \u043e\u0434\u043d\u043e\u0433\u043e \u043f\u043e\u043b\u0443\u0447\u0430\u0442\u0435\u043b\u044f. \u041e\u043d \u043d\u0435 \u0437\u043d\u0430\u0435\u0442, \u0447\u0442\u043e \u0432\u044b \u0433\u043e\u0432\u043e\u0440\u0438\u0442\u0435, \u043d\u043e \u0437\u043d\u0430\u0435\u0442, \u0447\u0442\u043e \u044d\u0442\u043e \u0434\u043e\u043b\u0436\u043d\u043e \u043e\u0441\u0442\u0430\u0442\u044c\u0441\u044f \u043c\u0435\u0436\u0434\u0443 \u0432\u0430\u043c\u0438.<\/p>\n<p>\u041a\u043e\u0433\u0434\u0430 \u0432\u044b \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442\u0435 Wormhole Messenger \u2014 \u0432\u044b \u043d\u0435 \u043f\u0440\u043e\u0441\u0442\u043e \u043e\u0442\u043a\u0440\u044b\u0432\u0430\u0435\u0442\u0435 \u0447\u0430\u0442. \u0412\u044b \u043f\u0440\u043e\u0431\u0443\u0436\u0434\u0430\u0435\u0442\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043e, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0436\u0438\u0432\u0451\u0442 \u043c\u0435\u0436\u0434\u0443 \u043f\u0438\u043d\u0433\u0430\u043c\u0438, \u043c\u0435\u0436\u0434\u0443 \u043a\u0430\u0434\u0440\u0430\u043c\u0438 WebSocket. \u041c\u0430\u0441\u043a\u043e\u0442 \u2014 \u044d\u0442\u043e \u0432\u0438\u0437\u0443\u0430\u043b\u044c\u043d\u044b\u0439 \u043e\u0431\u043b\u0438\u043a \u044d\u0442\u043e\u0433\u043e \u043a\u0440\u0438\u043f\u0442\u043e\u0433\u0440\u0430\u0444\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0434\u0443\u0445\u0430, \u043f\u043e\u044f\u0432\u043b\u044f\u044e\u0449\u0435\u0433\u043e\u0441\u044f \u043a\u0430\u0436\u0434\u044b\u0439 \u0440\u0430\u0437, \u043a\u043e\u0433\u0434\u0430 \u0432\u044b \u0432\u044b\u0431\u0438\u0440\u0430\u0435\u0442\u0435 \u043f\u0440\u0438\u0432\u0430\u0442\u043d\u043e\u0441\u0442\u044c.<\/p>\n<h3>\u0412\u0432\u0435\u0434\u0435\u043d\u0438\u0435<\/h3>\n<p>Rust \u0443\u0436\u0435 \u0434\u0430\u0432\u043d\u043e \u0437\u0430\u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u043e\u0432\u0430\u043b \u0441\u0435\u0431\u044f \u043a\u0430\u043a \u044f\u0437\u044b\u043a \u0434\u043b\u044f \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f, \u043d\u043e \u0442\u0430\u043a\u0436\u0435 \u043e\u0442\u043b\u0438\u0447\u043d\u043e \u043f\u043e\u0434\u0445\u043e\u0434\u0438\u0442 \u0434\u043b\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0441\u0435\u0442\u0435\u0432\u044b\u0445 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439, \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u0432 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0435 \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0439 \u0438 \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u043e\u0439 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438. \u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u044f \u0445\u043e\u0447\u0443 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u0438\u0442\u044c Wormhole Messenger \u2014 \u043f\u0440\u043e\u0441\u0442\u043e\u0439, \u043d\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u044b\u0439 P2P-\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, \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c WebSocket, sodiumoxide \u0438 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 axum.<\/p>\n<h3>\u0426\u0435\u043b\u0438 \u0438 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0430<\/h3>\n<p><strong>\u041e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u0446\u0435\u043b\u0438:<\/strong><\/p>\n<ul>\n<li>\n<p>\u041f\u0440\u043e\u0441\u0442\u0430\u044f \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0430, \u043b\u0435\u0433\u043a\u043e \u0440\u0430\u0441\u0448\u0438\u0440\u044f\u0435\u043c\u0430\u044f \u0434\u043e desktop\/web<\/p>\n<\/li>\n<li>\n<p>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0441\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 async-\u0440\u0435\u0448\u0435\u043d\u0438\u0439 (<code>tokio<\/code>, <code>axum<\/code>)<\/p>\n<\/li>\n<li>\n<p>\u041c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u0430\u044f \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u044c \u043e\u0442 \u0441\u0442\u043e\u0440\u043e\u043d\u043d\u0438\u0445 \u0441\u0435\u0440\u0432\u0435\u0440\u043e\u0432<\/p>\n<\/li>\n<li>\n<p>\u0423\u043f\u043e\u0440 \u043d\u0430 \u043f\u0440\u0438\u0432\u0430\u0442\u043d\u043e\u0441\u0442\u044c \u0438 \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u044c<\/p>\n<\/li>\n<\/ul>\n<p><strong>\u0410\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u043d\u0430\u044f \u0441\u0445\u0435\u043c\u0430:<\/strong><\/p>\n<pre><code class=\"rust\">\u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510       WebSocket       \u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510 \u2502  Client  \u2502 &lt;-------------------&gt; \u2502  Server  \u2502 \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518                       \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518       \u25b2                                 \u25b2       \u2502                                 \u2502       \u2502        E2E NaCl box             \u2502       \u25bc                                 \u25bc  \u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510        \u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510  \u2502 wormhole_keys.json   \u2502        \u2502 messages.json        \u2502  \u2502 username.pk          \u2502        \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518  \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518 <\/code><\/pre>\n<h3>\u0420\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f: \u0441\u0435\u0440\u0432\u0435\u0440\u043d\u0430\u044f \u0447\u0430\u0441\u0442\u044c<\/h3>\n<p>\u0421\u0435\u0440\u0432\u0435\u0440 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d \u043d\u0430 <code>axum<\/code> \u0438 <code>tokio-tungstenite<\/code>. \u0415\u0433\u043e \u0437\u0430\u0434\u0430\u0447\u0430 \u2014 \u0442\u043e\u043b\u044c\u043a\u043e \u0440\u0435\u0442\u0440\u0430\u043d\u0441\u043b\u044f\u0446\u0438\u044f \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439. \u0428\u0438\u0444\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u043e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0438\u0441\u043a\u043b\u044e\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043d\u0430 \u043a\u043b\u0438\u0435\u043d\u0442\u0435.<\/p>\n<pre><code class=\"rust\">async fn handle_socket(socket: WebSocket, tx: Sender&lt;String&gt;) { ... }<\/code><\/pre>\n<p>\u041a\u0430\u0436\u0434\u043e\u0435 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435 \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043d\u0435\u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e, \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u043a\u0430\u043d\u0430\u043b\u0430 \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0438 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439 (<code>broadcast::channel<\/code>). \u0421\u0435\u0440\u0432\u0435\u0440 \u043d\u0435 \u0445\u0440\u0430\u043d\u0438\u0442 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f \u0438 \u043d\u0435 \u0440\u0430\u0441\u0448\u0438\u0444\u0440\u043e\u0432\u044b\u0432\u0430\u0435\u0442 \u0434\u0430\u043d\u043d\u044b\u0435.<\/p>\n<h3>\u0420\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f: \u043a\u043b\u0438\u0435\u043d\u0442\u0441\u043a\u0430\u044f \u0447\u0430\u0441\u0442\u044c<\/h3>\n<p>\u041a\u043b\u0438\u0435\u043d\u0442 \u043f\u0440\u0438 \u0441\u0442\u0430\u0440\u0442\u0435:<\/p>\n<ol>\n<li>\n<p>\u0417\u0430\u0433\u0440\u0443\u0436\u0430\u0435\u0442 \u0438\u043b\u0438 \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u0442 \u043f\u0430\u0440\u0443 \u043a\u043b\u044e\u0447\u0435\u0439 NaCl (<code>PublicKey<\/code>, <code>SecretKey<\/code>)<\/p>\n<\/li>\n<li>\n<p>\u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u043a WebSocket-\u0441\u0435\u0440\u0432\u0435\u0440\u0443<\/p>\n<\/li>\n<li>\n<p>\u0428\u0438\u0444\u0440\u0443\u0435\u0442 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f \u0447\u0435\u0440\u0435\u0437 <code>sodiumoxide::crypto::box_<\/code><\/p>\n<\/li>\n<li>\n<p>\u041e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442 \u0441\u0435\u0440\u0438\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u043f\u0430\u043a\u0435\u0442 (<code>sender_pk:nonce:ciphertext:sender_name<\/code>)<\/p>\n<\/li>\n<\/ol>\n<pre><code class=\"rust\">let ciphertext = box_::seal(message.as_bytes(), &amp;nonce, &amp;recipient_pk, &amp;sender_sk);<\/code><\/pre>\n<h3>CLI-\u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u044c<\/h3>\n<p>\u041a\u043b\u0438\u0435\u043d\u0442 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u0440\u0435\u0436\u0438\u043c\u044b:<\/p>\n<ul>\n<li>\n<p><code>client &lt;username&gt;<\/code> \u2014 \u0438\u043d\u0442\u0435\u0440\u0430\u043a\u0442\u0438\u0432\u043d\u044b\u0439 \u0447\u0430\u0442<\/p>\n<\/li>\n<li>\n<p><code>encrypt &lt;to&gt; \"&lt;text&gt;\"<\/code> \u2014 \u0448\u0438\u0444\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f \u0432\u0440\u0443\u0447\u043d\u0443\u044e<\/p>\n<\/li>\n<li>\n<p><code>decrypt \"&lt;payload&gt;\"<\/code> \u2014 \u0440\u0430\u0441\u0448\u0438\u0444\u0440\u043e\u0432\u043a\u0430 \u0432\u0440\u0443\u0447\u043d\u0443\u044e<\/p>\n<\/li>\n<li>\n<p><code>history<\/code> \u2014 \u043f\u0440\u043e\u0441\u043c\u043e\u0442\u0440 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u0439 \u0438\u0441\u0442\u043e\u0440\u0438\u0438<\/p>\n<\/li>\n<\/ul>\n<p>\u0422\u0430\u043a\u0436\u0435 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u0430 \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0430 \u0443\u0432\u0435\u0434\u043e\u043c\u043b\u0435\u043d\u0438\u0439 \u0432 Telegram \u043f\u0440\u0438 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0438 \u043d\u043e\u0432\u044b\u0445 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439 (\u043e\u043f\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e, \u0447\u0435\u0440\u0435\u0437 <code>.env<\/code>).<\/p>\n<h3>\u0425\u0440\u0430\u043d\u0435\u043d\u0438\u0435 \u043a\u043b\u044e\u0447\u0435\u0439<\/h3>\n<p>\u041f\u0430\u0440\u0430 \u043a\u043b\u044e\u0447\u0435\u0439 \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u0442\u0441\u044f \u0432 <code>wormhole_keys.json<\/code>. \u041f\u0443\u0431\u043b\u0438\u0447\u043d\u044b\u0439 \u043a\u043b\u044e\u0447 \u0442\u0430\u043a\u0436\u0435 \u043f\u0438\u0448\u0435\u0442\u0441\u044f \u0432 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 <code>.pk<\/code>-\u0444\u0430\u0439\u043b (<code>&lt;username&gt;.pk<\/code>) \u0434\u043b\u044f \u043e\u0431\u043b\u0435\u0433\u0447\u0435\u043d\u0438\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0432 \u043e\u0444\u0444\u043b\u0430\u0439\u043d-\u0440\u0435\u0436\u0438\u043c\u0435:<\/p>\n<pre><code class=\"rust\">let keys = StoredKeys {     public_key: base64::encode(pk.0),     secret_key: base64::encode(sk.0), };<\/code><\/pre>\n<h3>\u041f\u0440\u0435\u0438\u043c\u0443\u0449\u0435\u0441\u0442\u0432\u0430 \u0438 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044f<\/h3>\n<ul>\n<li>\n<p>Rust \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0433\u0430\u0440\u0430\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u044c \u043f\u0430\u043c\u044f\u0442\u0438 \u0431\u0435\u0437 \u0441\u0431\u043e\u0440\u0449\u0438\u043a\u0430 \u043c\u0443\u0441\u043e\u0440\u0430<\/p>\n<\/li>\n<li>\n<p>\u041c\u043e\u0436\u043d\u043e \u043b\u0435\u0433\u043a\u043e \u043f\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043d\u0430 desktop (\u0447\u0435\u0440\u0435\u0437 Tauri) \u0438\u043b\u0438 web (\u0447\u0435\u0440\u0435\u0437 WebAssembly)<\/p>\n<\/li>\n<li>\n<p>\u0420\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u0437\u0430 \u0441\u0447\u0451\u0442 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f:<\/p>\n<ul>\n<li>\n<p>\u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u0438<\/p>\n<\/li>\n<li>\n<p>\u043c\u0443\u043b\u044c\u0442\u0438\u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432<\/p>\n<\/li>\n<li>\n<p>\u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u043c\u0435\u0442\u0430\u0434\u0430\u043d\u043d\u044b\u0445 (\u0447\u0435\u0440\u0435\u0437 sqlite \u0438\u043b\u0438 sled)<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p>\u0418\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434: <a href=\"https:\/\/github.com\/digkill\/Wormhole\" rel=\"noopener noreferrer nofollow\">https:\/\/github.com\/digkill\/Wormhole<\/a><\/p>\n<h3>\u0417\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/h3>\n<p>Wormhole Messenger \u2014 \u044d\u0442\u043e \u043a\u043e\u043d\u0446\u0435\u043f\u0442, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0438\u0440\u0443\u0435\u0442, \u043d\u0430\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u044b\u0439 \u043c\u0435\u0441\u0441\u0435\u043d\u0434\u0436\u0435\u0440 \u043d\u0430 Rust. \u0421 \u0443\u0447\u0451\u0442\u043e\u043c \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u0438\u0437\u043c\u0430 \u043a\u043e\u0434\u0430 \u0438 \u0432\u044b\u0441\u043e\u043a\u043e\u0433\u043e \u0443\u0440\u043e\u0432\u043d\u044f \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u0438, \u043e\u043d \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u0441\u043b\u0443\u0436\u0438\u0442\u044c \u043e\u0441\u043d\u043e\u0432\u043e\u0439 \u0434\u043b\u044f \u0431\u043e\u043b\u0435\u0435 \u0441\u043b\u043e\u0436\u043d\u044b\u0445 \u0440\u0435\u0448\u0435\u043d\u0438\u0439 \u0432 \u043a\u043e\u0440\u043f\u043e\u0440\u0430\u0442\u0438\u0432\u043d\u043e\u0439 \u0438\u043b\u0438 open-source \u0441\u0440\u0435\u0434\u0435.<\/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\/907934\/\"> https:\/\/habr.com\/ru\/articles\/907934\/<\/a><br \/><\/br><\/br><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-458999","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/458999","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=458999"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/458999\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=458999"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=458999"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=458999"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}