{"id":322031,"date":"2021-04-25T03:00:07","date_gmt":"2021-04-25T03:00:07","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=322031"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=322031","title":{"rendered":"Ansible-vault decrypt: \u043e\u0431\u0445\u043e\u0434\u0438\u043c\u0441\u044f \u0431\u0435\u0437 Ansible"},"content":{"rendered":"\n<div class=\"post__text post__text_v2\" id=\"post-content-body\">\n<h2>\u0418\u0441\u0445\u043e\u0434\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435<\/h2>\n<p><strong>\u0414\u0430\u043d\u043e<\/strong>: <\/p>\n<ul>\n<li>\n<p>\u043a\u043e\u043d\u0432\u0435\u0439\u0435\u0440 CI\/CD, \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u0439, \u043a \u043f\u0440\u0438\u043c\u0435\u0440\u0443, \u0432 GitLab. \u0414\u043b\u044f \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e\u0439 \u0440\u0430\u0431\u043e\u0442\u044b \u0435\u043c\u0443 \u0442\u0440\u0435\u0431\u0443\u044e\u0442\u0441\u044f, \u043a\u0430\u043a \u044d\u0442\u043e \u043e\u0447\u0435\u043d\u044c \u0447\u0430\u0441\u0442\u043e \u0431\u044b\u0432\u0430\u0435\u0442, \u043d\u0435\u043a\u0438\u0435 \u0441\u0435\u043a\u0440\u0435\u0442\u044b &#8212; API-\u0442\u043e\u043a\u0435\u043d\u044b, \u043f\u0430\u0440\u044b \u043b\u043e\u0433\u0438\/\u043f\u0430\u0440\u043e\u043b\u044c, \u043f\u0440\u0438\u0432\u0430\u0442\u043d\u044b\u0435 SSH-\u043a\u043b\u044e\u0447\u0438 &#8212; \u0434\u0430 \u0432\u0441\u0451, \u043e \u0447\u0451\u043c \u0442\u043e\u043b\u044c\u043a\u043e \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0434\u0443\u043c\u0430\u0442\u044c;<\/p>\n<\/li>\n<li>\n<p>\u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u044d\u0442\u043e\u0442 \u0441\u0431\u043e\u0440\u043e\u0447\u043d\u044b\u0439 \u043a\u043e\u043d\u0432\u0435\u0439\u0435\u0440, \u043a\u0430\u043a \u044d\u0442\u043e \u0442\u043e\u0436\u0435 \u0447\u0430\u0441\u0442\u043e \u0431\u044b\u0432\u0430\u0435\u0442, \u043d\u0430 \u0431\u0430\u0437\u0435 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u043e\u0432. \u0421\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e, \u0447\u0435\u043c \u043c\u0435\u043d\u044c\u0448\u0435 \u043f\u043e \u0440\u0430\u0437\u043c\u0435\u0440\u0443 \u043e\u0431\u0440\u0430\u0437\u044b &#8212; \u0442\u0435\u043c \u043b\u0443\u0447\u0448\u0435, \u0447\u0435\u043c \u043c\u0435\u043d\u044c\u0448\u0435 \u0432 \u043d\u0438\u0445 \u0432\u0441\u044f\u043a\u043e\u0439 \u0432\u0441\u044f\u0447\u0438\u043d\u044b &#8212; \u0442\u0435\u043c \u043b\u0443\u0447\u0448\u0435.<\/p>\n<\/li>\n<\/ul>\n<p><strong>\u0422\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f<\/strong> \u043a\u043e\u043d\u0441\u043e\u043b\u044c\u043d\u0430\u044f \u0443\u0442\u0438\u043b\u0438\u0442\u0430, \u043a\u043e\u0442\u043e\u0440\u0430\u044f:<\/p>\n<ul>\n<li>\n<p>\u0437\u0430\u043d\u0438\u043c\u0430\u0435\u0442 \u043c\u0438\u043d\u0438\u043c\u0443\u043c \u043c\u0435\u0441\u0442\u0430;<\/p>\n<\/li>\n<li>\n<p>\u0443\u043c\u0435\u0435\u0442 \u0440\u0430\u0441\u0448\u0438\u0444\u0440\u043e\u0432\u044b\u0432\u0430\u0442\u044c \u0441\u0435\u043a\u0440\u0435\u0442\u044b, \u0437\u0430\u0448\u0438\u0444\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0435 <code>ansible-vault<\/code>;<\/p>\n<\/li>\n<li>\n<p>\u043d\u0435 \u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u043d\u0438\u043a\u0430\u043a\u0438\u0445 \u0432\u043d\u0435\u0448\u043d\u0438\u0445 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439;<\/p>\n<\/li>\n<li>\n<p>\u0443\u043c\u0435\u0435\u0442 \u0447\u0438\u0442\u0430\u0442\u044c \u043a\u043b\u044e\u0447 \u0438\u0437 \u0444\u0430\u0439\u043b\u0430.<\/p>\n<\/li>\n<\/ul>\n<p>\u042f \u0434\u0443\u043c\u0430\u044e, \u0447\u0442\u043e \u043b\u044e\u0434\u0438, \u043f\u0440\u0438\u0447\u0430\u0441\u0442\u043d\u044b\u0435 \u043a \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044e \u0441\u0431\u043e\u0440\u043e\u0447\u043d\u044b\u0445 \u043a\u043e\u043d\u0432\u0435\u0439\u0435\u0440\u043e\u0432, \u043f\u043e \u0434\u043e\u0441\u0442\u043e\u0438\u043d\u0441\u0442\u0432\u0443 \u0441\u043c\u043e\u0433\u0443\u0442 \u043e\u0446\u0435\u043d\u0438\u0442\u044c \u043a\u0430\u0436\u0434\u043e\u0435 \u0438\u0437 \u044d\u0442\u0438\u0445 \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u0439. \u041d\u0443 \u0430 \u0447\u0442\u043e \u0443 \u043c\u0435\u043d\u044f \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c \u0432 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 &#8212; \u0447\u0438\u0442\u0430\u0439\u0442\u0435 \u0434\u0430\u043b\u0435\u0435.<\/p>\n<p>\u041d\u0430 \u0432\u0441\u044f\u043a\u0438\u0439 \u0441\u043b\u0443\u0447\u0430\u0439 \u0441\u0440\u0430\u0437\u0443 \u043d\u0430\u043f\u043e\u043c\u0438\u043d\u0430\u044e, \u0447\u0442\u043e \u043f\u043e \u0434\u0435\u0439\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u043c\u0443 \u0437\u0430\u043a\u043e\u043d\u043e\u0434\u0430\u0442\u0435\u043b\u044c\u0441\u0442\u0432\u0443 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u0441\u0440\u0435\u0434\u0441\u0442\u0432 \u043a\u0440\u0438\u043f\u0442\u043e\u0433\u0440\u0430\u0444\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0437\u0430\u0449\u0438\u0442\u044b \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u0432 \u0420\u0424 &#8212; <a href=\"http:\/\/clsz.fsb.ru\/clsz\/license.htm\" rel=\"noopener noreferrer nofollow\">\u043b\u0438\u0446\u0435\u043d\u0437\u0438\u0440\u0443\u0435\u043c\u0430\u044f \u0434\u0435\u044f\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c<\/a>. \u0418\u043d\u0430\u0447\u0435 \u0433\u043e\u0432\u043e\u0440\u044f, \u0431\u0435\u0437 \u043d\u0430\u043b\u0438\u0447\u0438\u044f \u043b\u0438\u0446\u0435\u043d\u0437\u0438\u0438 \u0432\u044b \u043d\u0435 \u043c\u043e\u0436\u0435\u0442\u0435 \u043f\u0440\u043e\u0441\u0442\u043e \u0442\u0430\u043a \u0432\u0437\u044f\u0442\u044c \u0438 \u043f\u0440\u043e\u0434\u0430\u0432\u0430\u0442\u044c \u043f\u043e\u043b\u0443\u0447\u0438\u0432\u0448\u0435\u0435\u0441\u044f \u0440\u0435\u0448\u0435\u043d\u0438\u0435.<\/p>\n<p>\u041f\u043e \u043f\u043e\u0432\u043e\u0434\u0443 \u0434\u043e\u043f\u0443\u0441\u0442\u0438\u043c\u043e\u0441\u0442\u0438 \u043f\u043e\u043b\u043d\u044b\u0445 \u0442\u0435\u043a\u0441\u0442\u043e\u0432 \u0440\u0430\u0441\u0448\u0438\u0444\u0440\u043e\u0432\u0449\u0438\u043a\u043e\u0432 \u0432 \u0441\u0442\u0430\u0442\u044c\u044f\u0445 \u0432\u0440\u043e\u0434\u0435 \u044d\u0442\u043e\u0439 &#8212; \u043d\u0430\u0434\u0435\u044e\u0441\u044c, \u0447\u0442\u043e \u043a\u043e\u043c\u043f\u0435\u0442\u0435\u043d\u0442\u043d\u044b\u0435 \u0432 \u044d\u0442\u043e\u043c \u0432\u043e\u043f\u0440\u043e\u0441\u0435 \u0447\u0438\u0442\u0430\u0442\u0435\u043b\u0438 \u0441\u043c\u043e\u0433\u0443\u0442 \u0432\u043d\u0435\u0441\u0442\u0438 \u0441\u0432\u043e\u0438 \u0443\u0442\u043e\u0447\u043d\u0435\u043d\u0438\u044f \u0432 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u044f\u0445.<\/p>\n<h2>\u041d\u0430\u0447\u043d\u0451\u043c \u0441\u043d\u0430\u0447\u0430\u043b\u0430<\/h2>\n<p>\u0418\u0442\u0430\u043a, \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u043e\u0436\u0438\u043c, \u0447\u0442\u043e \u0443 \u043d\u0430\u0441 \u043d\u0430 Linux-\u0445\u043e\u0441\u0442\u0435 \u0441 CentOS 7 \u0443\u0436\u0435 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d Ansible, \u043a \u043f\u0440\u0438\u043c\u0435\u0440\u0443, \u0432\u0435\u0440\u0441\u0438\u0438 2.9 \u0434\u043b\u044f Python \u0432\u0435\u0440\u0441\u0438\u0438 3.6. \u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d, \u043a\u043e\u043d\u0435\u0447\u043d\u043e \u0436\u0435, \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <code>virtualenv<\/code> \u0432 \u043a\u0430\u0442\u0430\u043b\u043e\u0433 &#171;<code>\/opt\/ansible<\/code>&#171;. \u0414\u0430\u043b\u044c\u0448\u0435 \u0434\u043b\u044f \u0446\u0435\u043b\u0435\u0439 \u0443\u0434\u043e\u0432\u043b\u0435\u0442\u0432\u043e\u0440\u0435\u043d\u0438\u044f \u0447\u0438\u0441\u0442\u043e\u0433\u043e \u043d\u0430\u0443\u0447\u043d\u043e\u0433\u043e \u043b\u044e\u0431\u043e\u043f\u044b\u0442\u0441\u0442\u0432\u0430 \u0432\u043e\u0437\u044c\u043c\u0451\u043c \u043a\u0430\u043a\u043e\u0439-\u043d\u0438\u0431\u0443\u0434\u044c YaML-\u0444\u0430\u0439\u043b, \u0438 \u0437\u0430\u0448\u0438\u0444\u0440\u0443\u0435\u043c \u0435\u0433\u043e \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0443\u0442\u0438\u043b\u0438\u0442\u044b <code>ansible-vault<\/code>:<\/p>\n<pre><code class=\"bash\">ansible-vault encrypt vaulted.yml --vault-password-file=.password<\/code><\/pre>\n<p>\u042d\u0442\u043e\u0442 \u0432\u044b\u0437\u043e\u0432, \u043a\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u0434\u043e\u0433\u0430\u0434\u0430\u0442\u044c\u0441\u044f, \u0437\u0430\u0448\u0438\u0444\u0440\u0443\u0435\u0442 \u0444\u0430\u0439\u043b <code>vaulted.yml<\/code> \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043f\u0430\u0440\u043e\u043b\u044f, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0445\u0440\u0430\u043d\u0438\u0442\u0441\u044f \u0432 \u0444\u0430\u0439\u043b\u0435 <code>.password<\/code>.<\/p>\n<p>\u0418\u0442\u0430\u043a, \u0447\u0442\u043e \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f \u043f\u043e\u0441\u043b\u0435 \u0437\u0430\u0448\u0438\u0444\u0440\u043e\u0432\u044b\u0432\u0430\u043d\u0438\u044f \u0444\u0430\u0439\u043b\u0430 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0443\u0442\u0438\u043b\u0438\u0442\u044b <code>ansible-vault<\/code>? \u041d\u0430 \u043f\u0435\u0440\u0432\u044b\u0439 \u0432\u0437\u0433\u043b\u044f\u0434 &#8212; \u0431\u0435\u043b\u0438\u0431\u0435\u0440\u0434\u0430 \u043a\u0430\u043a\u0430\u044f-\u0442\u043e, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0441\u043f\u0440\u044f\u0447\u0443 \u0435\u0451 \u043f\u043e\u0434 \u0441\u043f\u043e\u0439\u043b\u0435\u0440:<\/p>\n<details class=\"spoiler\">\n<summary>\u0421\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u0444\u0430\u0439\u043b\u0430 vaulted.yml<\/summary>\n<div class=\"spoiler__content\">\n<pre><code>$ANSIBLE_VAULT;1.1;AES256 61373536353963313739366536643661313861663266373130373730666634343337356536333664 3365393033623439356364663537353365386464623836640a356464633264626330383232353362 63613135373638393665663962303530323061376432333931306161303966633338303565666337 6465393837636665300a633732313730626265636538363339383237306264633830653665343639 30353863633137313866393566643661323536633666343837623130363966613363373962343630 34386234633236363363326436666630643937313630346230386538613735366431363934316364 37346337323833333165386534353432386663343465333836643131643237313262386634396534 38316630356530626430316238383364376561393637363262613666373836346262666536613164 66316638343162626631623535323666643863303231396432666365626536393062386531623165 63613934323836303536613532623864303839313038336232616134626433353166383837643165 643439363835643731316238316439633039<\/code><\/pre>\n<\/div>\n<\/details>\n<p>\u041d\u0443 \u0430 \u043a\u0430\u043a \u0438\u043c\u0435\u043d\u043d\u043e \u044d\u0442\u0430 \u0431\u0435\u043b\u0438\u0431\u0435\u0440\u0434\u0430 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 &#171;\u043f\u043e\u0434 \u043a\u0430\u043f\u043e\u0442\u043e\u043c&#187; &#8212; \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u0440\u0430\u0437\u0431\u0438\u0440\u0430\u0442\u044c\u0441\u044f.<\/p>\n<p>\u041e\u0442\u043a\u0440\u044b\u0432\u0430\u0435\u043c \u0444\u0430\u0439\u043b <code>\/opt\/ansible\/lib\/python3.6\/site-packages\/ansible\/parsing\/vault\/__init__.py<\/code>, \u0438 \u0432 \u043a\u043e\u0434\u0435 \u043c\u0435\u0442\u043e\u0434\u0430 <code>encrypt<\/code> \u043a\u043b\u0430\u0441\u0441\u0430 <code>VaultLib<\/code> \u0432\u0438\u0434\u0438\u043c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u0432\u044b\u0437\u043e\u0432:<\/p>\n<details class=\"spoiler\">\n<summary>VaultLib.encrypt<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"python\"> ...  b_ciphertext = this_cipher.encrypt(b_plaintext, secret)  ...<\/code><\/pre>\n<\/div>\n<\/details>\n<p>\u0422\u043e \u0435\u0441\u0442\u044c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0438\u0440\u0443\u044e\u0449\u0435\u0435 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u043d\u0430\u0448\u0435\u0433\u043e \u0444\u0430\u0439\u043b\u0430 \u0431\u0443\u0434\u0435\u0442 \u0441\u043e\u0437\u0434\u0430\u043d\u043e \u0432 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u0432\u044b\u0437\u043e\u0432\u0430 \u043c\u0435\u0442\u043e\u0434\u0430 <code>encrypt<\/code> \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u043a\u043b\u0430\u0441\u0441\u0430. \u041a\u0430\u043a\u043e\u0433\u043e \u0438\u043c\u0435\u043d\u043d\u043e &#8212; \u0432 \u043e\u0431\u0449\u0435\u043c-\u0442\u043e, \u043d\u0435\u0432\u0435\u043b\u0438\u043a\u0430 \u0437\u0430\u0433\u0430\u0434\u043a\u0430, \u043d\u0438\u0436\u0435 \u043f\u043e \u0444\u0430\u0439\u043b\u0443 \u0435\u0441\u0442\u044c \u0432\u0441\u0435\u0433\u043e \u043e\u0434\u0438\u043d \u043a\u043b\u0430\u0441\u0441 \u0441 \u0438\u043c\u0435\u043d\u0435\u043c <code>VaultAES256<\/code>.<\/p>\n<p>\u0421\u043c\u043e\u0442\u0440\u0438\u043c \u0432 \u0435\u0433\u043e \u043c\u0435\u0442\u043e\u0434 <code>encrypt<\/code>:<\/p>\n<details class=\"spoiler\">\n<summary>VaultAES256.encrypt<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"python\">@classmethod def encrypt(cls, b_plaintext, secret):     if secret is None:         raise AnsibleVaultError('The secret passed to encrypt() was None')     b_salt = os.urandom(32)     b_password = secret.bytes     b_key1, b_key2, b_iv = cls._gen_key_initctr(b_password, b_salt)      if HAS_CRYPTOGRAPHY:         b_hmac, b_ciphertext = cls._encrypt_cryptography(b_plaintext, b_key1, b_key2, b_iv)     elif HAS_PYCRYPTO:         b_hmac, b_ciphertext = cls._encrypt_pycrypto(b_plaintext, b_key1, b_key2, b_iv)     else:         raise AnsibleError(NEED_CRYPTO_LIBRARY + '(Detected in encrypt)')      b_vaulttext = b'\\n'.join([hexlify(b_salt), b_hmac, b_ciphertext])     # Unnecessary but getting rid of it is a backwards incompatible vault     # format change     b_vaulttext = hexlify(b_vaulttext)     return b_vaulttext<\/code><\/pre>\n<p><a class=\"anchor\" name=\"vaultencrypt\" id=\"vaultencrypt\"><\/a><\/div>\n<\/details>\n<p>\u0422\u043e \u0435\u0441\u0442\u044c \u043f\u0435\u0440\u0432\u043e-\u043d\u0430\u043f\u0435\u0440\u0432\u043e \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u0442\u0441\u044f &#171;\u0441\u043e\u043b\u044c&#187; \u0434\u043b\u0438\u043d\u043e\u0439 32 \u0431\u0430\u0439\u0442\u0430. \u0417\u0430\u0442\u0435\u043c \u0438\u0437 \u043f\u043e\u0431\u0430\u0439\u0442\u043d\u043e\u0433\u043e \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043f\u0430\u0440\u043e\u043b\u044f \u0438 &#171;\u0441\u043e\u043b\u0438&#187; \u0432\u044b\u0437\u043e\u0432\u043e\u043c <code>_gen_key_initctr<\/code> \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u043f\u0430\u0440\u0430 \u043a\u043b\u044e\u0447\u0435\u0439 (<code>b_key1<\/code>, <code>b_key2<\/code>) \u0438 \u0432\u0435\u043a\u0442\u043e\u0440 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 (<code>b_iv<\/code>). <\/p>\n<h2>\u0413\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u044f \u043a\u043b\u044e\u0447\u0435\u0439<\/h2>\n<p>\u0427\u0442\u043e \u0436\u0435 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0432 <code>_gen_key_initctr<\/code>?<\/p>\n<details class=\"spoiler\">\n<summary>_gen_key_initctr:<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"python\">@classmethod def _gen_key_initctr(cls, b_password, b_salt):     # 16 for AES 128, 32 for AES256     key_length = 32      if HAS_CRYPTOGRAPHY:         # AES is a 128-bit block cipher, so IVs and counter nonces are 16 bytes         iv_length = algorithms.AES.block_size \/\/ 8          b_derivedkey = cls._create_key_cryptography(b_password, b_salt, key_length, iv_length)         b_iv = b_derivedkey[(key_length * 2):(key_length * 2) + iv_length]     elif HAS_PYCRYPTO:         # match the size used for counter.new to avoid extra work         iv_length = 16          b_derivedkey = cls._create_key_pycrypto(b_password, b_salt, key_length, iv_length)         b_iv = hexlify(b_derivedkey[(key_length * 2):(key_length * 2) + iv_length])     else:         raise AnsibleError(NEED_CRYPTO_LIBRARY + '(Detected in initctr)')      b_key1 = b_derivedkey[:key_length]     b_key2 = b_derivedkey[key_length:(key_length * 2)]      return b_key1, b_key2, b_iv<\/code><\/pre>\n<\/div>\n<\/details>\n<p>\u0415\u0441\u043b\u0438 \u043f\u043e \u0441\u0443\u0442\u0438, \u0442\u043e \u0432\u043d\u0443\u0442\u0440\u0438 \u044d\u0442\u043e\u0433\u043e \u043c\u0435\u0442\u043e\u0434\u0430 \u0432\u044b\u0437\u043e\u0432 <code>_create_key_cryptography<\/code> \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u043f\u0430\u0440\u043e\u043b\u044f, &#171;\u0441\u043e\u043b\u0438&#187;, \u0434\u043b\u0438\u043d\u044b \u043a\u043b\u044e\u0447\u0430 \u0438 \u0434\u043b\u0438\u043d\u044b \u0432\u0435\u043a\u0442\u043e\u0440\u0430 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u0442 \u043d\u0435\u043a\u0438\u0439 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u043d\u044b\u0439 \u043a\u043b\u044e\u0447 (\u0441\u0442\u0440\u043e\u043a\u0430 10 \u043f\u0440\u0438\u0432\u0435\u0434\u0451\u043d\u043d\u043e\u0433\u043e \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442\u0430). \u0414\u0430\u043b\u0435\u0435 \u044d\u0442\u043e\u0442 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u043d\u044b\u0439 \u043a\u043b\u044e\u0447 \u0440\u0430\u0437\u0431\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u043d\u0430 \u0447\u0430\u0441\u0442\u0438, \u0438 \u043f\u043e\u043b\u0443\u0447\u0430\u044e\u0442\u0441\u044f \u0442\u0435 \u0441\u0430\u043c\u044b\u0435 <code>b_key1<\/code>, <code>b_key2<\/code> \u0438 <code>b_iv<\/code>.<\/p>\n<p>\u0421\u043b\u0435\u0434\u0443\u0435\u043c \u043f\u043e \u043a\u0440\u043e\u043b\u0438\u0447\u044c\u0435\u0439 \u043d\u043e\u0440\u0435 \u0434\u0430\u043b\u044c\u0448\u0435. \u0427\u0442\u043e \u0432\u043d\u0443\u0442\u0440\u0438 <code>_create_key_cryptography<\/code><em>?<\/em><\/p>\n<details class=\"spoiler\">\n<summary>_create_key_cryptography:<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"python\">@staticmethod def _create_key_cryptography(b_password, b_salt, key_length, iv_length):     kdf = PBKDF2HMAC(         algorithm=hashes.SHA256(),         length=2 * key_length + iv_length,         salt=b_salt,         iterations=10000,         backend=CRYPTOGRAPHY_BACKEND)     b_derivedkey = kdf.derive(b_password)      return b_derivedkey<\/code><\/pre>\n<\/div>\n<\/details>\n<p>\u041d\u0438\u0447\u0435\u0433\u043e \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0433\u043e. \u0415\u0441\u043b\u0438 \u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0432 \u0441\u0442\u043e\u0440\u043e\u043d\u0435 \u0432\u0441\u044e \u043c\u0438\u0448\u0443\u0440\u0443, \u0442\u043e \u0432 \u0438\u0442\u043e\u0433\u0435 \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 OpenSSL \u043f\u043e\u0434 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435\u043c <code>PBKDF2HMAC<\/code> \u0441 \u043d\u0443\u0436\u043d\u044b\u043c\u0438 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u043c\u0438. \u041c\u043e\u0436\u0435\u0442\u0435, \u043a\u0441\u0442\u0430\u0442\u0438, \u0441\u0430\u043c\u043e\u043b\u0438\u0447\u043d\u043e \u0432 \u044d\u0442\u043e\u043c \u0443\u0431\u0435\u0434\u0438\u0442\u044c\u0441\u044f, \u043e\u0442\u043a\u0440\u044b\u0432 \u0444\u0430\u0439\u043b <code>\/opt\/ansible\/lib\/python3.6\/site-packages\/cryptography\/hazmat\/backends\/openssl\/backend.py.<\/code><\/p>\n<p>\u041a\u0441\u0442\u0430\u0442\u0438, \u0434\u043b\u0438\u043d\u0430 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u043d\u043e\u0433\u043e \u043a\u043b\u044e\u0447\u0430, \u043a\u0430\u043a \u0432\u0438\u0434\u0438\u0442\u0435, \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u043e \u0432\u044b\u0431\u0438\u0440\u0430\u0435\u0442\u0441\u044f \u0442\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u0447\u0442\u043e\u0431\u044b \u0445\u0432\u0430\u0442\u0438\u043b\u043e \u0438 \u043d\u0430 <code>b_key1<\/code>, \u0438 \u043d\u0430 <code>b_key2<\/code>, \u0438 \u043d\u0430 <code>b_iv<\/code>.<\/p>\n<h2>\u0421\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0448\u0438\u0444\u0440\u043e\u0432\u0430\u043d\u0438\u0435<\/h2>\n<p>\u0414\u0432\u0438\u0436\u0435\u043c\u0441\u044f \u0434\u0430\u043b\u044c\u0448\u0435. \u0417\u0434\u0435\u0441\u044c \u043d\u0430\u0441 \u0432\u0441\u0442\u0440\u0435\u0447\u0430\u0435\u0442 \u0432\u044b\u0437\u043e\u0432 <code>_encrypt_cryptography<\/code> \u0441 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u043c\u0438 \u0432 \u0432\u0438\u0434\u0435 \u043e\u0442\u043a\u0440\u044b\u0442\u043e\u0433\u043e \u0442\u0435\u043a\u0441\u0442\u0430, \u043e\u0431\u043e\u0438\u0445 \u043a\u043b\u044e\u0447\u0435\u0439 \u0438 \u0432\u0435\u043a\u0442\u043e\u0440\u0430 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438:<\/p>\n<details class=\"spoiler\">\n<summary>_encrypt_cryptography<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"python\">@staticmethod def _encrypt_cryptography(b_plaintext, b_key1, b_key2, b_iv):     cipher = C_Cipher(algorithms.AES(b_key1), modes.CTR(b_iv), CRYPTOGRAPHY_BACKEND)     encryptor = cipher.encryptor()     padder = padding.PKCS7(algorithms.AES.block_size).padder()     b_ciphertext = encryptor.update(padder.update(b_plaintext) + padder.finalize())     b_ciphertext += encryptor.finalize()      # COMBINE SALT, DIGEST AND DATA     hmac = HMAC(b_key2, hashes.SHA256(), CRYPTOGRAPHY_BACKEND)     hmac.update(b_ciphertext)     b_hmac = hmac.finalize()      return to_bytes(hexlify(b_hmac), errors='surrogate_or_strict'), hexlify(b_ciphertext)<\/code><\/pre>\n<\/div>\n<\/details>\n<p>\u0412 \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u0435, \u0442\u0443\u0442 \u043d\u0435\u0442 \u043d\u0438\u0447\u0435\u0433\u043e \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0433\u043e: \u0448\u0438\u0444\u0440 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0438\u0437 \u0432\u0435\u043a\u0442\u043e\u0440\u0430 <code>b_iv<\/code>, \u0437\u0430\u0442\u0435\u043c \u043f\u0435\u0440\u0432\u044b\u043c \u043a\u043b\u044e\u0447\u043e\u043c <code>b_key1<\/code> \u0448\u0438\u0444\u0440\u0443\u0435\u0442\u0441\u044f \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u0442\u0435\u043a\u0441\u0442, \u0430 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u044d\u0442\u043e\u0433\u043e \u0448\u0438\u0444\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0445\u044d\u0448\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0432\u0442\u043e\u0440\u043e\u0433\u043e \u043a\u043b\u044e\u0447\u0430 <code>b_key2<\/code>.<\/p>\n<p>\u041f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u0435 \u0432 \u0438\u0442\u043e\u0433\u0435 \u0431\u0430\u0439\u0442\u044b \u043f\u043e\u0434\u043f\u0438\u0441\u0438 \u0438 \u0448\u0438\u0444\u0440\u0442\u0435\u043a\u0441\u0442\u0430 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u0443\u044e\u0442\u0441\u044f \u0432 \u0441\u0442\u0440\u043e\u043a\u0438 \u0441\u0432\u043e\u0438\u0445 \u0448\u0435\u0441\u0442\u043d\u0430\u0434\u0446\u0430\u0442\u0435\u0440\u0438\u0447\u043d\u044b\u0445 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0439 \u0447\u0435\u0440\u0435\u0437 <code>hexlify<\/code>. (\u0441\u043c. \u0441\u0442\u0440\u043e\u043a\u0430 14 \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442\u0430 \u0432\u044b\u0448\u0435)<\/p>\n<h2>\u041e\u043a\u043e\u043d\u0447\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0435 \u043e\u0444\u043e\u0440\u043c\u043b\u0435\u043d\u0438\u0435 \u0444\u0430\u0439\u043b\u0430<\/h2>\n<p>\u0412\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c\u0441\u044f \u043a \u0441\u0442\u0440\u043e\u043a\u0430\u043c 16-20 \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442\u0430 <a href=\"http:\/\/vaultencrypt\" rel=\"noopener noreferrer nofollow\">VaultAES256.encrypt:<\/a> \u0442\u0440\u0438 \u0441\u0442\u0440\u043e\u043a\u0438, \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0449\u0438\u0435 &#171;\u0441\u043e\u043b\u044c&#187;, \u043f\u043e\u0434\u043f\u0438\u0441\u044c \u0438 \u0448\u0438\u0444\u0440\u0442\u0435\u043a\u0441\u0442, \u0441\u043a\u043b\u0435\u0438\u0432\u0430\u044e\u0442\u0441\u044f \u0432\u043c\u0435\u0441\u0442\u0435, \u043f\u043e\u0441\u043b\u0435 \u0447\u0435\u0433\u043e \u0441\u043d\u043e\u0432\u0430 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u0443\u044e\u0442\u0441\u044f \u0432 \u0448\u0435\u0441\u0442\u043d\u0430\u0434\u0446\u0430\u0442\u0435\u0440\u0438\u0447\u043d\u043e\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435 (\u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0439 \u043f\u0440\u044f\u043c\u043e \u043f\u043e\u0434\u0441\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442, \u0447\u0442\u043e \u044d\u0442\u043e &#8212; \u0434\u043b\u044f \u043e\u0431\u0440\u0430\u0442\u043d\u043e\u0439 \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c\u043e\u0441\u0442\u0438).<\/p>\n<p>\u0414\u0430\u043b\u044c\u0448\u0435 \u0434\u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a (\u043f\u043e\u043c\u043d\u0438\u0442\u0435, \u0442\u043e\u0442 \u0441\u0430\u043c\u044b\u0439 &#8212; <code>$ANSIBLE_VAULT;1.1;AES256)<\/code>, \u043d\u0443 \u0438, \u0432 \u043e\u0431\u0449\u0435\u043c-\u0442\u043e, \u0432\u0441\u0451.<\/p>\n<h2>\u041e\u0431\u0440\u0430\u0442\u043d\u044b\u0439 \u043f\u0440\u043e\u0446\u0435\u0441\u0441<\/h2>\n<p>\u041f\u043e\u0441\u043b\u0435 \u0442\u043e\u0433\u043e, \u043a\u0430\u043a \u043c\u044b \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u043b\u0438\u0441\u044c \u0432 \u043f\u0440\u044f\u043c\u043e\u043c \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0435, \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u043e\u0431\u0440\u0430\u0442\u043d\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u043d\u0435 \u0441\u043b\u0438\u0448\u043a\u043e\u043c \u0441\u043b\u043e\u0436\u043d\u043e &#8212; \u043f\u043e \u043a\u0440\u0430\u0439\u043d\u0435\u0439 \u043c\u0435\u0440\u0435, \u0435\u0441\u043b\u0438 \u0432\u044b\u0431\u0440\u0430\u0442\u044c \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u044b\u0439 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442.<\/p>\n<p>\u041f\u043e\u043d\u044f\u0442\u043d\u043e, \u0447\u0442\u043e Python \u043d\u0430\u043c \u043d\u0435 \u043f\u043e\u0434\u0445\u043e\u0434\u0438\u0442, \u0438\u043d\u0430\u0447\u0435 \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0438 \u043e\u0433\u043e\u0440\u043e\u0434 \u043d\u0435 \u0433\u043e\u0440\u043e\u0434\u0438\u0442\u044c: ansible-vault \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u043e \u0445\u043e\u0440\u043e\u0448\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0432 \u043e\u0431\u0435 \u0441\u0442\u043e\u0440\u043e\u043d\u044b. \u0421 \u0434\u0440\u0443\u0433\u043e\u0439 \u0441\u0442\u043e\u0440\u043e\u043d\u044b, \u043d\u0438\u043a\u0442\u043e \u043d\u0435 \u043c\u0435\u0448\u0430\u0435\u0442 \u043d\u0430 \u0431\u0430\u0437\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a Ansible \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0447\u0442\u043e-\u043b\u0438\u0431\u043e \u0441\u0432\u043e\u0451 &#8212; \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0440\u0430\u0437\u043c\u0438\u043d\u043a\u0438 \u043f\u0435\u0440\u0435\u0434 &#171;\u043f\u043e\u0434\u0445\u043e\u0434\u043e\u043c \u043a \u0441\u043d\u0430\u0440\u044f\u0434\u0443&#187; \u044f \u0442\u0430\u043a \u0438 \u0441\u0434\u0435\u043b\u0430\u043b, \u0438 \u043e \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u043d\u0430\u043f\u0438\u0448\u0443 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u0443\u044e \u0441\u0442\u0430\u0442\u044c\u044e.<\/p>\n<p>\u0422\u0435\u043c \u043d\u0435 \u043c\u0435\u043d\u0435\u0435, \u0434\u043b\u044f \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u043f\u0440\u0435\u0434\u043c\u0435\u0442\u0430 \u0441\u0442\u0430\u0442\u044c\u0438 \u044f \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0441\u044f FreePascal. \u0412\u0432\u0438\u0434\u0443 \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u044f\u0437\u044b\u043a\u043e\u0432\u043e\u0439 \u0445\u043e\u043b\u0438\u0432\u0430\u0440 \u0442\u0435\u043c\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0438 \u043d\u0435 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f, \u0431\u0443\u0434\u0443 \u043a\u0440\u0430\u0442\u043e\u043a: \u0432\u044b\u0431\u0440\u0430\u043b \u044d\u0442\u043e\u0442 \u044f\u0437\u044b\u043a, \u0432\u043e-\u043f\u0435\u0440\u0432\u044b\u0445, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u043c\u043e\u0433\u0443, \u0430 \u0432\u043e-\u0432\u0442\u043e\u0440\u044b\u0445 &#8212; \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c\u044b\u0439 \u0431\u0438\u043d\u0430\u0440\u043d\u0438\u043a \u0443\u0434\u043e\u0432\u043b\u0435\u0442\u0432\u043e\u0440\u044f\u0435\u0442 \u0437\u0430\u0434\u0430\u043d\u043d\u044b\u043c \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u044f\u043c.<\/p>\n<p>\u0418\u0442\u0430\u043a, \u043d\u0430\u043c \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u044f\u0442\u0441\u044f: FreePascal \u0432\u0435\u0440\u0441\u0438\u0438 3.0.4 (\u044d\u0442\u0430 \u0432\u0435\u0440\u0441\u0438\u044f \u0432 \u0432\u0438\u0434\u0435 \u0433\u043e\u0442\u043e\u0432\u044b\u0445 \u043f\u0430\u043a\u0435\u0442\u043e\u0432 &#8212; \u0441\u0430\u043c\u0430\u044f \u0441\u0432\u0435\u0436\u0430\u044f, \u043d\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u043e \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u044e\u0449\u0430\u044f\u0441\u044f \u0432 CentOS 7), \u0438 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 DCPCrypt \u0432\u0435\u0440\u0441\u0438\u0438 2.1 (<a href=\"https:\/\/github.com\/StephenGenusa\/DCPCrypt\" rel=\"noopener noreferrer nofollow\">\u043d\u0430 GitHub<\/a>). \u0418\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e, \u0447\u0442\u043e \u043f\u0440\u044f\u043c\u043e \u0432\u043c\u0435\u0441\u0442\u0435 \u0441 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u043e\u043c (<code>fpc<\/code>) \u0438 \u043e\u0431\u0448\u0438\u0440\u043d\u044b\u043c \u043d\u0430\u0431\u043e\u0440\u043e\u043c \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a \u0432 rpm-\u043f\u0430\u043a\u0435\u0442\u0435 \u043f\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043a\u043e\u043d\u0441\u043e\u043b\u044c\u043d\u0430\u044f \u0441\u0440\u0435\u0434\u0430 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 <code>fp<\/code>.<\/p>\n<p>\u041a \u0441\u043e\u0436\u0430\u043b\u0435\u043d\u0438\u044e, &#171;\u0438\u0441\u043a\u0430\u0440\u043e\u043f\u043a\u0438&#187; \u043c\u043e\u0434\u0443\u043b\u0438 \u044d\u0442\u043e\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u043d\u0435 \u0441\u043e\u0431\u0438\u0440\u0430\u044e\u0442\u0441\u044f \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u043e\u043c <code>fpc<\/code> &#8212; \u0432 \u043d\u0438\u0445 \u043d\u0443\u0436\u043d\u044b \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u0435 \u043f\u0440\u0430\u0432\u043a\u0438. \u0421 \u0434\u0440\u0443\u0433\u043e\u0439 \u0441\u0442\u043e\u0440\u043e\u043d\u044b, \u044f \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u0430\u0433\u0430\u044e, \u0447\u0442\u043e \u0431\u0435\u0437 \u044d\u0442\u0438\u0445 \u043f\u0440\u0430\u0432\u043e\u043a \u043f\u0440\u0435\u0434\u043c\u0435\u0442 \u0441\u0442\u0430\u0442\u044c\u0438 \u043f\u0435\u0440\u0435\u0441\u0442\u0430\u0451\u0442 \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u044c\u0441\u044f \u043a \u043b\u0438\u0446\u0435\u043d\u0437\u0438\u0440\u0443\u0435\u043c\u044b\u043c \u0432\u0438\u0434\u0430\u043c \u0434\u0435\u044f\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u0438 \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0442\u044c \u0447\u0438\u0441\u0442\u043e \u0430\u043a\u0430\u0434\u0435\u043c\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0438\u043d\u0442\u0435\u0440\u0435\u0441 &#8212; \u0438\u043c\u0435\u043d\u043d\u043e \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0432\u044b\u043a\u043b\u0430\u0434\u044b\u0432\u0430\u044e \u0441\u0442\u0430\u0442\u044c\u044e \u0431\u0435\u0437 \u043d\u0438\u0445.<\/p>\n<p>\u0427\u0430\u0441\u0442\u044c \u043a\u043e\u0434\u0430, \u043e\u0442\u043d\u043e\u0441\u044f\u0449\u0443\u044e\u0441\u044f \u043a \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044e \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u043d\u043e\u0433\u043e \u043a\u043b\u044e\u0447\u0430 (\u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e \u0442\u043e\u0439 \u0441\u0430\u043c\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 PBKDF2), \u044f \u043d\u0430\u0448\u0451\u043b <a href=\"https:\/\/keit.co\/p\/dcpcrypt-hmac-rfc2104\/\" rel=\"noopener noreferrer nofollow\">\u0432<\/a><a href=\"http:\/\/keit.co\/p\/dcpcrypt-hmac-rfc2104\/\" rel=\"noopener noreferrer nofollow\"> \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442\u0435<\/a>, \u0438 \u043f\u043e\u043c\u0435\u0441\u0442\u0438\u043b \u0432 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 \u043c\u043e\u0434\u0443\u043b\u044c \u043f\u043e\u0434 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435\u043c &#171;kdf&#187;.<\/p>\n<p>\u0412\u043e\u0442 \u044d\u0442\u043e\u0442 \u043c\u043e\u0434\u0443\u043b\u044c \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0439 \u043f\u0435\u0440\u0441\u043e\u043d\u043e\u0439:<\/p>\n<details class=\"spoiler\">\n<summary>kdf.pas<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"delphi\">{$MODE OBJFPC}  \/\/ ALL CREDITS FOR THIS CODE TO https:\/\/keit.co\/p\/dcpcrypt-hmac-rfc2104\/  unit kdf;  interface uses dcpcrypt2,math; function PBKDF2(pass, salt: ansistring; count, kLen: Integer; hash: TDCP_hashclass): ansistring; function CalcHMAC(message, key: string; hash: TDCP_hashclass): string;  implementation function RPad(x: string; c: Char; s: Integer): string; var   i: Integer; begin   Result := x;   if Length(x) &lt; s then     for i := 1 to s-Length(x) do       Result := Result + c; end;  function XorBlock(s, x: ansistring): ansistring; inline; var   i: Integer; begin   SetLength(Result, Length(s));   for i := 1 to Length(s) do     Result[i] := Char(Byte(s[i]) xor Byte(x[i])); end;  function CalcDigest(text: string; dig: TDCP_hashclass): string; var   x: TDCP_hash; begin   x := dig.Create(nil);   try     x.Init;     x.UpdateStr(text);     SetLength(Result, x.GetHashSize div 8);     x.Final(Result[1]);   finally     x.Free;   end; end;  function CalcHMAC(message, key: string; hash: TDCP_hashclass): string; const   blocksize = 64; begin   \/\/ Definition RFC 2104   if Length(key) &gt; blocksize then     key := CalcDigest(key, hash);   key := RPad(key, #0, blocksize);   Result := CalcDigest(XorBlock(key, RPad('', #$36, blocksize)) + message, hash);   Result := CalcDigest(XorBlock(key, RPad('', #$5c, blocksize)) + result, hash); end;  function PBKDF1(pass, salt: ansistring; count: Integer; hash: TDCP_hashclass): ansistring; var   i: Integer; begin   Result := pass+salt;   for i := 0 to count-1 do     Result := CalcDigest(Result, hash); end;  function PBKDF2(pass, salt: ansistring; count, kLen: Integer; hash: TDCP_hashclass): ansistring;    function IntX(i: Integer): ansistring; inline;   begin     Result := Char(i shr 24) + Char(i shr 16) + Char(i shr 8) + Char(i);   end;  var   D, I, J: Integer;   T, F, U: ansistring; begin   T := '';   D := Ceil(kLen \/ (hash.GetHashSize div 8));   for i := 1 to D do   begin     F := CalcHMAC(salt + IntX(i), pass, hash);     U := F;     for j := 2 to count do     begin       U := CalcHMAC(U, pass, hash);       F := XorBlock(F, U);     end;     T := T + F;   end;   Result := Copy(T, 1, kLen); end;  end.<\/code><\/pre>\n<\/div>\n<\/details>\n<p>\u0418\u0437 \u0431\u0440\u043e\u0441\u0430\u044e\u0449\u0435\u0433\u043e\u0441\u044f \u0432 \u0433\u043b\u0430\u0437\u0430 &#8212; \u043e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435, \u0447\u0442\u043e \u0432 Pascal \u0438 \u0435\u0433\u043e \u043f\u043e\u0442\u043e\u043c\u043a\u0430\u0445 \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u043a\u043b\u0430\u0441\u0441\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u0440\u0430\u0437\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u043d\u0430 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u0447\u043d\u044b\u0435 \u0444\u0430\u0439\u043b\u044b \u0438 \u0444\u0430\u0439\u043b\u044b \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0441 \u043a\u043e\u0434\u043e\u043c, \u0432 \u044d\u0442\u043e\u043c \u0441\u043c\u044b\u0441\u043b\u0435 \u043c\u043e\u0434\u0443\u043b\u044c\u043d\u0430\u044f \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u0430\u0446\u0438\u044f \u0440\u043e\u0434\u043d\u0438\u0442 \u0435\u0433\u043e \u0441 Python, \u0438 \u043e\u0442\u043b\u0438\u0447\u0430\u0435\u0442 \u043e\u0442 C.<\/p>\n<p>\u041e\u0434\u043d\u0430\u043a\u043e \u043e\u0442 \u043f\u0438\u0442\u043e\u043d\u044f\u0447\u044c\u0435\u0433\u043e \u043c\u043e\u0434\u0443\u043b\u044f \u043f\u0430\u0441\u043a\u0430\u043b\u0435\u0432\u0441\u043a\u0438\u0439 \u043e\u0442\u043b\u0438\u0447\u0430\u0435\u0442\u0441\u044f \u0435\u0449\u0451 \u0438 \u0442\u0435\u043c, \u0447\u0442\u043e &#171;\u0441\u043d\u0430\u0440\u0443\u0436\u0438&#187; \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b \u0442\u043e\u043b\u044c\u043a\u043e \u0442\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438\/\u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u044b \u0432 \u0441\u0435\u043a\u0446\u0438\u0438 <code>interface<\/code>. \u0422\u043e \u0435\u0441\u0442\u044c \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0432\u043d\u0443\u0442\u0440\u0438 \u043c\u043e\u0434\u0443\u043b\u044f \u0442\u044b \u043c\u043e\u0436\u0435\u0448\u044c \u0445\u043e\u0442\u044c &#171;\u043d\u0430 \u0443\u0448\u0430\u0445 \u0441\u0442\u043e\u044f\u0442\u044c&#187; &#8212; \u0441\u043d\u0430\u0440\u0443\u0436\u0438 \u043d\u0438\u043a\u0442\u043e \u043d\u0435 \u0441\u043c\u043e\u0436\u0435\u0442 \u0432\u044b\u0437\u0432\u0430\u0442\u044c \u0442\u0432\u043e\u0438 \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0438\u0435 API. \u0422\u0430\u043a \u0443\u0441\u0442\u0440\u043e\u0435\u043d \u044f\u0437\u044b\u043a, \u0430 \u0445\u043e\u0440\u043e\u0448\u043e \u044d\u0442\u043e \u0438\u043b\u0438 \u043f\u043b\u043e\u0445\u043e &#8212; \u0432\u043e\u043f\u0440\u043e\u0441 \u0432\u043a\u0443\u0441\u0430, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043e\u0446\u0435\u043d\u043a\u0438 \u043e\u0441\u0442\u0430\u0432\u0438\u043c \u0432 \u0441\u0442\u043e\u0440\u043e\u043d\u0435 (\u043f\u0438\u0442\u043e\u043d\u0438\u0441\u0442\u0430\u043c \u043f\u0435\u0440\u0435\u0434\u0430\u044e\u0442 \u043f\u0440\u0438\u0432\u0435\u0442 \u0444\u0443\u043d\u043a\u0446\u0438\u0438\/\u043c\u0435\u0442\u043e\u0434\u044b, \u043d\u0430\u0447\u0438\u043d\u0430\u044e\u0449\u0438\u0435\u0441\u044f \u043d\u0430 &#171;_&#187; \u0438 &#171;__&#187;).<\/p>\n<h2>\u0417\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u0447\u043d\u0430\u044f \u0447\u0430\u0441\u0442\u044c<\/h2>\n<p>\u041a\u043e\u0434, \u043a\u0430\u043a \u043e\u0431\u044b\u0447\u043d\u043e, \u043f\u043e\u0434 \u0441\u043f\u043e\u0439\u043b\u0435\u0440\u043e\u043c.<\/p>\n<details class=\"spoiler\">\n<summary>\u0417\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u0447\u043d\u0430\u044f \u0447\u0430\u0441\u0442\u044c (&#171;\u0448\u0430\u043f\u043a\u0430&#187;, header)<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"delphi\">program devault; uses   math, sysutils, strutils, getopts, DCPcrypt2, DCPsha256, DCPrijndael, kdf;<\/code><\/pre>\n<\/div>\n<\/details>\n<p>\u0414\u0430\u043b\u0435\u0435 \u043d\u0430\u043c \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u0441\u044f \u043f\u0430\u0440\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u0439 &#8212; <code>hexlify<\/code> \u0438 <code>unhexlify<\/code> (\u043d\u0430\u0431\u0440\u043e\u0441\u0430\u043d\u044b, \u043a\u043e\u043d\u0435\u0447\u043d\u043e, &#171;\u043d\u0430 \u0441\u043a\u043e\u0440\u0443\u044e \u0440\u0443\u043a\u0443&#187;). \u041e\u043d\u0438 \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u0430\u043d\u0430\u043b\u043e\u0433\u0430\u043c\u0438 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439 Python &#8212; \u0432\u0442\u043e\u0440\u0430\u044f \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0441\u0442\u0440\u043e\u043a\u0443 \u0438\u0437 \u0448\u0435\u0441\u0442\u043d\u0430\u0434\u0446\u0430\u0442\u0435\u0440\u0438\u0447\u043d\u044b\u0445 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0439 \u0431\u0430\u0439\u0442\u043e\u0432 \u0432\u0445\u043e\u0434\u043d\u043e\u0433\u043e \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u0430, \u0430 \u043f\u0435\u0440\u0432\u0430\u044f &#8212; \u043d\u0430\u043e\u0431\u043e\u0440\u043e\u0442, \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u0438\u0442 \u0441\u0442\u0440\u043e\u043a\u0443 \u0448\u0435\u0441\u0442\u043d\u0430\u0434\u0446\u0430\u0442\u0435\u0440\u0438\u0447\u043d\u044b\u0445 \u043a\u043e\u0434\u043e\u0432 \u043e\u0431\u0440\u0430\u0442\u043d\u043e \u0432 \u0431\u0430\u0439\u0442\u044b.<\/p>\n<details class=\"spoiler\">\n<summary>hexlify\/unhexlify<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"delphi\">function unhexlify(s:AnsiString):AnsiString; var i:integer;     tmpstr:AnsiString; begin   tmpstr:='';   for i:=0 to (length(s) div 2)-1 do     tmpstr:=tmpstr+char(Hex2Dec(Copy(s,i*2+1,2)));   unhexlify:=tmpstr; end;  function hexlify(s:AnsiString):AnsiString; var i:integer;     tmpstr:AnsiString; begin   tmpstr:='';   for i:=1 to (length(s)) do     tmpstr:=tmpstr+IntToHex(ord(s[i]),2);   hexlify:=tmpstr; end;<\/code><\/pre>\n<\/div>\n<\/details>\n<p>\u041d\u0430\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0439 <code>showbanner()<\/code>, <code>showlicense()<\/code> \u0438 <code>showhelp()<\/code> \u043e\u0447\u0435\u0432\u0438\u0434\u043d\u043e \u0438\u0437 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0439, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u044f \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u0440\u0438\u0432\u0435\u0434\u0443 \u0438\u0445 \u0431\u0435\u0437 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0435\u0432.<\/p>\n<details class=\"spoiler\">\n<summary>showbanner() \/ showlicense() \/ showhelp()<\/summary>\n<div class=\"spoiler__content\">\n<details class=\"spoiler\">\n<summary>showbanner()<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"delphi\">procedure showbanner(); begin   WriteLn(stderr, 'DeVault v1.0');   Writeln(stderr, '(C) 2021, Sergey Pechenko. All rights reserved');   Writeln(stderr, 'Run with \"-l\" option to see license'); end;<\/code><\/pre>\n<\/div>\n<\/details>\n<details class=\"spoiler\">\n<summary>showlicense()<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"delphi\">procedure showlicense(); begin   WriteLn(stderr,'Redistribution and use in source and binary forms, with or without modification,');   WriteLn(stderr,'are permitted provided that the following conditions are met:');   WriteLn(stderr,'* Redistributions of source code must retain the above copyright notice, this');   WriteLn(stderr,'   list of conditions and the following disclaimer;');   WriteLn(stderr,'* Redistributions in binary form must reproduce the above copyright notice, ');   WriteLn(stderr,'   this list of conditions and the following disclaimer in the documentation');   WriteLn(stderr,'   and\/or other materials provided with the distribution.');   WriteLn(stderr,'* Sergey Pechenko''s name may not be used to endorse or promote products');   WriteLn(stderr,'   derived from this software without specific prior written permission.');   WriteLn(stderr,'THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"');   WriteLn(stderr,'AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,');   WriteLn(stderr,'THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE');   WriteLn(stderr,'ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE');   WriteLn(stderr,'FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES');   WriteLn(stderr,'(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;');   WriteLn(stderr,'LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON');   WriteLn(stderr,'ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT');   WriteLn(stderr,'(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,');   WriteLn(stderr,'EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.');   WriteLn(stderr,'Commercial license can be obtained from author'); end;<\/code><\/pre>\n<\/div>\n<\/details>\n<details class=\"spoiler\">\n<summary>showhelp()<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"delphi\">procedure showhelp(); begin   WriteLn(stderr,'Usage:');   WriteLn(stderr,Format('%s &lt;-p password | -w vault_password_file&gt; [-f secret_file]',[ParamStr(0)]));   WriteLn(stderr,#09'\"password\" is a text string which was used to encrypt your secured content');   WriteLn(stderr,#09'\"vault_password_file\" is a file with password');   WriteLn(stderr,#09'\"secret_file\" is a file with encrypted content');   WriteLn(stderr,'When \"-f\" argument is absent, stdin is read by default'); end;<\/code><\/pre>\n<\/div>\n<\/details>\n<\/div>\n<\/details>\n<p>\u0414\u0430\u043b\u044c\u0448\u0435 \u043e\u0431\u044a\u044f\u0432\u043b\u044f\u0435\u043c \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u0438 \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0431\u0443\u0434\u0443\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0432 \u043a\u043e\u0434\u0435. \u041f\u0440\u0438\u0432\u043e\u0436\u0443 \u0438\u0445 \u0437\u0434\u0435\u0441\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u0434\u043b\u044f \u043f\u043e\u043b\u043d\u043e\u0442\u044b \u0442\u0435\u043a\u0441\u0442\u0430, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0442\u0443\u0442 \u043e\u0441\u043e\u0431\u043e \u043d\u0435\u0447\u0435\u0433\u043e.<\/p>\n<details class=\"spoiler\">\n<summary>\u041f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u0438 \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u044b<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"delphi\">var secretfile, passwordfile, pass, salt, b_derived_key, b_key1, b_key2, b_iv,     hmac_new, cphrtxt, fullfile, header, tmpstr, hmac:Ansistring;     Cipher: TDCP_rijndael;     key, vector, data, crypt: RawByteString;     fulllist: TStringArray;     F: Text;     c: char;     opt_idx: LongInt;     options: array of TOption; const KEYLENGTH=32; \/\/ for AES256 const IV_LENGTH=128 div 8; const CONST_HEADER='$ANSIBLE_VAULT;1.1;AES256';<\/code><\/pre>\n<\/div>\n<\/details>\n<h2>\u041a\u043e\u0434<\/h2>\n<p>\u041d\u0443, \u043f\u043e\u0447\u0442\u0438 \u043a\u043e\u0434 &#8212; \u0432\u0441\u0451 \u0435\u0449\u0451 \u0432\u0441\u043f\u043e\u043c\u043e\u0433\u0430\u0442\u0435\u043b\u044c\u043d\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0432 \u0440\u0430\u043d\u0442\u0430\u0439\u043c\u0435 \u0433\u043e\u0442\u043e\u0432\u0438\u0442 \u043c\u0430\u0441\u0441\u0438\u0432 \u0437\u0430\u043f\u0438\u0441\u0435\u0439 \u0434\u043b\u044f \u0440\u0430\u0437\u0431\u043e\u0440\u0430 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 \u043a\u043e\u043c\u0430\u043d\u0434\u043d\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0438. \u041f\u043e\u0447\u0435\u043c\u0443 \u043e\u043d\u0430 \u0437\u0434\u0435\u0441\u044c &#8212; \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0441 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u043c\u0438, \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u043d\u044b\u043c\u0438 \u0432 \u0441\u0435\u043a\u0446\u0438\u0438 <code>vars<\/code> \u0432\u044b\u0448\u0435.<\/p>\n<details class=\"spoiler\">\n<summary>preparecliparams()<\/summary>\n<div class=\"spoiler__content\">\n<pre><code>procedure preparecliparams(); begin   SetLength(options, 6);   with options[1] do     begin       name:='password';       has_arg:=Required_Argument;       flag:=nil;       value:=#0;     end;   with options[2] do     begin       name:='file';       has_arg:=Required_Argument;       flag:=nil;       value:=#0;     end;   with options[3] do     begin       name:='passwordfile';       has_arg:=Required_Argument;       flag:=nil;       value:=#0;     end;   with options[4] do     begin       name:='version';       has_arg:=No_Argument;       flag:=nil;       value:=#0;     end;   with options[5] do     begin       name:='license';       has_arg:=No_Argument;       flag:=nil;       value:=#0;     end;   with options[6] do     begin       name:='help';       has_arg:=No_Argument;       flag:=nil;       value:=#0;     end; end;<\/code><\/pre>\n<\/div>\n<\/details>\n<p>\u0410 \u0432\u043e\u0442 \u0442\u0435\u043f\u0435\u0440\u044c \u0442\u043e\u0447\u043d\u043e \u043a\u043e\u0434 \u0441\u0430\u043c\u043e\u0439 \u0443\u0442\u0438\u043b\u0438\u0442\u044b:<\/p>\n<details class=\"spoiler\">\n<summary>\u0412\u0435\u0441\u044c \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u043e\u0439 \u043a\u043e\u0434<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"delphi\">begin   repeat     c:=getlongopts('p:f:w:lh?',@options[1],opt_idx);     case c of       'h','?' : begin showhelp(); halt(0); end;       'p' : pass:=optarg;       'f' : secretfile:=optarg;       'w' : passwordfile:=optarg;       'v' : begin showbanner(); halt(0); end;       'l' : begin showlicense(); halt(0); end;       ':' : writeln ('Error with opt : ',optopt); \/\/ not a mistake - defined in getops unit      end;   until c=endofoptions;   if pass = '' then \/\/ option -p not set     if passwordfile &lt;&gt; '' then       try         Assign(F,passwordfile);         Reset(F);         Readln(F,pass);         Close(F);       except         on E: EInOutError do         begin           Close(F);           writeln(stderr, 'Password not set and password file cannot be read, exiting');           halt(1);         end;       end     else       begin \/\/ options -p and -w are both not set           writeln(stderr, 'Password not set, password file not set, exiting');           showhelp();           halt(1);       end;   try     Assign(F,secretfile);     Reset(F);   except     on E: EInOutError do     begin       writeln(stderr, Format('File %s not found, exiting',[secretfile]));       halt(1);     end;   end;   readln(F,header);   if header&lt;&gt;CONST_HEADER then     begin       writeln(stderr, 'Header mismatch');       halt(1);     end;   fullfile:='';   while not EOF(F) do     begin     Readln(F,tmpstr);     fullfile:=fullfile+tmpstr;     end;   Close(F);   fulllist:=unhexlify(fullfile).Split([#10],3);   salt:=fulllist[0];   hmac:=fulllist[1];   cphrtxt:=fulllist[2];   salt:=unhexlify(salt);   cphrtxt:=unhexlify(cphrtxt);   b_derived_key:=PBKDF2(pass, salt, 10000, 2*32+16, TDCP_sha256);   b_key1:=Copy(b_derived_key,1,KEYLENGTH);   b_key2:=Copy(b_derived_key,KEYLENGTH+1,KEYLENGTH);   b_iv:=Copy(b_derived_key,KEYLENGTH*2+1,IV_LENGTH);   hmac_new:=lowercase(hexlify(CalcHMAC(cphrtxt, b_key2, TDCP_sha256)));   if hmac_new&lt;&gt;hmac then     begin     writeln(stderr, 'Digest mismatch - file has been tampered with, or an error has occured');     Halt(1);     end;   SetLength(data, Length(crypt));   Cipher := TDCP_rijndael.Create(nil);   try     Cipher.Init(b_key1[1], 256, @b_iv[1]);     Cipher.DecryptCTR(cphrtxt[1], data[1], Length(data));     Cipher.Burn;   finally     Cipher.Free;   end;   Writeln(data); end.<\/code><\/pre>\n<\/div>\n<\/details>\n<p>\u0414\u0430\u043b\u044c\u0448\u0435 \u0431\u0443\u0434\u0435\u0442 \u0441\u0442\u0440\u0430\u043d\u043d\u0430\u044f \u0442\u0430\u0431\u043b\u0438\u0446\u0430, \u043d\u043e, \u043a\u0430\u0436\u0435\u0442\u0441\u044f, \u044d\u0442\u043e &#8212; \u0441\u0430\u043c\u044b\u0439 \u0443\u0434\u043e\u0431\u043d\u044b\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u0430 \u043e\u0431 \u0438\u0441\u0445\u043e\u0434\u043d\u043e\u043c \u043a\u043e\u0434\u0435.<\/p>\n<div>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<td data-colwidth=\"70\" width=\"70\">\n<p>\u0421\u0442\u0440.<\/p>\n<\/td>\n<td data-colwidth=\"359\" width=\"359\">\n<p>\u041d\u0430\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435<\/p>\n<\/td>\n<td>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"70\" width=\"70\">\n<p>2-13<\/p>\n<\/td>\n<td data-colwidth=\"359\" width=\"359\">\n<p>\u0440\u0430\u0437\u0431\u043e\u0440 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 \u043a\u043e\u043c\u0430\u043d\u0434\u043d\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0438 \u0441 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435\u043c \u043d\u0443\u0436\u043d\u044b\u0445 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439;<\/p>\n<\/td>\n<td>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"70\" width=\"70\">\n<p>14-34<\/p>\n<\/td>\n<td data-colwidth=\"359\" width=\"359\">\n<p>\u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u043d\u0430\u043b\u0438\u0447\u0438\u044f \u043f\u0430\u0440\u043e\u043b\u044f \u0432 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u0445, \u043f\u0440\u0438 \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u0438 &#8212; \u043f\u043e\u043f\u044b\u0442\u043a\u0430 \u043f\u0440\u043e\u0447\u0435\u0441\u0442\u044c \u043f\u0430\u0440\u043e\u043b\u044c \u0438\u0437 \u0444\u0430\u0439\u043b\u0430, \u043f\u0440\u0438 \u043d\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 &#8212; \u043e\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c \u0440\u0430\u0431\u043e\u0442\u0443;<\/p>\n<\/td>\n<td>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"70\" width=\"70\">\n<p>35-44<\/p>\n<\/td>\n<td data-colwidth=\"359\" width=\"359\">\n<p>\u043f\u043e\u043f\u044b\u0442\u043a\u0430 \u043f\u0440\u043e\u0447\u0435\u0441\u0442\u044c \u0437\u0430\u0448\u0438\u0444\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u0444\u0430\u0439\u043b, \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u044b\u0439 \u0432 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u0445;<\/p>\n<\/td>\n<td>\n<p>\u041d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u0447\u0438\u0442: \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0438\u043c\u044f \u0444\u0430\u0439\u043b\u0430 (\u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f secretfile) \u0440\u0430\u0432\u043d\u043e \u043f\u0443\u0441\u0442\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0435; \u0432 \u044d\u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0432\u044b\u0437\u043e\u0432 <code>Assign(F, secretfile)<\/code> \u0432 \u0441\u0442\u0440\u043e\u043a\u0435 36 \u0441\u0432\u044f\u0436\u0435\u0442 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e F \u0441 <code>stdin<\/code><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"70\" width=\"70\">\n<p>45-50<\/p>\n<\/td>\n<td data-colwidth=\"359\" width=\"359\">\n<p>\u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u043d\u0430\u043b\u0438\u0447\u0438\u044f \u0432 \u0444\u0430\u0439\u043b\u0435 \u0442\u043e\u0433\u043e \u0441\u0430\u043c\u043e\u0433\u043e \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u0430 <code>$ANSIBLE_VAULT;1.1;AES256<\/code>;<\/p>\n<\/td>\n<td>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"70\" width=\"70\">\n<p>51-57<\/p>\n<\/td>\n<td data-colwidth=\"359\" width=\"359\">\n<p>\u0447\u0438\u0442\u0430\u0435\u043c \u0432\u0441\u0451 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u0437\u0430\u0448\u0438\u0444\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0433\u043e \u0444\u0430\u0439\u043b\u0430 \u0438 \u0437\u0430\u043a\u0440\u044b\u0432\u0430\u0435\u043c \u0435\u0433\u043e;<\/p>\n<\/td>\n<td>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"70\" width=\"70\">\n<p>58-63<\/p>\n<\/td>\n<td data-colwidth=\"359\" width=\"359\">\n<p>\u0440\u0430\u0437\u0431\u0438\u0440\u0430\u0435\u043c \u0444\u0430\u0439\u043b \u043d\u0430 \u0447\u0430\u0441\u0442\u0438: &#171;\u0441\u043e\u043b\u044c&#187;, \u0434\u0430\u0439\u0434\u0436\u0435\u0441\u0442, \u0448\u0438\u0444\u0440\u0442\u0435\u043a\u0441\u0442 &#8212; \u0432\u0441\u0451 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e; \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u0432\u0441\u0435 \u0442\u0440\u0438 \u0447\u0430\u0441\u0442\u0438 \u043d\u0443\u0436\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u0435\u0449\u0451 \u0440\u0430\u0437 \u043f\u0440\u043e\u0433\u043d\u0430\u0442\u044c \u0447\u0435\u0440\u0435\u0437 unhexlify (\u043f\u043e\u043c\u043d\u0438\u0442\u0435 \u043f\u0440\u0438\u043c\u0435\u0447\u0430\u043d\u0438\u0435 \u0432 <a href=\"#vaultencrypt\" rel=\"noopener noreferrer nofollow\">VaultAES256.encrypt<\/a>?)<\/p>\n<\/td>\n<td>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"70\" width=\"70\">\n<p>64-73<\/p>\n<\/td>\n<td data-colwidth=\"359\" width=\"359\">\n<p>\u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0435 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u043d\u043e\u0433\u043e \u043a\u043b\u044e\u0447\u0435\u0432\u043e\u0433\u043e \u043c\u0430\u0442\u0435\u0440\u0438\u0430\u043b\u0430; \u0440\u0430\u0437\u0431\u0438\u0435\u043d\u0438\u0435 \u0435\u0433\u043e \u043d\u0430 \u0447\u0430\u0441\u0442\u0438; \u0440\u0430\u0441\u0447\u0451\u0442 \u0434\u0430\u0439\u0434\u0436\u0435\u0441\u0442\u0430; \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u0437\u0430\u0448\u0438\u0444\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0433\u043e \u0444\u0430\u0439\u043b\u0430 \u043d\u0430 \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e\u0441\u0442\u044c \u0434\u0430\u0439\u0436\u0434\u0435\u0441\u0442\u0430;<\/p>\n<\/td>\n<td>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"70\" width=\"70\">\n<p>74-83<\/p>\n<\/td>\n<td data-colwidth=\"359\" width=\"359\">\n<p>\u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043a\u0430 \u0431\u0443\u0444\u0435\u0440\u0430 \u0434\u043b\u044f \u0440\u0430\u0441\u0448\u0438\u0444\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0433\u043e \u0442\u0435\u043a\u0441\u0442\u0430; \u0440\u0430\u0441\u0448\u0438\u0444\u0440\u043e\u0432\u043a\u0430; \u0437\u0430\u0442\u0438\u0440\u0430\u043d\u0438\u0435 \u043a\u043b\u044e\u0447\u0435\u0439 \u0432 \u043f\u0430\u043c\u044f\u0442\u0438 \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u044b\u043c\u0438 \u0434\u0430\u043d\u043d\u044b\u043c\u0438; \u0432\u044b\u0432\u043e\u0434 \u0440\u0430\u0441\u0448\u0438\u0444\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0433\u043e \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0433\u043e \u0432 \u043f\u043e\u0442\u043e\u043a stdout<\/p>\n<\/td>\n<td>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<details class=\"spoiler\">\n<summary>\u0418\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u0430\u044f \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u0434\u043b\u044f \u043f\u0438\u0442\u043e\u043d\u0438\u0441\u0442\u043e\u0432<\/summary>\n<div class=\"spoiler__content\">\n<p>\u041a\u0441\u0442\u0430\u0442\u0438, \u0432\u044b \u0436\u0435 \u0441\u043b\u044b\u0448\u0430\u043b\u0438, \u0447\u0442\u043e \u0432 Python 3.10 \u043d\u0430\u043a\u043e\u043d\u0435\u0446-\u0442\u043e \u0437\u0430\u0432\u0435\u0437\u043b\u0438 <a href=\"https:\/\/docs.python.org\/3.10\/whatsnew\/3.10.html#pep-634-structural-pattern-matching\" rel=\"noopener noreferrer nofollow\">\u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440 case<\/a> (PEP-634)? \u0418\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e, \u0447\u0442\u043e \u0435\u0433\u043e \u0432\u0432\u0451\u043b \u0441\u0430\u043c BDFL, \u0438 \u043f\u0440\u043e\u0438\u0437\u043e\u0448\u043b\u043e \u044d\u0442\u043e \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0447\u0435\u0440\u0435\u0437 14 \u043b\u0435\u0442 \u043f\u043e\u0441\u043b\u0435 \u0442\u043e\u0433\u043e, \u043a\u0430\u043a \u043f\u043e \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430\u043c \u043e\u043f\u0440\u043e\u0441\u0430 \u043d\u0430 PyCon 2007 \u043f\u0435\u0440\u0432\u043e\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u044b\u0439 <a href=\"https:\/\/www.python.org\/dev\/peps\/pep-3103\/\" rel=\"noopener noreferrer nofollow\">PEP-3103<\/a> \u0431\u044b\u043b \u043e\u0442\u0432\u0435\u0440\u0433\u043d\u0443\u0442.<\/p>\n<\/div>\n<\/details>\n<p>\u0421\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e, \u0442\u0435\u043f\u0435\u0440\u044c \u0432\u0441\u0451 \u043d\u0430 \u043c\u0435\u0441\u0442\u0435, \u043e\u0441\u0442\u0430\u043b\u043e\u0441\u044c \u0441\u043e\u0431\u0440\u0430\u0442\u044c: <\/p>\n<p><code>[root@ansible devault]# time fpc devault.pas -Fudcpcrypt_2.1:dcpcrypt_2.1\/Ciphers:dcpcrypt_2.1\/Hashes -MOBJFPC<\/code><\/p>\n<p>\u0417\u0434\u0435\u0441\u044c \u0438\u043c\u0435\u0439\u0442\u0435 \u0432 \u0432\u0438\u0434\u0443, \u0447\u0442\u043e \u0444\u043e\u0440\u043c\u0430\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0425\u0430\u0431\u0440\u0430 \u0438\u0433\u0440\u0430\u0435\u0442 \u0437\u043b\u0443\u044e \u0448\u0443\u0442\u043a\u0443 &#8212; \u043d\u0438\u043a\u0430\u043a\u043e\u0433\u043e \u0440\u0430\u0437\u0440\u044b\u0432\u0430 \u0441\u0442\u0440\u043e\u043a\u0438 \u043f\u043e\u0441\u043b\u0435 \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u043c\u0438\u043d\u0443\u0441\u0430 \u043d\u0435\u0442.<\/p>\n<details class=\"spoiler\">\n<summary>\u0412\u044b\u0432\u043e\u0434 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u0430<\/summary>\n<div class=\"spoiler__content\">\n<pre><code>Free Pascal Compiler version 3.0.4 [2017\/10\/02] for x86_64 Copyright (c) 1993-2017 by Florian Klaempfl and others Target OS: Linux for x86-64 Compiling devault.pas Compiling .\/dcpcrypt_2.1\/DCPcrypt2.pas Compiling .\/dcpcrypt_2.1\/DCPbase64.pas Compiling .\/dcpcrypt_2.1\/Hashes\/DCPsha256.pas Compiling .\/dcpcrypt_2.1\/DCPconst.pas Compiling .\/dcpcrypt_2.1\/Ciphers\/DCPrijndael.pas Compiling .\/dcpcrypt_2.1\/DCPblockciphers.pas Compiling kdf.pas Linking devault \/usr\/bin\/ld: warning: link.res contains output sections; did you forget -T? 3784 lines compiled, 0.5 sec  real    0m0.543s user    0m0.457s sys     0m0.084s<\/code><\/pre>\n<\/div>\n<\/details>\n<p>\u0412\u0440\u043e\u0434\u0435 \u043d\u0435\u043f\u043b\u043e\u0445\u043e: 3,8 \u0442\u044b\u0441\u044f\u0447\u0438 \u0441\u0442\u0440\u043e\u043a \u043a\u043e\u0434\u0430 \u0441\u043e\u0431\u0440\u0430\u043d\u044b \u0434\u043e \u0438\u0441\u043f\u043e\u043b\u043d\u044f\u0435\u043c\u043e\u0433\u043e \u0444\u0430\u0439\u043b\u0430 \u0437\u0430 0.6 \u0441\u0435\u043a. \u041d\u0430 \u0432\u044b\u0445\u043e\u0434\u0435 &#8212;  \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0439 \u0431\u0438\u043d\u0430\u0440\u043d\u0438\u043a, \u043a\u043e\u0442\u043e\u0440\u043e\u043c\u0443 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u043e\u0442 \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u044f\u0434\u0440\u043e. \u041d\u0443 \u0442\u043e \u0435\u0441\u0442\u044c \u0434\u043b\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u0441\u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u044d\u0442\u043e\u0442 \u0431\u0438\u043d\u0430\u0440\u043d\u0438\u043a \u0432 \u0444\u0430\u0439\u043b\u043e\u0432\u0443\u044e \u0441\u0438\u0441\u0442\u0435\u043c\u0443 &#8212; \u0438 \u0432\u0441\u0451. \u041a\u0441\u0442\u0430\u0442\u0438, \u044f \u0437\u0430\u0431\u044b\u043b \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u0435\u0433\u043e \u0440\u0430\u0437\u043c\u0435\u0440: 875\u041a. \u041d\u0438\u043a\u0430\u043a\u0438\u0445 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439, \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0439 \u043f\u043e \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043c\u0438\u043d\u0443\u0442 \u0438 \u0442.\u0434.<\/p>\n<p>\u0410\u0445 \u0434\u0430, \u0447\u0443\u0442\u044c \u043d\u0435 \u0437\u0430\u0431\u044b\u043b \u0441\u0430\u043c\u043e\u0435 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e\u0435! \u0417\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c, \u043f\u0440\u0435\u0434\u0432\u0430\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0441\u043b\u043e\u0436\u0438\u0432 \u043f\u0430\u0440\u043e\u043b\u044c \u0432 \u0444\u0430\u0439\u043b &#171;.password&#187;:<\/p>\n<pre><code class=\"bash\">[root@ansible devault]# .\/devault -w .password -f vaulted.yml --- collections: - name: community.general   scm: git   src: https:\/\/github.com\/ansible-collections\/community.general.git   version: 1.0.0<\/code><\/pre>\n<p>\u0412\u043e\u0442 \u0442\u0430\u043a\u043e\u0439 \u043d\u0435\u0445\u0438\u0442\u0440\u044b\u0439 YaML \u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b \u0432 \u0441\u0430\u043c\u043e\u043c \u043d\u0430\u0447\u0430\u043b\u0435 \u0441\u0442\u0430\u0442\u044c\u0438 \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0437\u0430\u0448\u0438\u0444\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0433\u043e \u0444\u0430\u0439\u043b\u0430.<\/p>\n<p>\u0418\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434 \u0434\u043b\u044f \u0441\u0430\u043c\u043e\u0441\u0442\u043e\u044f\u0442\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u0438\u0437\u0443\u0447\u0435\u043d\u0438\u044f \u043c\u043e\u0436\u043d\u043e <a href=\"https:\/\/github.com\/tnt4brain\/devault\" rel=\"noopener noreferrer nofollow\">\u0432\u0437\u044f\u0442\u044c \u0437\u0434\u0435\u0441\u044c<\/a>.<\/p>\n<details class=\"spoiler\">\n<summary>\u0425\u043e\u0442\u0438\u0442\u0435 \u0435\u0449\u0451 Ansible? (\u043e\u0441\u0442\u043e\u0440\u043e\u0436\u043d\u043e, \u0434\u0435\u043d\u0435\u0436\u043d\u044b\u0435 \u0432\u043e\u043f\u0440\u043e\u0441\u044b!)<\/summary>\n<div class=\"spoiler__content\">\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0443 \u0432\u0430\u0441 \u0435\u0441\u0442\u044c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c <a href=\"https:\/\/www.raiffeisen.ru\/c2c\/to\/tnt4brain\" rel=\"noopener noreferrer nofollow\">\u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043f\u043e\u0436\u0435\u0440\u0442\u0432\u043e\u0432\u0430\u043d\u0438\u0435 \u0430\u0432\u0442\u043e\u0440\u0443 \u0441\u0442\u0430\u0442\u044c\u0438 <\/a>&#8212; \u043e\u043d\u043e \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0437\u0430\u043c\u043e\u0442\u0438\u0432\u0438\u0440\u0443\u0435\u0442 \u043c\u0435\u043d\u044f \u0447\u0430\u0449\u0435 \u0432\u044b\u0431\u0438\u0440\u0430\u0442\u044c\u0441\u044f \u043d\u0430 \u043f\u0440\u043e\u0433\u0443\u043b\u043a\u0443 \u0441 \u0447\u0430\u0448\u043a\u043e\u0439 \u043a\u043e\u0444\u0435 \u0438 \u0431\u0443\u043b\u043a\u043e\u0439 \u0441 \u043a\u043e\u0440\u0438\u0446\u0435\u0439, \u0447\u0442\u043e\u0431\u044b \u043e\u0442\u0434\u043e\u0445\u043d\u0443\u0442\u044c \u043f\u0435\u0440\u0435\u0434 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u0435\u043c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u0441\u0442\u0430\u0442\u044c\u0438 \u0438 \u043e\u0431\u0434\u0443\u043c\u0430\u0442\u044c \u0435\u0451 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u043d\u0438\u0435.<\/p>\n<p>\u0415\u0441\u043b\u0438 \u0436\u0435 \u0445\u043e\u0442\u0438\u0442\u0435 \u0441\u0438\u0441\u0442\u0435\u043c\u0430\u0442\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0438 \u0443\u0433\u043b\u0443\u0431\u0438\u0442\u044c \u0441\u0432\u043e\u0438 \u0437\u043d\u0430\u043d\u0438\u044f Ansible &#8212; \u044f \u043f\u0440\u043e\u0432\u043e\u0436\u0443 \u0442\u0440\u0435\u043d\u0438\u043d\u0433\u0438 \u043f\u043e Ansible, \u043f\u0438\u0448\u0438\u0442\u0435 <a href=\"https:\/\/t.me\/tnt4brain\" rel=\"noopener noreferrer nofollow\">\u043c\u043d\u0435 \u0432 Telegram<\/a>.<\/p>\n<\/div>\n<\/details>\n<\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/post\/554148\/\"> https:\/\/habr.com\/ru\/post\/554148\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div class=\"post__text post__text_v2\" id=\"post-content-body\">\n<h2>\u0418\u0441\u0445\u043e\u0434\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435<\/h2>\n<p><strong>\u0414\u0430\u043d\u043e<\/strong>: <\/p>\n<ul>\n<li>\n<p>\u043a\u043e\u043d\u0432\u0435\u0439\u0435\u0440 CI\/CD, \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u0439, \u043a \u043f\u0440\u0438\u043c\u0435\u0440\u0443, \u0432 GitLab. \u0414\u043b\u044f \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e\u0439 \u0440\u0430\u0431\u043e\u0442\u044b \u0435\u043c\u0443 \u0442\u0440\u0435\u0431\u0443\u044e\u0442\u0441\u044f, \u043a\u0430\u043a \u044d\u0442\u043e \u043e\u0447\u0435\u043d\u044c \u0447\u0430\u0441\u0442\u043e \u0431\u044b\u0432\u0430\u0435\u0442, \u043d\u0435\u043a\u0438\u0435 \u0441\u0435\u043a\u0440\u0435\u0442\u044b &#8212; API-\u0442\u043e\u043a\u0435\u043d\u044b, \u043f\u0430\u0440\u044b \u043b\u043e\u0433\u0438\/\u043f\u0430\u0440\u043e\u043b\u044c, \u043f\u0440\u0438\u0432\u0430\u0442\u043d\u044b\u0435 SSH-\u043a\u043b\u044e\u0447\u0438 &#8212; \u0434\u0430 \u0432\u0441\u0451, \u043e \u0447\u0451\u043c \u0442\u043e\u043b\u044c\u043a\u043e \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0434\u0443\u043c\u0430\u0442\u044c;<\/p>\n<\/li>\n<li>\n<p>\u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u044d\u0442\u043e\u0442 \u0441\u0431\u043e\u0440\u043e\u0447\u043d\u044b\u0439 \u043a\u043e\u043d\u0432\u0435\u0439\u0435\u0440, \u043a\u0430\u043a \u044d\u0442\u043e \u0442\u043e\u0436\u0435 \u0447\u0430\u0441\u0442\u043e \u0431\u044b\u0432\u0430\u0435\u0442, \u043d\u0430 \u0431\u0430\u0437\u0435 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u043e\u0432. \u0421\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e, \u0447\u0435\u043c \u043c\u0435\u043d\u044c\u0448\u0435 \u043f\u043e \u0440\u0430\u0437\u043c\u0435\u0440\u0443 \u043e\u0431\u0440\u0430\u0437\u044b &#8212; \u0442\u0435\u043c \u043b\u0443\u0447\u0448\u0435, \u0447\u0435\u043c \u043c\u0435\u043d\u044c\u0448\u0435 \u0432 \u043d\u0438\u0445 \u0432\u0441\u044f\u043a\u043e\u0439 \u0432\u0441\u044f\u0447\u0438\u043d\u044b &#8212; \u0442\u0435\u043c \u043b\u0443\u0447\u0448\u0435.<\/p>\n<\/li>\n<\/ul>\n<p><strong>\u0422\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f<\/strong> \u043a\u043e\u043d\u0441\u043e\u043b\u044c\u043d\u0430\u044f \u0443\u0442\u0438\u043b\u0438\u0442\u0430, \u043a\u043e\u0442\u043e\u0440\u0430\u044f:<\/p>\n<ul>\n<li>\n<p>\u0437\u0430\u043d\u0438\u043c\u0430\u0435\u0442 \u043c\u0438\u043d\u0438\u043c\u0443\u043c \u043c\u0435\u0441\u0442\u0430;<\/p>\n<\/li>\n<li>\n<p>\u0443\u043c\u0435\u0435\u0442 \u0440\u0430\u0441\u0448\u0438\u0444\u0440\u043e\u0432\u044b\u0432\u0430\u0442\u044c \u0441\u0435\u043a\u0440\u0435\u0442\u044b, \u0437\u0430\u0448\u0438\u0444\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0435 <code>ansible-vault<\/code>;<\/p>\n<\/li>\n<li>\n<p>\u043d\u0435 \u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u043d\u0438\u043a\u0430\u043a\u0438\u0445 \u0432\u043d\u0435\u0448\u043d\u0438\u0445 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439;<\/p>\n<\/li>\n<li>\n<p>\u0443\u043c\u0435\u0435\u0442 \u0447\u0438\u0442\u0430\u0442\u044c \u043a\u043b\u044e\u0447 \u0438\u0437 \u0444\u0430\u0439\u043b\u0430.<\/p>\n<\/li>\n<\/ul>\n<p>\u042f \u0434\u0443\u043c\u0430\u044e, \u0447\u0442\u043e \u043b\u044e\u0434\u0438, \u043f\u0440\u0438\u0447\u0430\u0441\u0442\u043d\u044b\u0435 \u043a \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044e \u0441\u0431\u043e\u0440\u043e\u0447\u043d\u044b\u0445 \u043a\u043e\u043d\u0432\u0435\u0439\u0435\u0440\u043e\u0432, \u043f\u043e \u0434\u043e\u0441\u0442\u043e\u0438\u043d\u0441\u0442\u0432\u0443 \u0441\u043c\u043e\u0433\u0443\u0442 \u043e\u0446\u0435\u043d\u0438\u0442\u044c \u043a\u0430\u0436\u0434\u043e\u0435 \u0438\u0437 \u044d\u0442\u0438\u0445 \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u0439. \u041d\u0443 \u0430 \u0447\u0442\u043e \u0443 \u043c\u0435\u043d\u044f \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c \u0432 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 &#8212; \u0447\u0438\u0442\u0430\u0439\u0442\u0435 \u0434\u0430\u043b\u0435\u0435.<\/p>\n<p>\u041d\u0430 \u0432\u0441\u044f\u043a\u0438\u0439 \u0441\u043b\u0443\u0447\u0430\u0439 \u0441\u0440\u0430\u0437\u0443 \u043d\u0430\u043f\u043e\u043c\u0438\u043d\u0430\u044e, \u0447\u0442\u043e \u043f\u043e \u0434\u0435\u0439\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u043c\u0443 \u0437\u0430\u043a\u043e\u043d\u043e\u0434\u0430\u0442\u0435\u043b\u044c\u0441\u0442\u0432\u0443 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u0441\u0440\u0435\u0434\u0441\u0442\u0432 \u043a\u0440\u0438\u043f\u0442\u043e\u0433\u0440\u0430\u0444\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0437\u0430\u0449\u0438\u0442\u044b \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u0432 \u0420\u0424 &#8212; <a href=\"http:\/\/clsz.fsb.ru\/clsz\/license.htm\" rel=\"noopener noreferrer nofollow\">\u043b\u0438\u0446\u0435\u043d\u0437\u0438\u0440\u0443\u0435\u043c\u0430\u044f \u0434\u0435\u044f\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c<\/a>. \u0418\u043d\u0430\u0447\u0435 \u0433\u043e\u0432\u043e\u0440\u044f, \u0431\u0435\u0437 \u043d\u0430\u043b\u0438\u0447\u0438\u044f \u043b\u0438\u0446\u0435\u043d\u0437\u0438\u0438 \u0432\u044b \u043d\u0435 \u043c\u043e\u0436\u0435\u0442\u0435 \u043f\u0440\u043e\u0441\u0442\u043e \u0442\u0430\u043a \u0432\u0437\u044f\u0442\u044c \u0438 \u043f\u0440\u043e\u0434\u0430\u0432\u0430\u0442\u044c \u043f\u043e\u043b\u0443\u0447\u0438\u0432\u0448\u0435\u0435\u0441\u044f \u0440\u0435\u0448\u0435\u043d\u0438\u0435.<\/p>\n<p>\u041f\u043e \u043f\u043e\u0432\u043e\u0434\u0443 \u0434\u043e\u043f\u0443\u0441\u0442\u0438\u043c\u043e\u0441\u0442\u0438 \u043f\u043e\u043b\u043d\u044b\u0445 \u0442\u0435\u043a\u0441\u0442\u043e\u0432 \u0440\u0430\u0441\u0448\u0438\u0444\u0440\u043e\u0432\u0449\u0438\u043a\u043e\u0432 \u0432 \u0441\u0442\u0430\u0442\u044c\u044f\u0445 \u0432\u0440\u043e\u0434\u0435 \u044d\u0442\u043e\u0439 &#8212; \u043d\u0430\u0434\u0435\u044e\u0441\u044c, \u0447\u0442\u043e \u043a\u043e\u043c\u043f\u0435\u0442\u0435\u043d\u0442\u043d\u044b\u0435 \u0432 \u044d\u0442\u043e\u043c \u0432\u043e\u043f\u0440\u043e\u0441\u0435 \u0447\u0438\u0442\u0430\u0442\u0435\u043b\u0438 \u0441\u043c\u043e\u0433\u0443\u0442 \u0432\u043d\u0435\u0441\u0442\u0438 \u0441\u0432\u043e\u0438 \u0443\u0442\u043e\u0447\u043d\u0435\u043d\u0438\u044f \u0432 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u044f\u0445.<\/p>\n<h2>\u041d\u0430\u0447\u043d\u0451\u043c \u0441\u043d\u0430\u0447\u0430\u043b\u0430<\/h2>\n<p>\u0418\u0442\u0430\u043a, \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u043e\u0436\u0438\u043c, \u0447\u0442\u043e \u0443 \u043d\u0430\u0441 \u043d\u0430 Linux-\u0445\u043e\u0441\u0442\u0435 \u0441 CentOS 7 \u0443\u0436\u0435 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d Ansible, \u043a \u043f\u0440\u0438\u043c\u0435\u0440\u0443, \u0432\u0435\u0440\u0441\u0438\u0438 2.9 \u0434\u043b\u044f Python \u0432\u0435\u0440\u0441\u0438\u0438 3.6. \u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d, \u043a\u043e\u043d\u0435\u0447\u043d\u043e \u0436\u0435, \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <code>virtualenv<\/code> \u0432 \u043a\u0430\u0442\u0430\u043b\u043e\u0433 &#171;<code>\/opt\/ansible<\/code>&#171;. \u0414\u0430\u043b\u044c\u0448\u0435 \u0434\u043b\u044f \u0446\u0435\u043b\u0435\u0439 \u0443\u0434\u043e\u0432\u043b\u0435\u0442\u0432\u043e\u0440\u0435\u043d\u0438\u044f \u0447\u0438\u0441\u0442\u043e\u0433\u043e \u043d\u0430\u0443\u0447\u043d\u043e\u0433\u043e \u043b\u044e\u0431\u043e\u043f\u044b\u0442\u0441\u0442\u0432\u0430 \u0432\u043e\u0437\u044c\u043c\u0451\u043c \u043a\u0430\u043a\u043e\u0439-\u043d\u0438\u0431\u0443\u0434\u044c YaML-\u0444\u0430\u0439\u043b, \u0438 \u0437\u0430\u0448\u0438\u0444\u0440\u0443\u0435\u043c \u0435\u0433\u043e \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0443\u0442\u0438\u043b\u0438\u0442\u044b <code>ansible-vault<\/code>:<\/p>\n<pre><code class=\"bash\">ansible-vault encrypt vaulted.yml --vault-password-file=.password<\/code><\/pre>\n<p>\u042d\u0442\u043e\u0442 \u0432\u044b\u0437\u043e\u0432, \u043a\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u0434\u043e\u0433\u0430\u0434\u0430\u0442\u044c\u0441\u044f, \u0437\u0430\u0448\u0438\u0444\u0440\u0443\u0435\u0442 \u0444\u0430\u0439\u043b <code>vaulted.yml<\/code> \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043f\u0430\u0440\u043e\u043b\u044f, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0445\u0440\u0430\u043d\u0438\u0442\u0441\u044f \u0432 \u0444\u0430\u0439\u043b\u0435 <code>.password<\/code>.<\/p>\n<p>\u0418\u0442\u0430\u043a, \u0447\u0442\u043e \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f \u043f\u043e\u0441\u043b\u0435 \u0437\u0430\u0448\u0438\u0444\u0440\u043e\u0432\u044b\u0432\u0430\u043d\u0438\u044f \u0444\u0430\u0439\u043b\u0430 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0443\u0442\u0438\u043b\u0438\u0442\u044b <code>ansible-vault<\/code>? \u041d\u0430 \u043f\u0435\u0440\u0432\u044b\u0439 \u0432\u0437\u0433\u043b\u044f\u0434 &#8212; \u0431\u0435\u043b\u0438\u0431\u0435\u0440\u0434\u0430 \u043a\u0430\u043a\u0430\u044f-\u0442\u043e, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0441\u043f\u0440\u044f\u0447\u0443 \u0435\u0451 \u043f\u043e\u0434 \u0441\u043f\u043e\u0439\u043b\u0435\u0440:<\/p>\n<details class=\"spoiler\">\n<summary>\u0421\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u0444\u0430\u0439\u043b\u0430 vaulted.yml<\/summary>\n<div class=\"spoiler__content\">\n<pre><code>$ANSIBLE_VAULT;1.1;AES256 61373536353963313739366536643661313861663266373130373730666634343337356536333664 3365393033623439356364663537353365386464623836640a356464633264626330383232353362 63613135373638393665663962303530323061376432333931306161303966633338303565666337 6465393837636665300a633732313730626265636538363339383237306264633830653665343639 30353863633137313866393566643661323536633666343837623130363966613363373962343630 34386234633236363363326436666630643937313630346230386538613735366431363934316364 37346337323833333165386534353432386663343465333836643131643237313262386634396534 38316630356530626430316238383364376561393637363262613666373836346262666536613164 66316638343162626631623535323666643863303231396432666365626536393062386531623165 63613934323836303536613532623864303839313038336232616134626433353166383837643165 643439363835643731316238316439633039<\/code><\/pre>\n<\/div>\n<\/details>\n<p>\u041d\u0443 \u0430 \u043a\u0430\u043a \u0438\u043c\u0435\u043d\u043d\u043e \u044d\u0442\u0430 \u0431\u0435\u043b\u0438\u0431\u0435\u0440\u0434\u0430 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 &#171;\u043f\u043e\u0434 \u043a\u0430\u043f\u043e\u0442\u043e\u043c&#187; &#8212; \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u0440\u0430\u0437\u0431\u0438\u0440\u0430\u0442\u044c\u0441\u044f.<\/p>\n<p>\u041e\u0442\u043a\u0440\u044b\u0432\u0430\u0435\u043c \u0444\u0430\u0439\u043b <code>\/opt\/ansible\/lib\/python3.6\/site-packages\/ansible\/parsing\/vault\/__init__.py<\/code>, \u0438 \u0432 \u043a\u043e\u0434\u0435 \u043c\u0435\u0442\u043e\u0434\u0430 <code>encrypt<\/code> \u043a\u043b\u0430\u0441\u0441\u0430 <code>VaultLib<\/code> \u0432\u0438\u0434\u0438\u043c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u0432\u044b\u0437\u043e\u0432:<\/p>\n<details class=\"spoiler\">\n<summary>VaultLib.encrypt<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"python\"> ...  b_ciphertext = this_cipher.encrypt(b_plaintext, secret)  ...<\/code><\/pre>\n<\/div>\n<\/details>\n<p>\u0422\u043e \u0435\u0441\u0442\u044c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0438\u0440\u0443\u044e\u0449\u0435\u0435 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u043d\u0430\u0448\u0435\u0433\u043e \u0444\u0430\u0439\u043b\u0430 \u0431\u0443\u0434\u0435\u0442 \u0441\u043e\u0437\u0434\u0430\u043d\u043e \u0432 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u0432\u044b\u0437\u043e\u0432\u0430 \u043c\u0435\u0442\u043e\u0434\u0430 <code>encrypt<\/code> \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u043a\u043b\u0430\u0441\u0441\u0430. \u041a\u0430\u043a\u043e\u0433\u043e \u0438\u043c\u0435\u043d\u043d\u043e &#8212; \u0432 \u043e\u0431\u0449\u0435\u043c-\u0442\u043e, \u043d\u0435\u0432\u0435\u043b\u0438\u043a\u0430 \u0437\u0430\u0433\u0430\u0434\u043a\u0430, \u043d\u0438\u0436\u0435 \u043f\u043e \u0444\u0430\u0439\u043b\u0443 \u0435\u0441\u0442\u044c \u0432\u0441\u0435\u0433\u043e \u043e\u0434\u0438\u043d \u043a\u043b\u0430\u0441\u0441 \u0441 \u0438\u043c\u0435\u043d\u0435\u043c <code>VaultAES256<\/code>.<\/p>\n<p>\u0421\u043c\u043e\u0442\u0440\u0438\u043c \u0432 \u0435\u0433\u043e \u043c\u0435\u0442\u043e\u0434 <code>encrypt<\/code>:<\/p>\n<details class=\"spoiler\">\n<summary>VaultAES256.encrypt<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"python\">@classmethod def encrypt(cls, b_plaintext, secret):     if secret is None:         raise AnsibleVaultError('The secret passed to encrypt() was None')     b_salt = os.urandom(32)     b_password = secret.bytes     b_key1, b_key2, b_iv = cls._gen_key_initctr(b_password, b_salt)      if HAS_CRYPTOGRAPHY:         b_hmac, b_ciphertext = cls._encrypt_cryptography(b_plaintext, b_key1, b_key2, b_iv)     elif HAS_PYCRYPTO:         b_hmac, b_ciphertext = cls._encrypt_pycrypto(b_plaintext, b_key1, b_key2, b_iv)     else:         raise AnsibleError(NEED_CRYPTO_LIBRARY + '(Detected in encrypt)')      b_vaulttext = b'\\n'.join([hexlify(b_salt), b_hmac, b_ciphertext])     # Unnecessary but getting rid of it is a backwards incompatible vault     # format change     b_vaulttext = hexlify(b_vaulttext)     return b_vaulttext<\/code><\/pre>\n<p><a class=\"anchor\" name=\"vaultencrypt\" id=\"vaultencrypt\"><\/a><\/div>\n<\/details>\n<p>\u0422\u043e \u0435\u0441\u0442\u044c \u043f\u0435\u0440\u0432\u043e-\u043d\u0430\u043f\u0435\u0440\u0432\u043e \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u0442\u0441\u044f &#171;\u0441\u043e\u043b\u044c&#187; \u0434\u043b\u0438\u043d\u043e\u0439 32 \u0431\u0430\u0439\u0442\u0430. \u0417\u0430\u0442\u0435\u043c \u0438\u0437 \u043f\u043e\u0431\u0430\u0439\u0442\u043d\u043e\u0433\u043e \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043f\u0430\u0440\u043e\u043b\u044f \u0438 &#171;\u0441\u043e\u043b\u0438&#187; \u0432\u044b\u0437\u043e\u0432\u043e\u043c <code>_gen_key_initctr<\/code> \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u043f\u0430\u0440\u0430 \u043a\u043b\u044e\u0447\u0435\u0439 (<code>b_key1<\/code>, <code>b_key2<\/code>) \u0438 \u0432\u0435\u043a\u0442\u043e\u0440 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 (<code>b_iv<\/code>). <\/p>\n<h2>\u0413\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u044f \u043a\u043b\u044e\u0447\u0435\u0439<\/h2>\n<p>\u0427\u0442\u043e \u0436\u0435 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0432 <code>_gen_key_initctr<\/code>?<\/p>\n<details class=\"spoiler\">\n<summary>_gen_key_initctr:<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"python\">@classmethod def _gen_key_initctr(cls, b_password, b_salt):     # 16 for AES 128, 32 for AES256     key_length = 32      if HAS_CRYPTOGRAPHY:         # AES is a 128-bit block cipher, so IVs and counter nonces are 16 bytes         iv_length = algorithms.AES.block_size \/\/ 8          b_derivedkey = cls._create_key_cryptography(b_password, b_salt, key_length, iv_length)         b_iv = b_derivedkey[(key_length * 2):(key_length * 2) + iv_length]     elif HAS_PYCRYPTO:         # match the size used for counter.new to avoid extra work         iv_length = 16          b_derivedkey = cls._create_key_pycrypto(b_password, b_salt, key_length, iv_length)         b_iv = hexlify(b_derivedkey[(key_length * 2):(key_length * 2) + iv_length])     else:         raise AnsibleError(NEED_CRYPTO_LIBRARY + '(Detected in initctr)')      b_key1 = b_derivedkey[:key_length]     b_key2 = b_derivedkey[key_length:(key_length * 2)]      return b_key1, b_key2, b_iv<\/code><\/pre>\n<\/div>\n<\/details>\n<p>\u0415\u0441\u043b\u0438 \u043f\u043e \u0441\u0443\u0442\u0438, \u0442\u043e \u0432\u043d\u0443\u0442\u0440\u0438 \u044d\u0442\u043e\u0433\u043e \u043c\u0435\u0442\u043e\u0434\u0430 \u0432\u044b\u0437\u043e\u0432 <code>_create_key_cryptography<\/code> \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u043f\u0430\u0440\u043e\u043b\u044f, &#171;\u0441\u043e\u043b\u0438&#187;, \u0434\u043b\u0438\u043d\u044b \u043a\u043b\u044e\u0447\u0430 \u0438 \u0434\u043b\u0438\u043d\u044b \u0432\u0435\u043a\u0442\u043e\u0440\u0430 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u0442 \u043d\u0435\u043a\u0438\u0439 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u043d\u044b\u0439 \u043a\u043b\u044e\u0447 (\u0441\u0442\u0440\u043e\u043a\u0430 10 \u043f\u0440\u0438\u0432\u0435\u0434\u0451\u043d\u043d\u043e\u0433\u043e \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442\u0430). \u0414\u0430\u043b\u0435\u0435 \u044d\u0442\u043e\u0442 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u043d\u044b\u0439 \u043a\u043b\u044e\u0447 \u0440\u0430\u0437\u0431\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u043d\u0430 \u0447\u0430\u0441\u0442\u0438, \u0438 \u043f\u043e\u043b\u0443\u0447\u0430\u044e\u0442\u0441\u044f \u0442\u0435 \u0441\u0430\u043c\u044b\u0435 <code>b_key1<\/code>, <code>b_key2<\/code> \u0438 <code>b_iv<\/code>.<\/p>\n<p>\u0421\u043b\u0435\u0434\u0443\u0435\u043c \u043f\u043e \u043a\u0440\u043e\u043b\u0438\u0447\u044c\u0435\u0439 \u043d\u043e\u0440\u0435 \u0434\u0430\u043b\u044c\u0448\u0435. \u0427\u0442\u043e \u0432\u043d\u0443\u0442\u0440\u0438 <code>_create_key_cryptography<\/code><em>?<\/em><\/p>\n<details class=\"spoiler\">\n<summary>_create_key_cryptography:<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"python\">@staticmethod def _create_key_cryptography(b_password, b_salt, key_length, iv_length):     kdf = PBKDF2HMAC(         algorithm=hashes.SHA256(),         length=2 * key_length + iv_length,         salt=b_salt,         iterations=10000,         backend=CRYPTOGRAPHY_BACKEND)     b_derivedkey = kdf.derive(b_password)      return b_derivedkey<\/code><\/pre>\n<\/div>\n<\/details>\n<p>\u041d\u0438\u0447\u0435\u0433\u043e \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0433\u043e. \u0415\u0441\u043b\u0438 \u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0432 \u0441\u0442\u043e\u0440\u043e\u043d\u0435 \u0432\u0441\u044e \u043c\u0438\u0448\u0443\u0440\u0443, \u0442\u043e \u0432 \u0438\u0442\u043e\u0433\u0435 \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 OpenSSL \u043f\u043e\u0434 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435\u043c <code>PBKDF2HMAC<\/code> \u0441 \u043d\u0443\u0436\u043d\u044b\u043c\u0438 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u043c\u0438. \u041c\u043e\u0436\u0435\u0442\u0435, \u043a\u0441\u0442\u0430\u0442\u0438, \u0441\u0430\u043c\u043e\u043b\u0438\u0447\u043d\u043e \u0432 \u044d\u0442\u043e\u043c \u0443\u0431\u0435\u0434\u0438\u0442\u044c\u0441\u044f, \u043e\u0442\u043a\u0440\u044b\u0432 \u0444\u0430\u0439\u043b <code>\/opt\/ansible\/lib\/python3.6\/site-packages\/cryptography\/hazmat\/backends\/openssl\/backend.py.<\/code><\/p>\n<p>\u041a\u0441\u0442\u0430\u0442\u0438, \u0434\u043b\u0438\u043d\u0430 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u043d\u043e\u0433\u043e \u043a\u043b\u044e\u0447\u0430, \u043a\u0430\u043a \u0432\u0438\u0434\u0438\u0442\u0435, \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u043e \u0432\u044b\u0431\u0438\u0440\u0430\u0435\u0442\u0441\u044f \u0442\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u0447\u0442\u043e\u0431\u044b \u0445\u0432\u0430\u0442\u0438\u043b\u043e \u0438 \u043d\u0430 <code>b_key1<\/code>, \u0438 \u043d\u0430 <code>b_key2<\/code>, \u0438 \u043d\u0430 <code>b_iv<\/code>.<\/p>\n<h2>\u0421\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0448\u0438\u0444\u0440\u043e\u0432\u0430\u043d\u0438\u0435<\/h2>\n<p>\u0414\u0432\u0438\u0436\u0435\u043c\u0441\u044f \u0434\u0430\u043b\u044c\u0448\u0435. \u0417\u0434\u0435\u0441\u044c \u043d\u0430\u0441 \u0432\u0441\u0442\u0440\u0435\u0447\u0430\u0435\u0442 \u0432\u044b\u0437\u043e\u0432 <code>_encrypt_cryptography<\/code> \u0441 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u043c\u0438 \u0432 \u0432\u0438\u0434\u0435 \u043e\u0442\u043a\u0440\u044b\u0442\u043e\u0433\u043e \u0442\u0435\u043a\u0441\u0442\u0430, \u043e\u0431\u043e\u0438\u0445 \u043a\u043b\u044e\u0447\u0435\u0439 \u0438 \u0432\u0435\u043a\u0442\u043e\u0440\u0430 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438:<\/p>\n<details class=\"spoiler\">\n<summary>_encrypt_cryptography<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"python\">@staticmethod def _encrypt_cryptography(b_plaintext, b_key1, b_key2, b_iv):     cipher = C_Cipher(algorithms.AES(b_key1), modes.CTR(b_iv), CRYPTOGRAPHY_BACKEND)     encryptor = cipher.encryptor()     padder = padding.PKCS7(algorithms.AES.block_size).padder()     b_ciphertext = encryptor.update(padder.update(b_plaintext) + padder.finalize())     b_ciphertext += encryptor.finalize()      # COMBINE SALT, DIGEST AND DATA     hmac = HMAC(b_key2, hashes.SHA256(), CRYPTOGRAPHY_BACKEND)     hmac.update(b_ciphertext)     b_hmac = hmac.finalize()      return to_bytes(hexlify(b_hmac), errors='surrogate_or_strict'), hexlify(b_ciphertext)<\/code><\/pre>\n<\/div>\n<\/details>\n<p>\u0412 \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u0435, \u0442\u0443\u0442 \u043d\u0435\u0442 \u043d\u0438\u0447\u0435\u0433\u043e \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0433\u043e: \u0448\u0438\u0444\u0440 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0438\u0437 \u0432\u0435\u043a\u0442\u043e\u0440\u0430 <code>b_iv<\/code>, \u0437\u0430\u0442\u0435\u043c \u043f\u0435\u0440\u0432\u044b\u043c \u043a\u043b\u044e\u0447\u043e\u043c <code>b_key1<\/code> \u0448\u0438\u0444\u0440\u0443\u0435\u0442\u0441\u044f \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u0442\u0435\u043a\u0441\u0442, \u0430 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u044d\u0442\u043e\u0433\u043e \u0448\u0438\u0444\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0445\u044d\u0448\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0432\u0442\u043e\u0440\u043e\u0433\u043e \u043a\u043b\u044e\u0447\u0430 <code>b_key2<\/code>.<\/p>\n<p>\u041f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u0435 \u0432 \u0438\u0442\u043e\u0433\u0435 \u0431\u0430\u0439\u0442\u044b \u043f\u043e\u0434\u043f\u0438\u0441\u0438 \u0438 \u0448\u0438\u0444\u0440\u0442\u0435\u043a\u0441\u0442\u0430 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u0443\u044e\u0442\u0441\u044f \u0432 \u0441\u0442\u0440\u043e\u043a\u0438 \u0441\u0432\u043e\u0438\u0445 \u0448\u0435\u0441\u0442\u043d\u0430\u0434\u0446\u0430\u0442\u0435\u0440\u0438\u0447\u043d\u044b\u0445 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0439 \u0447\u0435\u0440\u0435\u0437 <code>hexlify<\/code>. (\u0441\u043c. \u0441\u0442\u0440\u043e\u043a\u0430 14 \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442\u0430 \u0432\u044b\u0448\u0435)<\/p>\n<h2>\u041e\u043a\u043e\u043d\u0447\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0435 \u043e\u0444\u043e\u0440\u043c\u043b\u0435\u043d\u0438\u0435 \u0444\u0430\u0439\u043b\u0430<\/h2>\n<p>\u0412\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c\u0441\u044f \u043a \u0441\u0442\u0440\u043e\u043a\u0430\u043c 16-20 \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442\u0430 <a href=\"http:\/\/vaultencrypt\" rel=\"noopener noreferrer nofollow\">VaultAES256.encrypt:<\/a> \u0442\u0440\u0438 \u0441\u0442\u0440\u043e\u043a\u0438, \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0449\u0438\u0435 &#171;\u0441\u043e\u043b\u044c&#187;, \u043f\u043e\u0434\u043f\u0438\u0441\u044c \u0438 \u0448\u0438\u0444\u0440\u0442\u0435\u043a\u0441\u0442, \u0441\u043a\u043b\u0435\u0438\u0432\u0430\u044e\u0442\u0441\u044f \u0432\u043c\u0435\u0441\u0442\u0435, \u043f\u043e\u0441\u043b\u0435 \u0447\u0435\u0433\u043e \u0441\u043d\u043e\u0432\u0430 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u0443\u044e\u0442\u0441\u044f \u0432 \u0448\u0435\u0441\u0442\u043d\u0430\u0434\u0446\u0430\u0442\u0435\u0440\u0438\u0447\u043d\u043e\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435 (\u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0439 \u043f\u0440\u044f\u043c\u043e \u043f\u043e\u0434\u0441\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442, \u0447\u0442\u043e \u044d\u0442\u043e &#8212; \u0434\u043b\u044f \u043e\u0431\u0440\u0430\u0442\u043d\u043e\u0439 \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c\u043e\u0441\u0442\u0438).<\/p>\n<p>\u0414\u0430\u043b\u044c\u0448\u0435 \u0434\u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a (\u043f\u043e\u043c\u043d\u0438\u0442\u0435, \u0442\u043e\u0442 \u0441\u0430\u043c\u044b\u0439 &#8212; <code>$ANSIBLE_VAULT;1.1;AES256)<\/code>, \u043d\u0443 \u0438, \u0432 \u043e\u0431\u0449\u0435\u043c-\u0442\u043e, \u0432\u0441\u0451.<\/p>\n<h2>\u041e\u0431\u0440\u0430\u0442\u043d\u044b\u0439 \u043f\u0440\u043e\u0446\u0435\u0441\u0441<\/h2>\n<p>\u041f\u043e\u0441\u043b\u0435 \u0442\u043e\u0433\u043e, \u043a\u0430\u043a \u043c\u044b \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u043b\u0438\u0441\u044c \u0432 \u043f\u0440\u044f\u043c\u043e\u043c \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0435, \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u043e\u0431\u0440\u0430\u0442\u043d\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u043d\u0435 \u0441\u043b\u0438\u0448\u043a\u043e\u043c \u0441\u043b\u043e\u0436\u043d\u043e &#8212; \u043f\u043e \u043a\u0440\u0430\u0439\u043d\u0435\u0439 \u043c\u0435\u0440\u0435, \u0435\u0441\u043b\u0438 \u0432\u044b\u0431\u0440\u0430\u0442\u044c \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u044b\u0439 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442.<\/p>\n<p>\u041f\u043e\u043d\u044f\u0442\u043d\u043e, \u0447\u0442\u043e Python \u043d\u0430\u043c \u043d\u0435 \u043f\u043e\u0434\u0445\u043e\u0434\u0438\u0442, \u0438\u043d\u0430\u0447\u0435 \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0438 \u043e\u0433\u043e\u0440\u043e\u0434 \u043d\u0435 \u0433\u043e\u0440\u043e\u0434\u0438\u0442\u044c: ansible-vault \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u043e \u0445\u043e\u0440\u043e\u0448\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0432 \u043e\u0431\u0435 \u0441\u0442\u043e\u0440\u043e\u043d\u044b. \u0421 \u0434\u0440\u0443\u0433\u043e\u0439 \u0441\u0442\u043e\u0440\u043e\u043d\u044b, \u043d\u0438\u043a\u0442\u043e \u043d\u0435 \u043c\u0435\u0448\u0430\u0435\u0442 \u043d\u0430 \u0431\u0430\u0437\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a Ansible \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0447\u0442\u043e-\u043b\u0438\u0431\u043e \u0441\u0432\u043e\u0451 &#8212; \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0440\u0430\u0437\u043c\u0438\u043d\u043a\u0438 \u043f\u0435\u0440\u0435\u0434 &#171;\u043f\u043e\u0434\u0445\u043e\u0434\u043e\u043c \u043a \u0441\u043d\u0430\u0440\u044f\u0434\u0443&#187; \u044f \u0442\u0430\u043a \u0438 \u0441\u0434\u0435\u043b\u0430\u043b, \u0438 \u043e \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u043d\u0430\u043f\u0438\u0448\u0443 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u0443\u044e \u0441\u0442\u0430\u0442\u044c\u044e.<\/p>\n<p>\u0422\u0435\u043c \u043d\u0435 \u043c\u0435\u043d\u0435\u0435, \u0434\u043b\u044f \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u043f\u0440\u0435\u0434\u043c\u0435\u0442\u0430 \u0441\u0442\u0430\u0442\u044c\u0438 \u044f \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0441\u044f FreePascal. \u0412\u0432\u0438\u0434\u0443 \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u044f\u0437\u044b\u043a\u043e\u0432\u043e\u0439 \u0445\u043e\u043b\u0438\u0432\u0430\u0440 \u0442\u0435\u043c\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0438 \u043d\u0435 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f, \u0431\u0443\u0434\u0443 \u043a\u0440\u0430\u0442\u043e\u043a: \u0432\u044b\u0431\u0440\u0430\u043b \u044d\u0442\u043e\u0442 \u044f\u0437\u044b\u043a, \u0432\u043e-\u043f\u0435\u0440\u0432\u044b\u0445, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u043c\u043e\u0433\u0443, \u0430 \u0432\u043e-\u0432\u0442\u043e\u0440\u044b\u0445 &#8212; \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c\u044b\u0439 \u0431\u0438\u043d\u0430\u0440\u043d\u0438\u043a \u0443\u0434\u043e\u0432\u043b\u0435\u0442\u0432\u043e\u0440\u044f\u0435\u0442 \u0437\u0430\u0434\u0430\u043d\u043d\u044b\u043c \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u044f\u043c.<\/p>\n<p>\u0418\u0442\u0430\u043a, \u043d\u0430\u043c \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u044f\u0442\u0441\u044f: FreePascal \u0432\u0435\u0440\u0441\u0438\u0438 3.0.4 (\u044d\u0442\u0430 \u0432\u0435\u0440\u0441\u0438\u044f \u0432 \u0432\u0438\u0434\u0435 \u0433\u043e\u0442\u043e\u0432\u044b\u0445 \u043f\u0430\u043a\u0435\u0442\u043e\u0432 &#8212; \u0441\u0430\u043c\u0430\u044f \u0441\u0432\u0435\u0436\u0430\u044f, \u043d\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u043e \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u044e\u0449\u0430\u044f\u0441\u044f \u0432 CentOS 7), \u0438 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 DCPCrypt \u0432\u0435\u0440\u0441\u0438\u0438 2.1 (<a href=\"https:\/\/github.com\/StephenGenusa\/DCPCrypt\" rel=\"noopener noreferrer nofollow\">\u043d\u0430 GitHub<\/a>). \u0418\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e, \u0447\u0442\u043e \u043f\u0440\u044f\u043c\u043e \u0432\u043c\u0435\u0441\u0442\u0435 \u0441 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u043e\u043c (<code>fpc<\/code>) \u0438 \u043e\u0431\u0448\u0438\u0440\u043d\u044b\u043c \u043d\u0430\u0431\u043e\u0440\u043e\u043c \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a \u0432 rpm-\u043f\u0430\u043a\u0435\u0442\u0435 \u043f\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043a\u043e\u043d\u0441\u043e\u043b\u044c\u043d\u0430\u044f \u0441\u0440\u0435\u0434\u0430 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 <code>fp<\/code>.<\/p>\n<p>\u041a \u0441\u043e\u0436\u0430\u043b\u0435\u043d\u0438\u044e, &#171;\u0438\u0441\u043a\u0430\u0440\u043e\u043f\u043a\u0438&#187; \u043c\u043e\u0434\u0443\u043b\u0438 \u044d\u0442\u043e\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u043d\u0435 \u0441\u043e\u0431\u0438\u0440\u0430\u044e\u0442\u0441\u044f \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u043e\u043c <code>fpc<\/code> &#8212; \u0432 \u043d\u0438\u0445 \u043d\u0443\u0436\u043d\u044b \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u0435 \u043f\u0440\u0430\u0432\u043a\u0438. \u0421 \u0434\u0440\u0443\u0433\u043e\u0439 \u0441\u0442\u043e\u0440\u043e\u043d\u044b, \u044f \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u0430\u0433\u0430\u044e, \u0447\u0442\u043e \u0431\u0435\u0437 \u044d\u0442\u0438\u0445 \u043f\u0440\u0430\u0432\u043e\u043a \u043f\u0440\u0435\u0434\u043c\u0435\u0442 \u0441\u0442\u0430\u0442\u044c\u0438 \u043f\u0435\u0440\u0435\u0441\u0442\u0430\u0451\u0442 \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u044c\u0441\u044f \u043a \u043b\u0438\u0446\u0435\u043d\u0437\u0438\u0440\u0443\u0435\u043c\u044b\u043c \u0432\u0438\u0434\u0430\u043c \u0434\u0435\u044f\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u0438 \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0442\u044c \u0447\u0438\u0441\u0442\u043e \u0430\u043a\u0430\u0434\u0435\u043c\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0438\u043d\u0442\u0435\u0440\u0435\u0441 &#8212; \u0438\u043c\u0435\u043d\u043d\u043e \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0432\u044b\u043a\u043b\u0430\u0434\u044b\u0432\u0430\u044e \u0441\u0442\u0430\u0442\u044c\u044e \u0431\u0435\u0437 \u043d\u0438\u0445.<\/p>\n<p>\u0427\u0430\u0441\u0442\u044c \u043a\u043e\u0434\u0430, \u043e\u0442\u043d\u043e\u0441\u044f\u0449\u0443\u044e\u0441\u044f \u043a \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044e \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u043d\u043e\u0433\u043e \u043a\u043b\u044e\u0447\u0430 (\u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e \u0442\u043e\u0439 \u0441\u0430\u043c\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 PBKDF2), \u044f \u043d\u0430\u0448\u0451\u043b <a href=\"https:\/\/keit.co\/p\/dcpcrypt-hmac-rfc2104\/\" rel=\"noopener noreferrer nofollow\">\u0432<\/a><a href=\"http:\/\/keit.co\/p\/dcpcrypt-hmac-rfc2104\/\" rel=\"noopener noreferrer nofollow\"> \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442\u0435<\/a>, \u0438 \u043f\u043e\u043c\u0435\u0441\u0442\u0438\u043b \u0432 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 \u043c\u043e\u0434\u0443\u043b\u044c \u043f\u043e\u0434 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435\u043c &#171;kdf&#187;.<\/p>\n<p>\u0412\u043e\u0442 \u044d\u0442\u043e\u0442 \u043c\u043e\u0434\u0443\u043b\u044c \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0439 \u043f\u0435\u0440\u0441\u043e\u043d\u043e\u0439:<\/p>\n<details class=\"spoiler\">\n<summary>kdf.pas<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"delphi\">{$MODE OBJFPC}  \/\/ ALL CREDITS FOR THIS CODE TO https:\/\/keit.co\/p\/dcpcrypt-hmac-rfc2104\/  unit kdf;  interface uses dcpcrypt2,math; function PBKDF2(pass, salt: ansistring; count, kLen: Integer; hash: TDCP_hashclass): ansistring;<\/code><\/pre>\n<\/div>\n<\/details>\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-322031","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/322031","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=322031"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/322031\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=322031"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=322031"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=322031"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}