{"id":330920,"date":"2022-03-22T15:00:13","date_gmt":"2022-03-22T15:00:13","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=330920"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=330920","title":{"rendered":"<span>DIY \u0425\u0440\u0430\u043d\u0435\u043d\u0438\u0435 \u041f\u0430\u0440\u043e\u043b\u0435\u0439<\/span>"},"content":{"rendered":"<div><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u041f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0435 \u0432\u0440\u0435\u043c\u044f \u043f\u0440\u0435\u0431\u044b\u0432\u0430\u044e \u0432 \u043b\u0435\u0433\u043a\u043e\u043c \u0448\u043e\u043a\u0435 \u043e\u0442 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u044f\u0449\u0435\u0433\u043e. \u0418 \u043a\u0440\u0443\u043f\u043d\u044b\u0435 \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0438, \u0438 Open Source \u0441\u043e\u043e\u0431\u0449\u0435\u0441\u0442\u0432\u043e \u043f\u043e\u043a\u0430\u0437\u0430\u043b\u0438 \u0447\u0435\u0433\u043e \u0441\u0442\u043e\u044f\u0442 \u043b\u0438\u0431\u0435\u0440\u0430\u043b\u044c\u043d\u044b\u0435 \u0446\u0435\u043d\u043d\u043e\u0441\u0442\u0438. \u0420\u0438\u0442\u043e\u0440\u0438\u043a\u0430 \u0438 \u043f\u0440\u043e\u043f\u0430\u0433\u0430\u043d\u0434\u0430 \u0441 \u043e\u0431\u0435\u0438\u0445 \u0441\u0442\u043e\u0440\u043e\u043d \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u043e\u0440\u0430\u0436\u0430\u0435\u0442 \u0441\u0432\u043e\u0438\u043c \u0446\u0438\u043d\u0438\u0437\u043c\u043e\u043c \u0438 \u201c\u0447\u0435\u043b\u043e\u0432\u0435\u043a\u043e\u043b\u044e\u0431\u0438\u0435\u043c\u201d&#8230;<\/p>\n<p>\u0412\u0441\u0435 \u0441\u0432\u043e\u0438 \u0434\u0430\u043d\u043d\u044b\u0435 \u0441\u0440\u043e\u0447\u043d\u044b\u043c \u043f\u043e\u0440\u044f\u0434\u043a\u043e\u043c \u043f\u0435\u0440\u0435\u043d\u0451\u0441 \u0438\u0437 \u0432\u043d\u0435\u0448\u043d\u0438\u0445 \u043f\u043e \u043e\u0442\u043d\u043e\u0448\u0435\u043d\u0438\u0438 \u043a \u0420\u0424 \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432, \u0441\u0434\u0435\u043b\u0430\u043b \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u044b\u0435 \u0431\u044d\u043a\u0430\u043f\u044b. \u0415\u0441\u043b\u0438 \u043f\u0435\u0440\u0435\u043d\u043e\u0441 \u0444\u0430\u0439\u043b\u043e\u0432, \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u043e\u0432, \u043f\u043e\u0447\u0442\u044b, \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0435\u0432 \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u0435\u0439 \u043d\u0435 \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442, \u0442\u043e \u0441 \u043f\u0430\u0440\u043e\u043b\u044f\u043c\u0438 \u043d\u0435 \u0442\u0430\u043a \u0432\u0441\u0451 \u043f\u0440\u043e\u0441\u0442\u043e. \u041c\u0435\u043d\u0435\u0434\u0436\u0435\u0440\u044b \u043f\u0430\u0440\u043e\u043b\u0435\u0439 \u0443\u0434\u043e\u0431\u043d\u044b, \u043d\u043e \u0443\u0440\u043e\u0432\u0435\u043d\u044c \u0434\u043e\u0432\u0435\u0440\u0438\u044f \u043a \u0441\u0442\u043e\u0440\u043e\u043d\u043d\u0438\u043c \u0440\u0435\u0448\u0435\u043d\u0438\u044f\u043c \u0432\u0441\u0435\u0433\u0434\u0430 \u0431\u044b\u043b \u043d\u0435\u0432\u044b\u0441\u043e\u043a. \u041f\u0440\u0438 \u044d\u0442\u043e\u043c \u201c\u043d\u0430\u0431\u0440\u043e\u0441\u0430\u0442\u044c\u201d \u0441\u0432\u043e\u0451 \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u0432\u043f\u043e\u043b\u043d\u0435 \u0440\u0435\u0430\u043b\u044c\u043d\u043e. \u041c\u043e\u0436\u043d\u043e \u0441\u0447\u0438\u0442\u0430\u0442\u044c \u044d\u0442\u0443 \u0441\u0442\u0430\u0442\u044c\u044e \u043a\u0440\u0430\u0442\u043a\u043e\u0439 \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0435\u0439, \u043f\u043e\u044d\u0442\u043e\u043c\u0443: \u043c\u0435\u043d\u044c\u0448\u0435 \u0441\u043b\u043e\u0432, \u0431\u043e\u043b\u044c\u0448\u0435 \u043a\u043e\u0434\u0430.<\/p>\n<p><em>Crypto API<\/em> \u0435\u0441\u0442\u044c \u0438 \u043d\u0430 \u0444\u0440\u043e\u043d\u0442\u0435 \u0438 \u043d\u0430 \u0431\u044d\u043a\u0435, \u0435\u0433\u043e \u043f\u043e\u0434\u043a\u0440\u0435\u043f\u043b\u044f\u0435\u0442 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043e\u0432. \u041e\u0434\u043d\u0430\u043a\u043e, \u0431\u044b\u0441\u0442\u0440\u0435\u0435 \u0432\u0441\u0435\u0433\u043e \u0440\u0435\u0448\u0438\u0442\u044c \u044d\u0442\u0443 \u0437\u0430\u0434\u0430\u0447\u0443 \u0447\u0435\u0440\u0435\u0437 <em>Bash<\/em>. \u0414\u043e\u043b\u0436\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c\u0441\u044f \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e 100 \u0441\u0442\u0440\u043e\u043a \u0432\u043c\u0435\u0441\u0442\u0435 \u0441 \u0445\u044d\u043b\u043f\u043e\u043c. \u0421\u0443\u0442\u044c \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u043e\u0442 \u044d\u0442\u043e\u0433\u043e \u043d\u0435 \u043f\u043e\u043c\u0435\u043d\u044f\u044e\u0442\u0441\u044f, \u0430, \u0432 \u043c\u043e\u0451\u043c \u0441\u043b\u0443\u0447\u0430\u0435, \u043d\u0430 \u044d\u0442\u043e\u043c \u043c\u043e\u0436\u043d\u043e \u0438 \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c\u0441\u044f.<\/p>\n<h3>\u041a\u0430\u043a \u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0441\u0435\u043a\u0440\u0435\u0442\u044b<\/h3>\n<p>\u0412\u044b\u0431\u0438\u0440\u0430\u0435\u043c \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u0448\u0438\u0444\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043d\u0430 \u0441\u0432\u043e\u0439 \u0432\u043a\u0443\u0441. \u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0432\u043f\u043e\u043b\u043d\u0435 \u043f\u043e\u0434\u043e\u0439\u0434\u0451\u0442 <em>AES-256<\/em> \u0432 \u0440\u0435\u0436\u0438\u043c\u0435 <em>CBC<\/em>. \u041f\u0440\u043e \u0440\u0435\u0436\u0438\u043c\u044b \u0448\u0438\u0444\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0435\u0441\u0442\u044c <a href=\"https:\/\/en.wikipedia.org\/wiki\/Block_cipher_mode_of_operation\" rel=\"noopener noreferrer nofollow\">\u0441\u0442\u0430\u0442\u044c\u044f \u043d\u0430 wiki<\/a>. <em>\u0421\u043e\u043b\u044c<\/em> \u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043d\u0435 \u044f\u0441\u043d\u043e \u0434\u043b\u044f \u0447\u0435\u0433\u043e \u043c\u043e\u0436\u0435\u0442 \u043f\u0440\u0438\u0433\u043e\u0434\u0438\u0442\u044c\u0441\u044f. \u041f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0443\u044e \u043a\u043e\u043c\u0430\u043d\u0434\u0443 \u0434\u043b\u044f \u0448\u0438\u0444\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0441\u0435\u043a\u0440\u0435\u0442\u043e\u0432:<\/p>\n<pre><code class=\"bash\">$ echo -n \"&lt;\u0441\u0435\u043a\u0440\u0435\u0442>\" | openssl aes-256-cbc -nosalt -pbkdf2 -base64<\/code><\/pre>\n<p>\u041e\u043f\u0446\u0438\u044f <em>-n<\/em> \u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0438\u0437\u0431\u0430\u0432\u0438\u0442\u044c\u0441\u044f \u043e\u0442 \u0441\u0438\u043c\u0432\u043e\u043b\u0430 \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u0430 \u0441\u0442\u0440\u043e\u043a\u0438 \u0432 \u043a\u043e\u043d\u0446\u0435, \u0432 \u043f\u0440\u043e\u0442\u0438\u0432\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435, \u043f\u0435\u0440\u0435\u0432\u043e\u0434 \u0441\u0442\u0440\u043e\u043a\u0438 \u0442\u043e\u0436\u0435 \u0431\u0443\u0434\u0435\u0442 \u0437\u0430\u043a\u043e\u0434\u0438\u0440\u043e\u0432\u0430\u043d <em>openssl.<\/em><\/p>\n<p><em>PBKDF2<\/em> &#8212; \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442 \u0444\u043e\u0440\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043a\u043b\u044e\u0447\u0430 \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u043f\u0430\u0440\u043e\u043b\u044f &#8212; \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u0432\u043e \u0438\u0437\u0431\u0435\u0436\u0430\u043d\u0438\u0435 \u043d\u0430\u0437\u043e\u0439\u043b\u0438\u0432\u043e\u0433\u043e warning.<\/p>\n<p>\u0412 \u043c\u043e\u043c\u0435\u043d\u0442 \u0432\u044b\u0437\u043e\u0432\u0430 <em>openssl<\/em> \u043f\u043e\u043f\u0440\u043e\u0441\u0438\u0442 \u0432\u0432\u0435\u0441\u0442\u0438 \u043f\u0430\u0440\u043e\u043b\u044c, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043c\u0430\u0441\u0442\u0435\u0440-\u043f\u0430\u0440\u043e\u043b\u0435\u043c. \u041d\u0430 \u0432\u044b\u0445\u043e\u0434\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u043c \u0437\u0430\u0448\u0438\u0444\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u0441\u0435\u043a\u0440\u0435\u0442 \u0432 \u0444\u043e\u0440\u043c\u0430\u0442\u0435 <em>Base64<\/em>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u043e\u0436\u043d\u043e \u201c\u043f\u043e\u043b\u043e\u0436\u0438\u0442\u044c\u201d \u0432 \u043b\u044e\u0431\u043e\u0435 \u0443\u0434\u043e\u0431\u043d\u043e\u0435 \u043c\u0435\u0441\u0442\u043e. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0432 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0443\u044e \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044e:<\/p>\n<pre><code class=\"bash\">$ echo -n \"&lt;\u0441\u0435\u043a\u0440\u0435\u0442>\" | openssl aes-256-cbc -nosalt -pbkdf2 -base64 \\                        > ~\/.imn\/\"&lt;\u0438\u043c\u044f \u0441\u0435\u043a\u0440\u0435\u0442\u0430>\".pub<\/code><\/pre>\n<p>\u041a\u043e\u043f\u0438\u044e \u044f \u0437\u0430\u043a\u0438\u043d\u0443\u043b \u043d\u0430 <em>\u042f\u043d\u0434\u0435\u043a\u0441.\u0414\u0438\u0441\u043a &#8230;<\/em><\/p>\n<p>\u0421\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e, \u0447\u0442\u043e\u0431\u044b \u0432\u043e\u0441\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u0437\u0430\u0448\u0438\u0444\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u0441\u0435\u043a\u0440\u0435\u0442 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043f\u0440\u043e\u0438\u0437\u0432\u0435\u0441\u0442\u0438 \u043e\u0431\u0440\u0430\u0442\u043d\u0443\u044e \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044e:<\/p>\n<pre><code class=\"bash\">$ openssl aes-256-cbc -nosalt -pbkdf2 -base64 -d &lt; ~\/.imn\/\"&lt;\u0438\u043c\u044f \u0441\u0435\u043a\u0440\u0435\u0442\u0430>\".pub<\/code><\/pre>\n<p>\u041e\u043f\u0446\u0438\u044f <em>-d<\/em> \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u043d\u0430 \u0434\u0435\u0448\u0438\u0444\u0440\u043e\u0432\u0430\u043d\u0438\u0435, \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0435 \u043e\u043f\u0446\u0438\u0438 <em>openssl<\/em> \u043d\u0435\u0438\u0437\u043c\u0435\u043d\u043d\u044b \u043f\u043e \u043f\u043e\u043d\u044f\u0442\u043d\u044b\u043c \u043f\u0440\u0438\u0447\u0438\u043d\u0430\u043c. \u041f\u0440\u0438 \u0432\u044b\u0437\u043e\u0432\u0435 \u043f\u043e\u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0432\u0432\u0435\u0441\u0442\u0438 \u043c\u0430\u0441\u0442\u0435\u0440-\u043f\u0430\u0440\u043e\u043b\u044c.<\/p>\n<p>\u0412\u043e\u0442 \u0442\u0430\u043a \u043f\u0440\u043e\u0441\u0442\u043e \u0438 \u0431\u0435\u0437 \u0437\u0430\u0442\u0435\u0439&#8230; \u041e\u0441\u0442\u0430\u043b\u043e\u0441\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043d\u044e\u0430\u043d\u0441\u043e\u0432.<\/p>\n<h3>\u041a\u0430\u043a \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441\u0435\u043a\u0440\u0435\u0442\u044b<\/h3>\n<p>\u0411\u0440\u0430\u0442\u044c \u0441\u0435\u043a\u0440\u0435\u0442\u044b \u201c\u0438\u0437 \u0433\u043e\u043b\u043e\u0432\u044b\u201d \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0435\u0443\u0434\u043e\u0431\u043d\u043e (\u043f\u0440\u0438 \u043d\u0430\u043b\u0438\u0447\u0438\u0438 \u043c\u0430\u0441\u0442\u0435\u0440-\u043f\u0430\u0440\u043e\u043b\u044f), \u043d\u043e \u0438 \u043d\u0435\u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e. \u041d\u0430\u0448\u0430 \u0443\u0442\u0438\u043b\u0438\u0442\u0430 \u0434\u043e\u043b\u0436\u043d\u0430 \u0443\u043c\u0435\u0442\u044c \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043a\u0440\u0438\u043f\u0442\u043e\u0441\u0442\u043e\u0439\u043a\u0438\u0435 \u0441\u0435\u043a\u0440\u0435\u0442\u044b, \u043f\u043e \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0438 \u0441 \u043c\u043d\u043e\u0433\u043e\u0447\u0438\u0441\u043b\u0435\u043d\u043d\u044b\u043c\u0438 \u0441\u043e\u0431\u0440\u0430\u0442\u044c\u044f\u043c\u0438.<\/p>\n<p>\u0418 \u0441\u043d\u043e\u0432\u0430 <em>openssl<\/em> \u043f\u043e\u043c\u043e\u0433\u0430\u0435\u0442 \u0440\u0435\u0448\u0438\u0442\u044c \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0443:<\/p>\n<pre><code class=\"bash\">$ openssl rand -base64 \"&lt;\u0434\u043b\u0438\u043d\u0430 \u0441\u0435\u043a\u0440\u0435\u0442\u0430>\"<\/code><\/pre>\n<p>\u041a\u0440\u0430\u0442\u043d\u0430\u044f \u0442\u0440\u0451\u043c \u0434\u043b\u0438\u043d\u0430 \u0441\u0435\u043a\u0440\u0435\u0442\u0430 \u043f\u043e\u0437\u0432\u043e\u043b\u0438\u0442 \u0438\u0437\u0431\u0435\u0436\u0430\u0442\u044c \u0437\u043d\u0430\u043a\u043e\u0432 \u0440\u0430\u0432\u0435\u043d\u0441\u0442\u0432\u0430 \u0432 \u043a\u043e\u043d\u0446\u0435 \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u043c\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0441\u043b\u0443\u0436\u0430\u0442 \u0432 \u043a\u043e\u0434\u0438\u0440\u043e\u0432\u043a\u0435 <em>Base64<\/em> \u0434\u043b\u044f \u201c\u043d\u0430\u0431\u0438\u0432\u043a\u0438\u201d.<\/p>\n<p>\u0423\u0434\u043e\u0431\u043d\u043e \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u0442\u044c \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438, \u0448\u0438\u0444\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0438 \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u0441\u0435\u043a\u0440\u0435\u0442\u0430:<\/p>\n<pre><code class=\"bash\">$ local secret=$(openssl rand -base64 \"&lt;\u0434\u043b\u0438\u043d\u0430 \u0441\u0435\u043a\u0440\u0435\u0442\u0430>\") $ echo -n \"$secret\" | openssl aes-256-cbc -nosalt -pbkdf2 -base64 \\                       > ~\/.imn\/\"&lt;\u0438\u043c\u044f \u0441\u0435\u043a\u0440\u0435\u0442\u0430>\".pub<\/code><\/pre>\n<p>\u041a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u201c\u0441\u0432\u0435\u0436\u0435\u0433\u043e\u201d \u0441\u0435\u043a\u0440\u0435\u0442\u0430 \u0432 \u0431\u0443\u0444\u0435\u0440 \u043e\u0431\u043c\u0435\u043d\u0430 \u0432\u0430\u0440\u044c\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u043e\u0442 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b. \u0412 <em>Linux<\/em> &#8212; \u044d\u0442\u043e, \u0441\u043a\u043e\u0440\u0435\u0435 \u0432\u0441\u0435\u0433\u043e, <em>xlip<\/em>:<\/p>\n<pre><code class=\"bash\">$ echo \"$secret\" | xclip<\/code><\/pre>\n<p>\u0412 <em>WSL<\/em> \u043f\u043e\u0434 <em>Windows<\/em> &#8212; \u044d\u0442\u043e <em>clip.exe<\/em>:<\/p>\n<pre><code class=\"bash\">$ echo \"$secret\" | clip.exe<\/code><\/pre>\n<h3>\u041a\u0430\u043a \u0438\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441\u0435\u043a\u0440\u0435\u0442\u044b \u0438\u0437 Chrome<\/h3>\n<p>\u0425\u0440\u0430\u043d\u0438\u0442\u044c \u0441\u0435\u043a\u0440\u0435\u0442\u044b \u0432 \u043c\u0435\u043d\u0435\u0434\u0436\u0435\u0440\u0435 \u043f\u0430\u0440\u043e\u043b\u0435\u0439 <em>Chrome<\/em> \u043a\u043e\u043d\u0435\u0447\u043d\u043e \u0443\u0434\u043e\u0431\u043d\u043e, \u043d\u043e&#8230; \u0441 \u0443\u0447\u0435\u0442\u043e\u043c \u043d\u043e\u0432\u044b\u0445 \u043e\u0431\u0441\u0442\u043e\u044f\u0442\u0435\u043b\u044c\u0441\u0442\u0432, \u043b\u0443\u0447\u0448\u0435 \u043d\u0435 \u0441\u0442\u043e\u0438\u0442.<\/p>\n<p>\u041f\u0435\u0440\u0435\u043d\u043e\u0441 \u0441\u0435\u043a\u0440\u0435\u0442\u043e\u0432 \u0438\u0437 <em>Chrome<\/em>, \u0440\u043e\u0432\u043d\u043e \u043a\u0430\u043a \u0438 \u0438\u0437 \u0434\u0440\u0443\u0433\u0438\u0445 \u043c\u0435\u043d\u0435\u0434\u0436\u0435\u0440\u043e\u0432 \u043f\u0430\u0440\u043e\u043b\u0435\u0439 &#8212; \u0437\u0430\u0434\u0430\u0447\u0430 \u0442\u0440\u0438\u0432\u0438\u0430\u043b\u044c\u043d\u0430\u044f. \u042d\u043a\u0441\u043f\u043e\u0440\u0442\u0438\u0440\u0443\u0435\u043c \u0441\u0435\u043a\u0440\u0435\u0442\u044b \u0432 \u0444\u043e\u0440\u043c\u0430\u0442\u0435 <em>CSV.<\/em> \u041f\u043e\u043b\u0443\u0447\u0438\u0442\u0441\u044f \u043d\u0435\u0447\u0442\u043e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435:<\/p>\n<pre><code class=\"bash\"># name,url,usename,password ,&lt;https:\/\/foo.com\/bar,ivanov,qwerty> ,&lt;https:\/\/plugh.com\/quux,petrov,asdfg><\/code><\/pre>\n<p>\u041f\u0435\u0440\u0432\u0430\u044f \u0441\u0442\u0440\u043e\u043a\u0430 \u0432 CSV \u0444\u043e\u0440\u043c\u0430\u0442\u0435 &#8212;  \u044d\u0442\u043e \u043f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0435 \u0438\u043c\u0451\u043d \u043a\u043e\u043b\u043e\u043d\u043e\u043a. \u041e\u0442\u0431\u0440\u0430\u0441\u044b\u0432\u0430\u0435\u043c \u0441\u0442\u0440\u043e\u043a\u0443 \u0441 \u043c\u0435\u0442\u0430\u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0435\u0439 (\u043f\u0430\u0440\u0441\u0438\u043c \u043d\u0430\u0447\u0438\u043d\u0430\u044f \u0441\u043e \u0432\u0442\u043e\u0440\u043e\u0439 +2):<\/p>\n<pre><code class=\"bash\">$ cat chrome-secrets.csv | tail -n+2<\/code><\/pre>\n<p>\u0418 \u043f\u0430\u0440\u0441\u0438\u043c \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 <em>read<\/em> \u0441\u0442\u0440\u043e\u043a\u0430 \u0437\u0430 \u0441\u0442\u0440\u043e\u043a\u043e\u0439:<\/p>\n<pre><code class=\"bash\">cat chrome-secrets.csv | tail -n+2 | \\   while IFS=',' read -r name url username secret; do     echo \u0418\u043c\u044f \u0441\u0435\u043a\u0440\u0435\u0442\u0430: \"$url@$username\"     echo \u0421\u0435\u043a\u0440\u0435\u0442: \"$secret\"   done<\/code><\/pre>\n<p>\u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0443\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0438\u043c\u0435\u043d\u0438 \u0441\u0435\u043a\u0440\u0435\u0442\u0430 \u043b\u0443\u0447\u0448\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0441\u043e\u0447\u0435\u0442\u0430\u043d\u0438\u0435 URL \u0438 \u043b\u043e\u0433\u0438\u043d.<\/p>\n<h3>\u041f\u043e\u043b\u043d\u044b\u0439 \u043b\u0438\u0441\u0442\u0438\u043d\u0433<\/h3>\n<p>\u0427\u0442\u043e\u0431\u044b \u0437\u0440\u044f \u043d\u0435 \u0442\u0440\u0430\u0442\u0438\u0442\u044c \u0432\u0430\u0448\u0435 \u0432\u0440\u0435\u043c\u044f \u043f\u0440\u0438\u0432\u0435\u0434\u0443 \u0442\u043e, \u0447\u0442\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c \u0443 \u043c\u0435\u043d\u044f:<\/p>\n<pre><code class=\"bash\">#!\/usr\/bin\/env bash  DIR=~\/.imn ALGO=(aes-256-cbc -nosalt -pbkdf2 -base64)  mkdir -p \"$DIR\"  store() {   local name=\"$1\"   shift   local secret   secret=$(rand_secret \"$@\")    store_secret \"$name\" \"$secret\" }  rand_secret() {   if [[ $# -gt 0 ]]; then     openssl rand \"$@\"   else     openssl rand -base64 30   fi }  store_secret() {   local name=\"$1\"   local secret=\"$2\"   shift 2    echo -n \"$secret\" | openssl \"${ALGO[@]}\" \"$@\" > \"$DIR\"\/\"$name\".pub    print_secret \"$secret\" }  restore() {   assert_pub_key \"$1\"   local name=\"$1\"    local secret   secret=$(openssl \"${ALGO[@]}\" -d &lt; \"$DIR\"\/\"$name\".pub)    print_secret \"$secret\" }  assert_pub_key() {   local name=\"$1\"   if [[ ! -f \"$DIR\"\/\"$name\".pub ]]; then     echo Public key \"\\\"$name\\\"\" not found >&amp;2     exit 1   fi }  print_secret() {   printf '%s\\n' \"$1\" }  import_chrome_csv() {   # name,url,usename,password   cut -f2-4 -d',' | import_csv \"$@\" }  import_csv() {   grep -v password | while IFS=',' read -r url username secret; do     local origin=\"${url#*:\/\/}\"     origin=\"${origin%%\/*}\"     local name=\"$origin@$username\"     echo \"$name\"     store_secret \"$name\" \"$secret\" \"$@\" >\/dev\/null   done }  case \"$1\" in   --help|-h)     echo \"Generate and store random secret:\"     echo \"  imn.sh store|s &lt;name>\"     echo \"Restore secret:\"     echo \"  imn.sh [restore|r] &lt;name>\"     echo \"Import secrets from Chrome's CSV:\"     echo \"  imn.sh chrome &lt;path to CSV> -k &lt;master password>\"   ;;   chrome)     shift     csv=$1     shift     import_chrome_csv \"$@\" &lt; \"$csv\"     ;;   store|s|gen|g)     shift     store \"$@\"     ;;   restore|r)     shift     restore \"$@\"     ;;   *)     restore \"$@\"     ;; esac<\/code><\/pre>\n<p>\u0415\u0441\u043b\u0438 \u0412\u044b \u0442\u0430\u043a\u043e\u0439 \u0436\u0435 \u043f\u0430\u0440\u0430\u043d\u043e\u0438\u043a (\u0432 \u0445\u043e\u0440\u043e\u0448\u0435\u043c \u0441\u043c\u044b\u0441\u043b\u0435) \u043a\u0430\u043a \u0438 \u044f, \u043c\u0438\u043b\u043e\u0441\u0442\u0438 \u043f\u0440\u043e\u0448\u0443 \u0432 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0438, \u0432\u0441\u0435\u0433\u0434\u0430 \u0440\u0430\u0434 \u043f\u043e\u043e\u0431\u0449\u0430\u0442\u044c\u0441\u044f \u0441 \u0435\u0434\u0438\u043d\u043e\u043c\u044b\u0448\u043b\u0435\u043d\u043d\u0438\u043a\u0430\u043c\u0438.<\/p>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"v-portal\" style=\"display:none;\"><\/div>\n<\/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\/post\/656915\/\"> https:\/\/habr.com\/ru\/post\/656915\/<\/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_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u041f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0435 \u0432\u0440\u0435\u043c\u044f \u043f\u0440\u0435\u0431\u044b\u0432\u0430\u044e \u0432 \u043b\u0435\u0433\u043a\u043e\u043c \u0448\u043e\u043a\u0435 \u043e\u0442 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u044f\u0449\u0435\u0433\u043e. \u0418 \u043a\u0440\u0443\u043f\u043d\u044b\u0435 \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0438, \u0438 Open Source \u0441\u043e\u043e\u0431\u0449\u0435\u0441\u0442\u0432\u043e \u043f\u043e\u043a\u0430\u0437\u0430\u043b\u0438 \u0447\u0435\u0433\u043e \u0441\u0442\u043e\u044f\u0442 \u043b\u0438\u0431\u0435\u0440\u0430\u043b\u044c\u043d\u044b\u0435 \u0446\u0435\u043d\u043d\u043e\u0441\u0442\u0438. \u0420\u0438\u0442\u043e\u0440\u0438\u043a\u0430 \u0438 \u043f\u0440\u043e\u043f\u0430\u0433\u0430\u043d\u0434\u0430 \u0441 \u043e\u0431\u0435\u0438\u0445 \u0441\u0442\u043e\u0440\u043e\u043d \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u043e\u0440\u0430\u0436\u0430\u0435\u0442 \u0441\u0432\u043e\u0438\u043c \u0446\u0438\u043d\u0438\u0437\u043c\u043e\u043c \u0438 \u201c\u0447\u0435\u043b\u043e\u0432\u0435\u043a\u043e\u043b\u044e\u0431\u0438\u0435\u043c\u201d&#8230;<\/p>\n<p>\u0412\u0441\u0435 \u0441\u0432\u043e\u0438 \u0434\u0430\u043d\u043d\u044b\u0435 \u0441\u0440\u043e\u0447\u043d\u044b\u043c \u043f\u043e\u0440\u044f\u0434\u043a\u043e\u043c \u043f\u0435\u0440\u0435\u043d\u0451\u0441 \u0438\u0437 \u0432\u043d\u0435\u0448\u043d\u0438\u0445 \u043f\u043e \u043e\u0442\u043d\u043e\u0448\u0435\u043d\u0438\u0438 \u043a \u0420\u0424 \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432, \u0441\u0434\u0435\u043b\u0430\u043b \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u044b\u0435 \u0431\u044d\u043a\u0430\u043f\u044b. \u0415\u0441\u043b\u0438 \u043f\u0435\u0440\u0435\u043d\u043e\u0441 \u0444\u0430\u0439\u043b\u043e\u0432, \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u043e\u0432, \u043f\u043e\u0447\u0442\u044b, \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0435\u0432 \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u0435\u0439 \u043d\u0435 \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442, \u0442\u043e \u0441 \u043f\u0430\u0440\u043e\u043b\u044f\u043c\u0438 \u043d\u0435 \u0442\u0430\u043a \u0432\u0441\u0451 \u043f\u0440\u043e\u0441\u0442\u043e. \u041c\u0435\u043d\u0435\u0434\u0436\u0435\u0440\u044b \u043f\u0430\u0440\u043e\u043b\u0435\u0439 \u0443\u0434\u043e\u0431\u043d\u044b, \u043d\u043e \u0443\u0440\u043e\u0432\u0435\u043d\u044c \u0434\u043e\u0432\u0435\u0440\u0438\u044f \u043a \u0441\u0442\u043e\u0440\u043e\u043d\u043d\u0438\u043c \u0440\u0435\u0448\u0435\u043d\u0438\u044f\u043c \u0432\u0441\u0435\u0433\u0434\u0430 \u0431\u044b\u043b \u043d\u0435\u0432\u044b\u0441\u043e\u043a. \u041f\u0440\u0438 \u044d\u0442\u043e\u043c \u201c\u043d\u0430\u0431\u0440\u043e\u0441\u0430\u0442\u044c\u201d \u0441\u0432\u043e\u0451 \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u0432\u043f\u043e\u043b\u043d\u0435 \u0440\u0435\u0430\u043b\u044c\u043d\u043e. \u041c\u043e\u0436\u043d\u043e \u0441\u0447\u0438\u0442\u0430\u0442\u044c \u044d\u0442\u0443 \u0441\u0442\u0430\u0442\u044c\u044e \u043a\u0440\u0430\u0442\u043a\u043e\u0439 \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0435\u0439, \u043f\u043e\u044d\u0442\u043e\u043c\u0443: \u043c\u0435\u043d\u044c\u0448\u0435 \u0441\u043b\u043e\u0432, \u0431\u043e\u043b\u044c\u0448\u0435 \u043a\u043e\u0434\u0430.<\/p>\n<p><em>Crypto API<\/em> \u0435\u0441\u0442\u044c \u0438 \u043d\u0430 \u0444\u0440\u043e\u043d\u0442\u0435 \u0438 \u043d\u0430 \u0431\u044d\u043a\u0435, \u0435\u0433\u043e \u043f\u043e\u0434\u043a\u0440\u0435\u043f\u043b\u044f\u0435\u0442 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043e\u0432. \u041e\u0434\u043d\u0430\u043a\u043e, \u0431\u044b\u0441\u0442\u0440\u0435\u0435 \u0432\u0441\u0435\u0433\u043e \u0440\u0435\u0448\u0438\u0442\u044c \u044d\u0442\u0443 \u0437\u0430\u0434\u0430\u0447\u0443 \u0447\u0435\u0440\u0435\u0437 <em>Bash<\/em>. \u0414\u043e\u043b\u0436\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c\u0441\u044f \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e 100 \u0441\u0442\u0440\u043e\u043a \u0432\u043c\u0435\u0441\u0442\u0435 \u0441 \u0445\u044d\u043b\u043f\u043e\u043c. \u0421\u0443\u0442\u044c \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u043e\u0442 \u044d\u0442\u043e\u0433\u043e \u043d\u0435 \u043f\u043e\u043c\u0435\u043d\u044f\u044e\u0442\u0441\u044f, \u0430, \u0432 \u043c\u043e\u0451\u043c \u0441\u043b\u0443\u0447\u0430\u0435, \u043d\u0430 \u044d\u0442\u043e\u043c \u043c\u043e\u0436\u043d\u043e \u0438 \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c\u0441\u044f.<\/p>\n<h3>\u041a\u0430\u043a \u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0441\u0435\u043a\u0440\u0435\u0442\u044b<\/h3>\n<p>\u0412\u044b\u0431\u0438\u0440\u0430\u0435\u043c \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u0448\u0438\u0444\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043d\u0430 \u0441\u0432\u043e\u0439 \u0432\u043a\u0443\u0441. \u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0432\u043f\u043e\u043b\u043d\u0435 \u043f\u043e\u0434\u043e\u0439\u0434\u0451\u0442 <em>AES-256<\/em> \u0432 \u0440\u0435\u0436\u0438\u043c\u0435 <em>CBC<\/em>. \u041f\u0440\u043e \u0440\u0435\u0436\u0438\u043c\u044b \u0448\u0438\u0444\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0435\u0441\u0442\u044c <a href=\"https:\/\/en.wikipedia.org\/wiki\/Block_cipher_mode_of_operation\" rel=\"noopener noreferrer nofollow\">\u0441\u0442\u0430\u0442\u044c\u044f \u043d\u0430 wiki<\/a>. <em>\u0421\u043e\u043b\u044c<\/em> \u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043d\u0435 \u044f\u0441\u043d\u043e \u0434\u043b\u044f \u0447\u0435\u0433\u043e \u043c\u043e\u0436\u0435\u0442 \u043f\u0440\u0438\u0433\u043e\u0434\u0438\u0442\u044c\u0441\u044f. \u041f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0443\u044e \u043a\u043e\u043c\u0430\u043d\u0434\u0443 \u0434\u043b\u044f \u0448\u0438\u0444\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0441\u0435\u043a\u0440\u0435\u0442\u043e\u0432:<\/p>\n<pre><code class=\"bash\">$ echo -n \"&lt;\u0441\u0435\u043a\u0440\u0435\u0442>\" | openssl aes-256-cbc -nosalt -pbkdf2 -base64<\/code><\/pre>\n<p>\u041e\u043f\u0446\u0438\u044f <em>-n<\/em> \u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0438\u0437\u0431\u0430\u0432\u0438\u0442\u044c\u0441\u044f \u043e\u0442 \u0441\u0438\u043c\u0432\u043e\u043b\u0430 \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u0430 \u0441\u0442\u0440\u043e\u043a\u0438 \u0432 \u043a\u043e\u043d\u0446\u0435, \u0432 \u043f\u0440\u043e\u0442\u0438\u0432\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435, \u043f\u0435\u0440\u0435\u0432\u043e\u0434 \u0441\u0442\u0440\u043e\u043a\u0438 \u0442\u043e\u0436\u0435 \u0431\u0443\u0434\u0435\u0442 \u0437\u0430\u043a\u043e\u0434\u0438\u0440\u043e\u0432\u0430\u043d <em>openssl.<\/em><\/p>\n<p><em>PBKDF2<\/em> &#8212; \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442 \u0444\u043e\u0440\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043a\u043b\u044e\u0447\u0430 \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u043f\u0430\u0440\u043e\u043b\u044f &#8212; \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u0432\u043e \u0438\u0437\u0431\u0435\u0436\u0430\u043d\u0438\u0435 \u043d\u0430\u0437\u043e\u0439\u043b\u0438\u0432\u043e\u0433\u043e warning.<\/p>\n<p>\u0412 \u043c\u043e\u043c\u0435\u043d\u0442 \u0432\u044b\u0437\u043e\u0432\u0430 <em>openssl<\/em> \u043f\u043e\u043f\u0440\u043e\u0441\u0438\u0442 \u0432\u0432\u0435\u0441\u0442\u0438 \u043f\u0430\u0440\u043e\u043b\u044c, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043c\u0430\u0441\u0442\u0435\u0440-\u043f\u0430\u0440\u043e\u043b\u0435\u043c. \u041d\u0430 \u0432\u044b\u0445\u043e\u0434\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u043c \u0437\u0430\u0448\u0438\u0444\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u0441\u0435\u043a\u0440\u0435\u0442 \u0432 \u0444\u043e\u0440\u043c\u0430\u0442\u0435 <em>Base64<\/em>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u043e\u0436\u043d\u043e \u201c\u043f\u043e\u043b\u043e\u0436\u0438\u0442\u044c\u201d \u0432 \u043b\u044e\u0431\u043e\u0435 \u0443\u0434\u043e\u0431\u043d\u043e\u0435 \u043c\u0435\u0441\u0442\u043e. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0432 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0443\u044e \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044e:<\/p>\n<pre><code class=\"bash\">$ echo -n \"&lt;\u0441\u0435\u043a\u0440\u0435\u0442>\" | openssl aes-256-cbc -nosalt -pbkdf2 -base64 \\                        > ~\/.imn\/\"&lt;\u0438\u043c\u044f \u0441\u0435\u043a\u0440\u0435\u0442\u0430>\".pub<\/code><\/pre>\n<p>\u041a\u043e\u043f\u0438\u044e \u044f \u0437\u0430\u043a\u0438\u043d\u0443\u043b \u043d\u0430 <em>\u042f\u043d\u0434\u0435\u043a\u0441.\u0414\u0438\u0441\u043a &#8230;<\/em><\/p>\n<p>\u0421\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e, \u0447\u0442\u043e\u0431\u044b \u0432\u043e\u0441\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u0437\u0430\u0448\u0438\u0444\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u0441\u0435\u043a\u0440\u0435\u0442 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043f\u0440\u043e\u0438\u0437\u0432\u0435\u0441\u0442\u0438 \u043e\u0431\u0440\u0430\u0442\u043d\u0443\u044e \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044e:<\/p>\n<pre><code class=\"bash\">$ openssl aes-256-cbc -nosalt -pbkdf2 -base64 -d &lt; ~\/.imn\/\"&lt;\u0438\u043c\u044f \u0441\u0435\u043a\u0440\u0435\u0442\u0430>\".pub<\/code><\/pre>\n<p>\u041e\u043f\u0446\u0438\u044f <em>-d<\/em> \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u043d\u0430 \u0434\u0435\u0448\u0438\u0444\u0440\u043e\u0432\u0430\u043d\u0438\u0435, \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0435 \u043e\u043f\u0446\u0438\u0438 <em>openssl<\/em> \u043d\u0435\u0438\u0437\u043c\u0435\u043d\u043d\u044b \u043f\u043e \u043f\u043e\u043d\u044f\u0442\u043d\u044b\u043c \u043f\u0440\u0438\u0447\u0438\u043d\u0430\u043c. \u041f\u0440\u0438 \u0432\u044b\u0437\u043e\u0432\u0435 \u043f\u043e\u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0432\u0432\u0435\u0441\u0442\u0438 \u043c\u0430\u0441\u0442\u0435\u0440-\u043f\u0430\u0440\u043e\u043b\u044c.<\/p>\n<p>\u0412\u043e\u0442 \u0442\u0430\u043a \u043f\u0440\u043e\u0441\u0442\u043e \u0438 \u0431\u0435\u0437 \u0437\u0430\u0442\u0435\u0439&#8230; \u041e\u0441\u0442\u0430\u043b\u043e\u0441\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043d\u044e\u0430\u043d\u0441\u043e\u0432.<\/p>\n<h3>\u041a\u0430\u043a \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441\u0435\u043a\u0440\u0435\u0442\u044b<\/h3>\n<p>\u0411\u0440\u0430\u0442\u044c \u0441\u0435\u043a\u0440\u0435\u0442\u044b \u201c\u0438\u0437 \u0433\u043e\u043b\u043e\u0432\u044b\u201d \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0435\u0443\u0434\u043e\u0431\u043d\u043e (\u043f\u0440\u0438 \u043d\u0430\u043b\u0438\u0447\u0438\u0438 \u043c\u0430\u0441\u0442\u0435\u0440-\u043f\u0430\u0440\u043e\u043b\u044f), \u043d\u043e \u0438 \u043d\u0435\u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e. \u041d\u0430\u0448\u0430 \u0443\u0442\u0438\u043b\u0438\u0442\u0430 \u0434\u043e\u043b\u0436\u043d\u0430 \u0443\u043c\u0435\u0442\u044c \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043a\u0440\u0438\u043f\u0442\u043e\u0441\u0442\u043e\u0439\u043a\u0438\u0435 \u0441\u0435\u043a\u0440\u0435\u0442\u044b, \u043f\u043e \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0438 \u0441 \u043c\u043d\u043e\u0433\u043e\u0447\u0438\u0441\u043b\u0435\u043d\u043d\u044b\u043c\u0438 \u0441\u043e\u0431\u0440\u0430\u0442\u044c\u044f\u043c\u0438.<\/p>\n<p>\u0418 \u0441\u043d\u043e\u0432\u0430 <em>openssl<\/em> \u043f\u043e\u043c\u043e\u0433\u0430\u0435\u0442 \u0440\u0435\u0448\u0438\u0442\u044c \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0443:<\/p>\n<pre><code class=\"bash\">$ openssl rand -base64 \"&lt;\u0434\u043b\u0438\u043d\u0430 \u0441\u0435\u043a\u0440\u0435\u0442\u0430>\"<\/code><\/pre>\n<p>\u041a\u0440\u0430\u0442\u043d\u0430\u044f \u0442\u0440\u0451\u043c \u0434\u043b\u0438\u043d\u0430 \u0441\u0435\u043a\u0440\u0435\u0442\u0430 \u043f\u043e\u0437\u0432\u043e\u043b\u0438\u0442 \u0438\u0437\u0431\u0435\u0436\u0430\u0442\u044c \u0437\u043d\u0430\u043a\u043e\u0432 \u0440\u0430\u0432\u0435\u043d\u0441\u0442\u0432\u0430 \u0432 \u043a\u043e\u043d\u0446\u0435 \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u043c\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0441\u043b\u0443\u0436\u0430\u0442 \u0432 \u043a\u043e\u0434\u0438\u0440\u043e\u0432\u043a\u0435 <em>Base64<\/em> \u0434\u043b\u044f \u201c\u043d\u0430\u0431\u0438\u0432\u043a\u0438\u201d.<\/p>\n<p>\u0423\u0434\u043e\u0431\u043d\u043e \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u0442\u044c \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438, \u0448\u0438\u0444\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0438 \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u0441\u0435\u043a\u0440\u0435\u0442\u0430:<\/p>\n<pre><code class=\"bash\">$ local secret=$(openssl rand -base64 \"&lt;\u0434\u043b\u0438\u043d\u0430 \u0441\u0435\u043a\u0440\u0435\u0442\u0430>\") $ echo -n \"$secret\" | openssl aes-256-cbc -nosalt -pbkdf2 -base64 \\                       > ~\/.imn\/\"&lt;\u0438\u043c\u044f \u0441\u0435\u043a\u0440\u0435\u0442\u0430>\".pub<\/code><\/pre>\n<p>\u041a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u201c\u0441\u0432\u0435\u0436\u0435\u0433\u043e\u201d \u0441\u0435\u043a\u0440\u0435\u0442\u0430 \u0432 \u0431\u0443\u0444\u0435\u0440 \u043e\u0431\u043c\u0435\u043d\u0430 \u0432\u0430\u0440\u044c\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u043e\u0442 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b. \u0412 <em>Linux<\/em> &#8212; \u044d\u0442\u043e, \u0441\u043a\u043e\u0440\u0435\u0435 \u0432\u0441\u0435\u0433\u043e, <em>xlip<\/em>:<\/p>\n<pre><code class=\"bash\">$ echo \"$secret\" | xclip<\/code><\/pre>\n<p>\u0412 <em>WSL<\/em> \u043f\u043e\u0434 <em>Windows<\/em> &#8212; \u044d\u0442\u043e <em>clip.exe<\/em>:<\/p>\n<pre><code class=\"bash\">$ echo \"$secret\" | clip.exe<\/code><\/pre>\n<h3>\u041a\u0430\u043a \u0438\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441\u0435\u043a\u0440\u0435\u0442\u044b \u0438\u0437 Chrome<\/h3>\n<p>\u0425\u0440\u0430\u043d\u0438\u0442\u044c \u0441\u0435\u043a\u0440\u0435\u0442\u044b \u0432 \u043c\u0435\u043d\u0435\u0434\u0436\u0435\u0440\u0435 \u043f\u0430\u0440\u043e\u043b\u0435\u0439 <em>Chrome<\/em> \u043a\u043e\u043d\u0435\u0447\u043d\u043e \u0443\u0434\u043e\u0431\u043d\u043e, \u043d\u043e&#8230; \u0441 \u0443\u0447\u0435\u0442\u043e\u043c \u043d\u043e\u0432\u044b\u0445 \u043e\u0431\u0441\u0442\u043e\u044f\u0442\u0435\u043b\u044c\u0441\u0442\u0432, \u043b\u0443\u0447\u0448\u0435 \u043d\u0435 \u0441\u0442\u043e\u0438\u0442.<\/p>\n<p>\u041f\u0435\u0440\u0435\u043d\u043e\u0441 \u0441\u0435\u043a\u0440\u0435\u0442\u043e\u0432 \u0438\u0437 <em>Chrome<\/em>, \u0440\u043e\u0432\u043d\u043e \u043a\u0430\u043a \u0438 \u0438\u0437 \u0434\u0440\u0443\u0433\u0438\u0445 \u043c\u0435\u043d\u0435\u0434\u0436\u0435\u0440\u043e\u0432 \u043f\u0430\u0440\u043e\u043b\u0435\u0439 &#8212; \u0437\u0430\u0434\u0430\u0447\u0430 \u0442\u0440\u0438\u0432\u0438\u0430\u043b\u044c\u043d\u0430\u044f. \u042d\u043a\u0441\u043f\u043e\u0440\u0442\u0438\u0440\u0443\u0435\u043c \u0441\u0435\u043a\u0440\u0435\u0442\u044b \u0432 \u0444\u043e\u0440\u043c\u0430\u0442\u0435 <em>CSV.<\/em> \u041f\u043e\u043b\u0443\u0447\u0438\u0442\u0441\u044f \u043d\u0435\u0447\u0442\u043e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435:<\/p>\n<pre><code class=\"bash\"># name,url,usename,password ,&lt;https:\/\/foo.com\/bar,ivanov,qwerty> ,&lt;https:\/\/plugh.com\/quux,petrov,asdfg><\/code><\/pre>\n<p>\u041f\u0435\u0440\u0432\u0430\u044f \u0441\u0442\u0440\u043e\u043a\u0430 \u0432 CSV \u0444\u043e\u0440\u043c\u0430\u0442\u0435 &#8212;  \u044d\u0442\u043e \u043f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0435 \u0438\u043c\u0451\u043d \u043a\u043e\u043b\u043e\u043d\u043e\u043a. \u041e\u0442\u0431\u0440\u0430\u0441\u044b\u0432\u0430\u0435\u043c \u0441\u0442\u0440\u043e\u043a\u0443 \u0441 \u043c\u0435\u0442\u0430\u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0435\u0439 (\u043f\u0430\u0440\u0441\u0438\u043c \u043d\u0430\u0447\u0438\u043d\u0430\u044f \u0441\u043e \u0432\u0442\u043e\u0440\u043e\u0439 +2):<\/p>\n<pre><code class=\"bash\">$ cat chrome-secrets.csv | tail -n+2<\/code><\/pre>\n<p>\u0418 \u043f\u0430\u0440\u0441\u0438\u043c \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 <em>read<\/em> \u0441\u0442\u0440\u043e\u043a\u0430 \u0437\u0430 \u0441\u0442\u0440\u043e\u043a\u043e\u0439:<\/p>\n<pre><code class=\"bash\">cat chrome-secrets.csv | tail -n+2 | \\   while IFS=',' read -r name url username secret; do     echo \u0418\u043c\u044f \u0441\u0435\u043a\u0440\u0435\u0442\u0430: \"$url@$username\"     echo \u0421\u0435\u043a\u0440\u0435\u0442: \"$secret\"   done<\/code><\/pre>\n<p>\u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0443\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0438\u043c\u0435\u043d\u0438 \u0441\u0435\u043a\u0440\u0435\u0442\u0430 \u043b\u0443\u0447\u0448\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0441\u043e\u0447\u0435\u0442\u0430\u043d\u0438\u0435 URL \u0438 \u043b\u043e\u0433\u0438\u043d.<\/p>\n<h3>\u041f\u043e\u043b\u043d\u044b\u0439 \u043b\u0438\u0441\u0442\u0438\u043d\u0433<\/h3>\n<p>\u0427\u0442\u043e\u0431\u044b \u0437\u0440\u044f \u043d\u0435 \u0442\u0440\u0430\u0442\u0438\u0442\u044c \u0432\u0430\u0448\u0435 \u0432\u0440\u0435\u043c\u044f \u043f\u0440\u0438\u0432\u0435\u0434\u0443 \u0442\u043e, \u0447\u0442\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c \u0443 \u043c\u0435\u043d\u044f:<\/p>\n<pre><code class=\"bash\">#!\/usr\/bin\/env bash  DIR=~\/.imn ALGO=(aes-256-cbc -nosalt -pbkdf2 -base64)  mkdir -p \"$DIR\"  store() {   local name=\"$1\"   shift   local secret   secret=$(rand_secret \"$@\")    store_secret \"$name\" \"$secret\" }  rand_secret() {   if [[ $# -gt 0 ]]; then     openssl rand \"$@\"   else     openssl rand -base64 30   fi }  store_secret() {   local name=\"$1\"   local secret=\"$2\"   shift 2    echo -n \"$secret\" | openssl \"${ALGO[@]}\" \"$@\" > \"$DIR\"\/\"$name\".pub    print_secret \"$secret\" }  restore() {   assert_pub_key \"$1\"   local name=\"$1\"    local secret   secret=$(openssl \"${ALGO[@]}\" -d &lt; \"$DIR\"\/\"$name\".pub)    print_secret \"$secret\" }  assert_pub_key() {   local name=\"$1\"   if [[ ! -f \"$DIR\"\/\"$name\".pub ]]; then     echo Public key \"\\\"$name\\\"\" not found >&amp;2     exit 1   fi }  print_secret() {   printf '%s\\n' \"$1\" }  import_chrome_csv() {   # name,url,usename,password   cut -f2-4 -d',' | import_csv \"$@\" }  import_csv() {   grep -v password | while IFS=',' read -r url username secret; do     local origin=\"${url#*:\/\/}\"     origin=\"${origin%%\/*}\"     local name=\"$origin@$username\"     echo \"$name\"     store_secret \"$name\" \"$secret\" \"$@\" >\/dev\/null   done }  case \"$1\" in   --help|-h)     echo \"Generate and store random secret:\"     echo \"  imn.sh store|s &lt;name>\"     echo \"Restore secret:\"     echo \"  imn.sh [restore|r] &lt;name>\"     echo \"Import secrets from Chrome's CSV:\"     echo \"  imn.sh chrome &lt;path to CSV> -k &lt;master password>\"   ;;   chrome)     shift     csv=$1     shift     import_chrome_csv \"$@\" &lt; \"$csv\"     ;;   store|s|gen|g)     shift     store \"$@\"     ;;   restore|r)     shift     restore \"$@\"     ;;   *)     restore \"$@\"     ;; esac<\/code><\/pre>\n<p>\u0415\u0441\u043b\u0438 \u0412\u044b \u0442\u0430\u043a\u043e\u0439 \u0436\u0435 \u043f\u0430\u0440\u0430\u043d\u043e\u0438\u043a (\u0432 \u0445\u043e\u0440\u043e\u0448\u0435\u043c \u0441\u043c\u044b\u0441\u043b\u0435) \u043a\u0430\u043a \u0438 \u044f, \u043c\u0438\u043b\u043e\u0441\u0442\u0438 \u043f\u0440\u043e\u0448\u0443 \u0432 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0438, \u0432\u0441\u0435\u0433\u0434\u0430 \u0440\u0430\u0434 \u043f\u043e\u043e\u0431\u0449\u0430\u0442\u044c\u0441\u044f \u0441 \u0435\u0434\u0438\u043d\u043e\u043c\u044b\u0448\u043b\u0435\u043d\u043d\u0438\u043a\u0430\u043c\u0438.<\/p>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"v-portal\" style=\"display:none;\"><\/div>\n<\/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\/post\/656915\/\"> https:\/\/habr.com\/ru\/post\/656915\/<\/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-330920","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/330920","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=330920"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/330920\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=330920"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=330920"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=330920"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}