{"id":285764,"date":"2017-05-01T16:25:57","date_gmt":"2017-05-01T12:25:57","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=285764"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=285764","title":{"rendered":"\u0428\u0438\u0444\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0432 EXT4. How It Works?"},"content":{"rendered":"<p><img decoding=\"async\" src=\"https:\/\/upload.wikimedia.org\/wikipedia\/commons\/f\/f0\/Tux_ecb.jpg\" alt=\"image\" align=\"left\"\/> \u041f\u0430\u0440\u0430\u043d\u043e\u0439\u044f \u043d\u0435 \u043b\u0435\u0447\u0438\u0442\u0441\u044f! \u041d\u043e \u0438 \u043d\u0435 \u043f\u0440\u0435\u0441\u043b\u0435\u0434\u0443\u0435\u0442\u0441\u044f \u043f\u043e \u0437\u0430\u043a\u043e\u043d\u0443. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0432 Linux Kernel 4.1 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0430 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0430 \u0448\u0438\u0444\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0444\u0430\u0439\u043b\u043e\u0432\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b ext4 \u043d\u0430 \u0443\u0440\u043e\u0432\u043d\u0435 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0445 \u0444\u0430\u0439\u043b\u043e\u0432 \u0438 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0439. \u0417\u0430\u0448\u0438\u0444\u0440\u043e\u0432\u0430\u0442\u044c \u043c\u043e\u0436\u043d\u043e \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u0443\u0441\u0442\u0443\u044e \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044e. \u0412\u0441\u0435 \u0444\u0430\u0439\u043b\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0431\u0443\u0434\u0443\u0442 \u0441\u043e\u0437\u0434\u0430\u043d\u044b \u0432 \u0442\u0430\u043a\u043e\u0439 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438, \u0442\u0430\u043a\u0436\u0435 \u0431\u0443\u0434\u0443\u0442 \u0437\u0430\u0448\u0438\u0444\u0440\u043e\u0432\u0430\u043d\u044b. \u0428\u0438\u0444\u0440\u0443\u044e\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u0438\u043c\u0435\u043d\u0430 \u0444\u0430\u0439\u043b\u043e\u0432 \u0438 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435, \u043c\u0435\u0442\u0430\u0434\u0430\u043d\u043d\u044b\u0435 \u043d\u0435 \u0448\u0438\u0444\u0440\u0443\u044e\u0442\u0441\u044f, inline data (\u043a\u043e\u0433\u0434\u0430 \u0434\u0430\u043d\u043d\u044b\u0435 \u0444\u0430\u0439\u043b\u0430, \u043d\u0435 \u043f\u0440\u0435\u0432\u044b\u0448\u0430\u044e\u0449\u0438\u0435 \u043f\u043e \u0440\u0430\u0437\u043c\u0435\u0440\u0443 60 \u0431\u0430\u0439\u0442, \u0445\u0440\u0430\u043d\u044f\u0442\u0441\u044f \u0432 \u0430\u0439\u043d\u043e\u0434\u0435) \u0432 \u0444\u0430\u0439\u043b\u0430\u0445 \u043d\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442\u0441\u044f. \u041f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u0440\u0430\u0441\u0448\u0438\u0444\u0440\u043e\u0432\u043a\u0430 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0433\u043e \u0444\u0430\u0439\u043b\u0430 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u043d\u0435\u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0432 \u043f\u0430\u043c\u044f\u0442\u0438, \u0448\u0438\u0444\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u043e \u0442\u043e\u043b\u044c\u043a\u043e \u0432 \u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435, \u043a\u043e\u0433\u0434\u0430 \u0440\u0430\u0437\u043c\u0435\u0440 \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0430 \u0441\u043e\u0432\u043f\u0430\u0434\u0430\u0435\u0442 \u0441 PAGE_SIZE, \u0442.\u0435. \u0440\u0430\u0432\u0435\u043d 4\u041a.<br \/>  <a name=\"habracut\"><\/a>  <\/p>\n<h3>1. \u041a\u0430\u043a \u044d\u0442\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442<\/h3>\n<p>  \u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043e\u0441\u0432\u043e\u0438\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u043b\u0435\u0437\u043d\u044b\u0445 \u043a\u043e\u043c\u0430\u043d\u0434<\/p>\n<p>  <b>\u0424\u043e\u0440\u043c\u0430\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0442\u043e\u043c\u0430 \u0441 \u043e\u043f\u0446\u0438\u0435\u0439 \u0448\u0438\u0444\u0440\u043e\u0432\u0430\u043d\u0438\u044f<\/b><\/p>\n<pre><code># mkfs.ext4 -O encrypt \/dev\/xxx<\/code><\/pre>\n<p>  <b>\u0412\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u043e\u043f\u0446\u0438\u0438 \u0448\u0438\u0444\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043d\u0430 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0439 \u0442\u043e\u043c<\/b><\/p>\n<pre><code># tune2fs -O encrypt \/dev\/xxx<\/code><\/pre>\n<p>  <b>\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043a\u043b\u044e\u0447\u0430 \u0448\u0438\u0444\u0440\u043e\u0432\u0430\u043d\u0438\u044f<\/b><\/p>\n<pre><code># mount \/dev\/xxx \/mnt\/xxx $ e4crypt add_key Enter passphrase (echo disabled):  Added key with descriptor [8e679e4449bb9235]<\/code><\/pre>\n<p>  \u041f\u0440\u0438 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0438 \u043a\u043b\u044e\u0447\u0430 \u0442\u043e\u043c \u0441 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u043e\u0439 \u0448\u0438\u0444\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0442\u044c \u043f\u0440\u0438\u043c\u043e\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d, \u0438\u043d\u0430\u0447\u0435 e4crypt \u0432\u044b\u0434\u0430\u0441\u0442 \u043e\u0448\u0438\u0431\u043a\u0443 \u201cNo salt values available\u201d. \u0415\u0441\u043b\u0438 \u043f\u0440\u0438\u043c\u043e\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043e \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0442\u043e\u043c\u043e\u0432 \u0441 \u043e\u043f\u0446\u0438\u0435\u0439 encrypt, \u0442\u043e \u0431\u0443\u0434\u0443\u0442 \u0441\u043e\u0437\u0434\u0430\u043d\u044b \u043a\u043b\u044e\u0447\u0438 \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e. \u0423\u0442\u0438\u043b\u0438\u0442\u0430 e4crypt \u0432\u0445\u043e\u0434\u0438\u0442 \u0432 \u0441\u043e\u0441\u0442\u0430\u0432 e2fsprogs.<\/p>\n<p>  \u041a\u043b\u044e\u0447\u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u0432 Linux Kernel Keyring [1].<\/p>\n<p>  <b>\u0427\u0442\u0435\u043d\u0438\u0435 \u0441\u043f\u0438\u0441\u043a\u0430 \u043a\u043b\u044e\u0447\u0435\u0439<\/b><\/p>\n<pre><code>$ keyctl show Session Keyring  771961813 --alswrv   1000 65534  keyring: _uid_ses.1000  771026675 --alswrv   1000 65534   \\_ keyring: _uid.1000  803843970 --alsw-v   1000  1000   \\_ logon: ext4:8e679e4449bb9235<\/code><\/pre>\n<p>  \u041a\u043b\u044e\u0447\u0438, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0435 \u0434\u043b\u044f \u0448\u0438\u0444\u0440\u043e\u0432\u0430\u043d\u0438\u044f, \u0438\u043c\u0435\u044e\u0442 \u0442\u0438\u043f \u201clogon\u201d. \u0421\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 (payload) \u043a\u043b\u044e\u0447\u0435\u0439 \u0442\u0430\u043a\u043e\u0433\u043e \u0442\u0438\u043f\u0430 \u043d\u0435\u0434\u043e\u0441\u0442\u0443\u043f\u043d\u043e \u0438\u0437 \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u0430 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u2014 keyctl \u043a\u043e\u043c\u0430\u043d\u0434\u044b read, pipe, print \u0432\u0435\u0440\u043d\u0443\u0442 \u043e\u0448\u0438\u0431\u043a\u0443. \u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u0443 \u043a\u043b\u044e\u0447\u0430 \u043f\u0440\u0435\u0444\u0438\u043a\u0441 \u201cext4\u201d, \u043d\u043e \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0438 \u201cfscrypt\u201d. \u0415\u0441\u043b\u0438 keyctl \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u0432 \u0441\u0438\u0441\u0442\u0435\u043c\u0435, \u0442\u043e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u043f\u0430\u043a\u0435\u0442 keyutils.<\/p>\n<p>  <b>\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0437\u0430\u0448\u0438\u0444\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0439 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438<\/b><\/p>\n<pre><code>$ mkdir \/mnt\/xxx\/encrypted_folder $ e4crypt set_policy 8e679e4449bb9235 \/mnt\/xxx\/encrypted_folder\/ Key with descriptor [8e679e4449bb9235] applied to \/mnt\/xxx\/encrypted_folder\/.<\/code><\/pre>\n<p>  \u0417\u0434\u0435\u0441\u044c \u0432 \u043a\u043e\u043c\u0430\u043d\u0434\u0443 set_policy \u043f\u0435\u0440\u0435\u0434\u0430\u0435\u0442\u0441\u044f \u0434\u0435\u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0440 \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u043e\u0433\u043e \u043a\u043b\u044e\u0447\u0430 \u0431\u0435\u0437 \u0443\u043a\u0430\u0437\u0430\u043d\u0438\u044f \u043f\u0440\u0435\u0444\u0438\u043a\u0441\u0430 (ext4) \u0438 \u0442\u0438\u043f\u0430 (logon). \u041e\u0434\u043d\u0438\u043c \u0438 \u0442\u0435\u043c \u0436\u0435 \u043a\u043b\u044e\u0447\u043e\u043c \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u0448\u0438\u0444\u0440\u043e\u0432\u0430\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0439. \u0414\u043b\u044f \u0448\u0438\u0444\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0440\u0430\u0437\u043d\u044b\u0445 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0439 \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0440\u0430\u0437\u043d\u044b\u0435 \u043a\u043b\u044e\u0447\u0438. \u0427\u0442\u043e\u0431\u044b \u0443\u0437\u043d\u0430\u0442\u044c, \u043a\u0430\u043a\u0438\u043c \u043a\u043b\u044e\u0447\u043e\u043c \u0437\u0430\u0448\u0438\u0444\u0440\u043e\u0432\u0430\u043d\u0430 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044f, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u043a\u043e\u043c\u0430\u043d\u0434\u0443:<\/p>\n<pre><code>$ e4crypt get_policy \/mnt\/xxx\/encrypted_folder\/ \/mnt\/xxx\/encrypted_folder\/: 8e679e4449bb9235<\/code><\/pre>\n<p>  \u0423\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u0434\u0440\u0443\u0433\u0443\u044e \u043f\u043e\u043b\u0438\u0442\u0438\u043a\u0443 \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u0438 \u043d\u0430 \u0437\u0430\u0448\u0438\u0444\u0440\u043e\u0432\u0430\u043d\u043d\u0443\u044e \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044e \u043d\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0441\u044f:<\/p>\n<pre><code>$ e4crypt add_key Enter passphrase (echo disabled):  Added key with descriptor [9dafe822ae6e7994] $ e4crypt set_policy 9dafe822ae6e7994 \/mnt\/xxx\/encrypted_folder\/ Error [Invalid argument] setting policy. The key descriptor [9dafe822ae6e7994] may not match the existing encryption context for directory [\/mnt\/xxx\/encrypted_folder\/].<\/code><\/pre>\n<p>  \u0417\u0430\u0442\u043e \u0442\u0430\u043a\u0443\u044e \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044e \u043c\u043e\u0436\u043d\u043e \u0431\u0435\u0441\u043f\u0440\u0435\u043f\u044f\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0443\u0434\u0430\u043b\u0438\u0442\u044c:<\/p>\n<pre><code>$ rm -rf \/mnt\/xxx\/encrypted_folder\/ $ ll \/mnt\/xxx total 24 drwxr-xr-x 3 user user  4096 Apr 21 15:14 .\/ drwxr-xr-x 4 root root  4096 Mar 29 15:30 ..\/ drwx------ 2 root root 16384 Apr 17 12:41 lost+found\/ $<\/code><\/pre>\n<p>  <b>\u0428\u0438\u0444\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0444\u0430\u0439\u043b\u0430<\/b><\/p>\n<pre><code>$ echo &quot;My secret file content&quot; &gt; \/mnt\/xxx\/encrypted_folder\/my_secrets.txt $ cat \/mnt\/xxx\/encrypted_folder\/my_secrets.txt  My secret file content $ ll \/mnt\/xxx\/encrypted_folder\/ total 12 drwxr-xr-x 2 user user 4096 Apr 20 14:25 .\/ drwxr-xr-x 5 user user 4096 Apr 20 14:15 ..\/ -rw-r--r-- 1 user user   23 Apr 20 14:26 my_secrets.txt<\/code><\/pre>\n<p>  \u0418\u043c\u0435\u043d\u0430 \u0444\u0430\u0439\u043b\u043e\u0432 \u0432 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438 \u0438 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u0444\u0430\u0439\u043b\u0430 \u0431\u0443\u0434\u0443\u0442 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b, \u043f\u043e\u043a\u0430 \u0432 \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0435 \u043a\u043b\u044e\u0447\u0435\u0439 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u043a\u043b\u044e\u0447, \u043a\u043e\u0442\u043e\u0440\u044b\u043c \u0431\u044b\u043b\u0430 \u0437\u0430\u0448\u0438\u0444\u0440\u043e\u0432\u0430\u043d\u0430 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044f. \u041f\u043e\u0441\u043b\u0435 \u0430\u043d\u043d\u0443\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043a\u043b\u044e\u0447\u0430 \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438 \u0431\u0443\u0434\u0435\u0442 \u0441\u0438\u043b\u044c\u043d\u043e \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d:<\/p>\n<pre><code>$ keyctl revoke 803843970 $ keyctl show Session Keyring  771961813 --alswrv   1000 65534  keyring: _uid_ses.1000  771026675 --alswrv   1000 65534   \\_ keyring: _uid.1000 803843970: key inaccessible (Key has been revoked)<\/code><\/pre>\n<p>  \u041a\u043b\u044e\u0447 \u0430\u043d\u043d\u0443\u043b\u0438\u0440\u043e\u0432\u0430\u043d, \u0447\u0438\u0442\u0430\u0435\u043c \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438:<\/p>\n<pre><code>$ ll \/mnt\/xxx\/encrypted_folder\/ total 12 drwxr-xr-x 2 user user 4096 Apr 20 14:25 .\/ drwxr-xr-x 5 user user 4096 Apr 20 14:15 ..\/ -rw-r--r-- 1 user user   23 Apr 20 14:26 BhqTNRNHDBwpa9S1qCaXwC<\/code><\/pre>\n<p>  \u0418\u043c\u044f \u0444\u0430\u0439\u043b\u0430 \u0443\u0436\u0435 \u0430\u0431\u044b\u0440\u0432\u0430\u043b\u0433. \u041d\u043e \u0432\u0441\u0451-\u0442\u0430\u043a\u0438 \u043f\u043e\u043f\u0440\u043e\u0431\u0443\u0435\u043c \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u0442\u044c \u0444\u0430\u0439\u043b:<\/p>\n<pre><code>$ cat \/mnt\/xxx\/encrypted_folder\/BhqTNRNHDBwpa9S1qCaXwC  cat: \/mnt\/xxx\/encrypted_folder\/BhqTNRNHDBwpa9S1qCaXwC: Required key not available<\/code><\/pre>\n<p>  <b>NOTE:<\/b> \u0432 Ubuntu 17.04 (kernel 4.10.0-19) \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044f \u043e\u0441\u0442\u0430\u0435\u0442\u0441\u044f \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u043e\u0439 \u043f\u043e\u0441\u043b\u0435 \u0443\u0434\u0430\u043b\u0435\u043d\u0438\u044f \u043a\u043b\u044e\u0447\u0430 \u0434\u043e \u043f\u0435\u0440\u0435\u043c\u043e\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f. <\/p>\n<pre><code>$ keyctl show Session Keyring  771961813 --alswrv   1000 65534  keyring: _uid_ses.1000  771026675 --alswrv   1000 65534   \\_ keyring: _uid.1000 $ e4crypt get_policy \/mnt\/xxx\/encrypted_folder\/ \/mnt\/xxx\/encrypted_folder\/: 8e679e4449bb9235<\/code><\/pre>\n<p>  \u0414\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044f \u0437\u0430\u0448\u0438\u0444\u0440\u043e\u0432\u0430\u043d\u0430 \u043a\u043b\u044e\u0447\u043e\u043c \u0441 \u0434\u0435\u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0440\u043e\u043c \u201c8e679e4449bb9235\u201d. \u041a\u043b\u044e\u0447 \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u0432 \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0435. \u041d\u0435\u0441\u043c\u043e\u0442\u0440\u044f \u043d\u0430 \u044d\u0442\u043e, \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044f \u0438 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u0444\u0430\u0439\u043b\u0430 \u0432 \u0441\u0432\u043e\u0431\u043e\u0434\u043d\u043e\u043c \u0434\u043e\u0441\u0442\u0443\u043f\u0435.<\/p>\n<pre><code>$ ll \/mnt\/xxx\/encrypted_folder\/ total 12 drwxr-xr-x 2 user user 4096 Apr 20 14:25 .\/ drwxr-xr-x 5 user user 4096 Apr 20 14:15 ..\/ -rw-r--r-- 1 user user   23 Apr 20 14:26 my_secrets.txt $ cat \/mnt\/xxx\/encrypted_folder\/my_secrets.txt  My secret file content<\/code><\/pre>\n<p>  \u041f\u0435\u0440\u0435\u043c\u043e\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435:<\/p>\n<pre><code># umount \/dev\/xxx # mount \/dev\/xxx \/mnt\/xxx $ ll \/mnt\/xxx\/encrypted_folder\/ total 12 drwxr-xr-x 2 user user 4096 Apr 20 14:25 .\/ drwxr-xr-x 5 user user 4096 Apr 20 14:15 ..\/ -rw-r--r-- 1 user user   23 Apr 20 14:26 BhqTNRNHDBwpa9S1qCaXwC<\/code><\/pre>\n<p>  <\/p>\n<h3>2. \u0418\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0432 \u0444\u0430\u0439\u043b\u043e\u0432\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u0435<\/h3>\n<p>  \u0412 \u0421\u0443\u043f\u0435\u0440\u0431\u043b\u043e\u043a\u0435: \u043d\u0430\u0431\u043e\u0440 \u043e\u043f\u0446\u0438\u0439 s_feature_incompat \u043d\u0430 \u0442\u043e\u043c\u0435 \u0441 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u043e\u0439 \u0448\u0438\u0444\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0444\u043b\u0430\u0433 EXT4_FEATURE_INCOMPAT_ENCRYPT, <br \/>  s_encrypt_algos[4] \u2014 \u0445\u0440\u0430\u043d\u0438\u0442 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u044b \u0448\u0438\u0444\u0440\u043e\u0432\u0430\u043d\u0438\u044f; \u043d\u0430 \u0434\u0430\u043d\u043d\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u044d\u0442\u043e:<br \/>  s_encrypt_algos[0] = EXT4_ENCRYPTION_MODE_AES_256_XTS;<br \/>  s_encrypt_algos[1] = EXT4_ENCRYPTION_MODE_AES_256_CTS;<br \/>  s_encrypt_pw_salt \u2014 \u0442\u0430\u043a\u0436\u0435 \u0437\u0430\u0434\u0430\u0435\u0442\u0441\u044f \u043f\u0440\u0438 \u0444\u043e\u0440\u043c\u0430\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0438.<\/p>\n<p>  \u0412 \u0430\u0439\u043d\u043e\u0434\u0435: i_flags \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0444\u043b\u0430\u0433 EXT4_ENCRYPT_FL \u0438 \u0438\u043c\u0435\u043d\u043d\u043e \u043f\u043e \u043d\u0435\u043c\u0443 \u043c\u043e\u0436\u043d\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c, \u0447\u0442\u043e \u043e\u0431\u044a\u0435\u043a\u0442 \u0437\u0430\u0448\u0438\u0444\u0440\u043e\u0432\u0430\u043d.<\/p>\n<p>  <b>\u0421\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u0437\u0430\u0448\u0438\u0444\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0439 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438<\/b><\/p>\n<p>  \u0427\u0442\u043e\u0431\u044b \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u0442\u044c \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438, \u043d\u0443\u0436\u043d\u043e \u043f\u043e \u0435\u0435 \u0430\u0439\u043d\u043e\u0434\u0443 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c \u0435\u0435 \u043c\u0435\u0441\u0442\u043e\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043d\u0430 \u0434\u0438\u0441\u043a\u0435.<\/p>\n<p>  <b>1. \u041e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u043d\u043e\u043c\u0435\u0440\u0430 \u0430\u0439\u043d\u043e\u0434\u0430:<\/b><\/p>\n<pre><code>$ stat \/mnt\/xxx\/encrypted_folder\/   File: \/mnt\/xxx\/encrypted_folder\/   Size: 4096      \tBlocks: 8          IO Block: 4096   directory Device: 811h\/2065d\tInode: 14          Links: 2<\/code><\/pre>\n<p>  <b>2. \u041f\u043e\u0438\u0441\u043a \u0430\u0439\u043d\u043e\u0434\u0430 \u0432 \u0442\u0430\u0431\u043b\u0438\u0446\u0435 \u0430\u0439\u043d\u043e\u0434\u043e\u0432. <\/b><\/p>\n<p>  \u0410\u0439\u043d\u043e\u0434 14 \u043f\u0440\u0438\u043d\u0430\u0434\u043b\u0435\u0436\u0438\u0442 0-\u0439 \u0433\u0440\u0443\u043f\u043f\u0435, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u0442\u044c \u0442\u0430\u0431\u043b\u0438\u0446\u0443 \u0434\u0435\u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0440\u043e\u0432 0-\u0439 \u0433\u0440\u0443\u043f\u043f\u044b \u0438 \u043d\u0430\u0439\u0442\u0438 \u0432 \u043d\u0435\u0439 \u043d\u043e\u043c\u0435\u0440 \u0431\u043b\u043e\u043a\u0430 \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u0430\u0439\u043d\u043e\u0434\u043e\u0432. \u0422\u0430\u0431\u043b\u0438\u0446\u0430 \u0434\u0435\u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0440\u043e\u0432 0-\u0439 \u0433\u0440\u0443\u043f\u043f\u044b \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0432 \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0435, \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u0437\u0430 \u0441\u0443\u043f\u0435\u0440\u0431\u043b\u043e\u043a\u043e\u043c:<\/p>\n<pre><code># dd if=\/dev\/xxx of=gdt bs=4096 count=1 skip=1<\/code><\/pre>\n<p>  <img decoding=\"async\" src=\"http:\/\/sergeshibaev.ru\/images\/stories\/encryption\/gdt.png\" alt=\"image\"\/><br \/>  <i>\u0420\u0438\u0441. 1. \u0422\u0430\u0431\u043b\u0438\u0446\u0430 \u0434\u0435\u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0440\u043e\u0432 0-\u0439 \u0433\u0440\u0443\u043f\u043f\u044b<\/i><\/p>\n<p>  \u0412\u043d\u0430\u0447\u0430\u043b\u0435 \u043f\u0440\u043e\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u043d\u043e\u043c\u0435\u0440\u0430 \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u043e\u0432 \u0431\u0438\u0442\u043c\u0430\u043f\u0430 \u0431\u043b\u043e\u043a\u043e\u0432 \u0438 \u0431\u0438\u0442\u043c\u0430\u043f\u0430 \u0430\u0439\u043d\u043e\u0434\u043e\u0432, \u043d\u043e\u043c\u0435\u0440 \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0430 \u043d\u0430\u0447\u0430\u043b\u0430 \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u0430\u0439\u043d\u043e\u0434\u043e\u0432 \u0447\u0438\u0442\u0430\u0435\u043c \u043f\u043e \u0441\u043c\u0435\u0449\u0435\u043d\u0438\u044e 8 \u0431\u0430\u0439\u0442 \u043e\u0442 \u043d\u0430\u0447\u0430\u043b\u0430 \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u2014 0x00000424 (1060) \u0432 BigEndian \u0444\u043e\u0440\u043c\u0430\u0442\u0435. \u0410\u0439\u043d\u043e\u0434 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438 = 14, \u043f\u0440\u0438 \u0440\u0430\u0437\u043c\u0435\u0440\u0435 \u0430\u0439\u043d\u043e\u0434\u0430 \u0432 256 \u0431\u0430\u0439\u0442 \u0432 \u0442\u0430\u0431\u043b\u0438\u0446\u0435 \u043e\u043d \u0431\u0443\u0434\u0435\u0442 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u044c\u0441\u044f \u043f\u043e \u0441\u043c\u0435\u0449\u0435\u043d\u0438\u044e 0x0D00 \u043e\u0442 \u0435\u0435 \u043d\u0430\u0447\u0430\u043b\u0430. \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e 1-\u0439 \u043a\u043b\u0430\u0441\u0442\u0435\u0440 \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u0430\u0439\u043d\u043e\u0434\u043e\u0432:<\/p>\n<pre><code># dd if=\/dev\/xxx of=itable bs=4096 count=1 skip=1060<\/code><\/pre>\n<p>  <img decoding=\"async\" src=\"https:\/\/lh3.googleusercontent.com\/HguJyd6cP5KsBDqxsfxy8n4mcT7FD7xdno1ZqPu9Y_ltyHFi1YvcY_MyyVexu-Ost9xsThTBrmdVkbL85QTw0sEiv_cF9xhggnsVc-Wx_sJ3lqAFxRbDvkR0D83pRnqsHdcW4XtV\" alt=\"image\"\/><br \/>  <i>\u0420\u0438\u0441. 2. \u0410\u0439\u043d\u043e\u0434 \u0437\u0430\u0448\u0438\u0444\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0439 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438.<\/i><\/p>\n<p>  \u0412 \u0430\u0439\u043d\u043e\u0434\u0435 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u043c \u043d\u0430\u0447\u0430\u043b\u043e \u043f\u043e\u043b\u044f i_block[]. \u0422.\u043a. \u044d\u0442\u043e ext4, \u0442\u043e \u0432 \u043f\u0435\u0440\u0432\u044b\u0445 2 \u0431\u0430\u0439\u0442\u0430\u0445 i_block \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a \u0434\u0435\u0440\u0435\u0432\u0430 \u044d\u043a\u0441\u0442\u0435\u043d\u0442\u043e\u0432 \u2014 0xF30A. \u0414\u0430\u043b\u0435\u0435 \u043c\u043e\u0436\u043d\u043e \u0443\u0432\u0438\u0434\u0435\u0442\u044c \u043d\u043e\u043c\u0435\u0440 \u0431\u043b\u043e\u043a\u0430, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0445\u0440\u0430\u043d\u0438\u0442\u0441\u044f \u0437\u0430\u0448\u0438\u0444\u0440\u043e\u0432\u0430\u043d\u043d\u0430\u044f \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044f \u2014 0x00000402 (1026). (\u041d\u0430 \u0440\u0438\u0441\u0443\u043d\u043a\u0435 \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u043e \u043d\u0435 \u0432\u0441\u0451 \u043f\u043e\u043b\u0435 i_block, \u0430 \u0442\u043e\u043b\u044c\u043a\u043e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0442\u0438\u0432\u043d\u044b\u0435 24 \u0431\u0430\u0439\u0442\u0430 \u2014 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0435 36 \u0431\u0430\u0439\u0442 \u0437\u0430\u043f\u043e\u043b\u043d\u0435\u043d\u044b \u043d\u0443\u043b\u044f\u043c\u0438.)<\/p>\n<p>  <b>3. \u0427\u0442\u0435\u043d\u0438\u0435 \u0431\u043b\u043e\u043a\u0430 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438:<\/b><\/p>\n<pre><code># dd if=\/dev\/xxx of=dirdata bs=4096 count=1 skip=1026<\/code><\/pre>\n<p>  <img decoding=\"async\" src=\"https:\/\/lh3.googleusercontent.com\/TqVlhTGIQgQ-eIOXbX8Q9K74-c2tj_o0dYytBT032OcZEyco23PMq7ZuMyjq4cE0yoIx_JTal2e5K2JiQN_PmsKG1ftT-VmdUsK-UzIvY2UYylvO8Tdu8Rq9g17dV_R_2jGyGwQT\" alt=\"image\"\/><br \/>  <i>\u0420\u0438\u0441. 3. \u0414\u0430\u043c\u043f \u0437\u0430\u0448\u0438\u0444\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0439 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438.<\/i><\/p>\n<p>  \u041f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435: \u043f\u0435\u0440\u0432\u044b\u0435 \u0434\u0432\u0435 entry (\u0432\u044b\u0434\u0435\u043b\u0435\u043d\u044b \u043a\u0440\u0430\u0441\u043d\u044b\u043c) \u2014 \u044d\u0442\u043e \u0437\u0430\u043f\u0438\u0441\u0438 \u201c.\u201d \u0438 \u201c..\u201d, \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e, \u0442\u0435\u043a\u0443\u0449\u0430\u044f \u0438 \u0440\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u0441\u043a\u0430\u044f \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438. \u0423 \u0442\u0435\u043a\u0443\u0449\u0435\u0439 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438 \u0430\u0439\u043d\u043e\u0434 0x0000000E, \u0434\u043b\u0438\u043d\u0430 \u0437\u0430\u043f\u0438\u0441\u0438 0x000C \u0431\u0430\u0439\u0442, \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432 \u0432 \u0438\u043c\u0435\u043d\u0438 \u0444\u0430\u0439\u043b\u0430 \u2014 01 \u0438 \u0442\u0438\u043f entry 02 \u2014 \u044d\u0442\u043e \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044f. \u0414\u0430\u043b\u0435\u0435 \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u0438\u043c\u044f \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438, \u0432\u044b\u0440\u043e\u0432\u043d\u0435\u043d\u043d\u043e\u0435 \u043f\u043e 4-\u0431\u0430\u0439\u0442\u043e\u0432\u043e\u0439 \u0433\u0440\u0430\u043d\u0438\u0446\u0435 \u2014 2E000000 (2E \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u0441\u0438\u043c\u0432\u043e\u043b\u0443 \u2018.\u2019 \u2014 \u0442\u043e\u0447\u043a\u0430).<\/p>\n<p>  \u0421\u043b\u0435\u0434\u0443\u044e\u0449\u0430\u044f, \u0440\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u0441\u043a\u0430\u044f \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044f, \u0438\u043c\u0435\u0435\u0442 \u0430\u0439\u043d\u043e\u0434 0x00000002 (\u043a\u043e\u0440\u043d\u0435\u0432\u0430\u044f \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044f), \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u0430\u044f \u0434\u043b\u0438\u043d\u0430 \u0437\u0430\u043f\u0438\u0441\u0438 0x000C, \u0432 \u0438\u043c\u0435\u043d\u0438 02 \u0441\u0438\u043c\u0432\u043e\u043b\u0430, \u0442\u0438\u043f \u0442\u0430\u043a\u0436\u0435 02, \u043f\u043e\u0441\u043b\u0435 \u0447\u0435\u0433\u043e \u0438\u0434\u0435\u0442 \u0438\u043c\u044f \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438 \u2014 2E2E0000 (\u0434\u0432\u0435 \u0442\u043e\u0447\u043a\u0438).<\/p>\n<p>  \u041d\u0430\u043a\u043e\u043d\u0435\u0446, \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u044f\u044f entry \u0432 \u0434\u0430\u043d\u043d\u043e\u0439 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438 \u0438\u043c\u0435\u0435\u0442 \u0430\u0439\u043d\u043e\u0434 0x0000000F, \u0440\u0430\u0437\u043c\u0435\u0440 \u0437\u0430\u043f\u0438\u0441\u0438 0x0FDC, \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432 \u0432 \u0438\u043c\u0435\u043d\u0438 0x10, \u0442\u0438\u043f 01 \u2014 \u044d\u0442\u043e \u0438 \u0435\u0441\u0442\u044c \u0437\u0430\u0448\u0438\u0444\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u0444\u0430\u0439\u043b. \u041a\u0430\u043a \u0432\u0438\u0434\u043d\u043e \u0435\u0433\u043e \u0438\u043c\u044f \u043d\u0435 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u043e\u043c\u0443 my_secrets.txt. \u041a \u0442\u043e\u043c\u0443 \u0436\u0435, \u0432 \u0438\u0441\u0445\u043e\u0434\u043d\u043e\u043c \u0438\u043c\u0435\u043d\u0438 \u0444\u0430\u0439\u043b\u0430 \u0432\u0441\u0435\u0433\u043e 14 \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432, \u0430 \u043d\u0435 16 \u043a\u0430\u043a \u0437\u0434\u0435\u0441\u044c.<\/p>\n<p>  <b>NOTE: <\/b>\u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u0432\u043d\u0438\u043c\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0447\u0438\u0442\u0430\u0442\u0435\u043b\u0438 \u0441 \u043a\u0430\u043b\u044c\u043a\u0443\u043b\u044f\u0442\u043e\u0440\u043e\u043c \u043c\u043e\u0433\u043b\u0438 \u0437\u0430\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e \u0442.\u043a. \u0437\u0430\u0448\u0438\u0444\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u0444\u0430\u0439\u043b \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0439 entry \u0432 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438, \u0442\u043e \u0435\u0433\u043e \u0440\u0430\u0437\u043c\u0435\u0440 \u0437\u0430\u043f\u0438\u0441\u0438 \u0434\u043e\u043b\u0436\u0435\u043d \u0441\u0441\u044b\u043b\u0430\u0442\u044c\u0441\u044f \u043d\u0430 \u0433\u0440\u0430\u043d\u0438\u0446\u0443 \u0431\u043b\u043e\u043a\u0430. \u041e\u0434\u043d\u0430\u043a\u043e, 0x1000 \u2014 0xC \u2014 0xC = 0xFE8, \u0430 \u043d\u0435 0xFDC. \u042d\u0442\u043e \u0441\u0432\u044f\u0437\u0430\u043d\u043e \u0441 \u0442\u0435\u043c, \u0447\u0442\u043e \u0442\u043e\u043c \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u043b\u0441\u044f \u0441 \u043e\u043f\u0446\u0438\u0435\u0439 \u201cmetadata_csum\u201d, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0437\u0430\u0434\u0430\u0435\u0442\u0441\u044f \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e, \u043d\u0430\u0447\u0438\u043d\u0430\u044f \u0441 Ubuntu 16.10. \u041f\u0440\u0438 \u0432\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0438 \u044d\u0442\u043e\u0439 \u043e\u043f\u0446\u0438\u0438 \u0432 \u043a\u043e\u043d\u0446\u0435 \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0431\u043b\u043e\u043a\u0430 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438 \u0441\u043e\u0437\u0434\u0430\u0435\u0442\u0441\u044f 12-\u0431\u0430\u0439\u0442\u043e\u0432\u0430\u044f \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430, \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0449\u0430\u044f \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u044c\u043d\u0443\u044e \u0441\u0443\u043c\u043c\u0443 \u044d\u0442\u043e\u0433\u043e \u0431\u043b\u043e\u043a\u0430.<\/p>\n<p>  <b>4. \u0427\u0442\u0435\u043d\u0438\u0435 \u0437\u0430\u0448\u0438\u0444\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0433\u043e \u0444\u0430\u0439\u043b\u0430.<\/b><\/p>\n<p>  \u0418\u0437 \u0434\u0430\u043c\u043f\u0430 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u043c, \u0447\u0442\u043e \u0444\u0430\u0439\u043b \u0438\u043c\u0435\u0435\u0442 \u0430\u0439\u043d\u043e\u0434 15 (0xF). \u0418\u0449\u0435\u043c \u0435\u0433\u043e \u0432 \u0442\u0430\u0431\u043b\u0438\u0446\u0435 \u0430\u0439\u043d\u043e\u0434\u043e\u0432 \u0438 \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u043c \u0435\u0433\u043e \u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043d\u0430 \u0434\u0438\u0441\u043a\u0435:<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/lh5.googleusercontent.com\/cIse4-DNjHQfEPUbTfrjbqKnryJQx2ROjamFlCmjHWzfwlpnRGGIoq7G6bjxl2pcT9nVyaniEC3R690WiT5S4fn5XnLmtQ1d9mZLMQLSJzkx72pngrkD1QzuvFAf9FcK1QWULmGT\" alt=\"image\"\/><br \/>  <i>\u0420\u0438\u0441. 4. \u0410\u0439\u043d\u043e\u0434 \u0437\u0430\u0448\u0438\u0444\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0433\u043e \u0444\u0430\u0439\u043b\u0430.<\/i><\/p>\n<p>  \u0427\u0438\u0442\u0430\u0435\u043c \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0430 0x0000AA00 (43520)<\/p>\n<pre><code># dd if=\/dev\/xxx of=filedata bs=4096 count=1 skip=43520<\/code><\/pre>\n<p>  <img decoding=\"async\" src=\"https:\/\/lh4.googleusercontent.com\/EHd8ww2tYCWetvaGb63IsJoZDGEcuedWXWE32f4tV7SSIoLnx982N8MOrbaBcVrMlwbCtaZry98OsT-wtoqHfclGnEIohkl-Wq4yPTlCGX5BjLnC_WIEF3dQo35-se_r-haJ7KC0\" alt=\"image\"\/><br \/>  <i>\u0420\u0438\u0441. 5. \u0421\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<\/i><\/p>\n<p>  \u0418 \u044d\u0442\u043e \u0441\u043e\u0432\u0441\u0435\u043c \u043d\u0435 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u0437\u0430\u043f\u0438\u0441\u0430\u043d\u043d\u043e\u0439 \u0432 \u0444\u0430\u0439\u043b \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438. \u041d\u0430\u0441\u0442\u043e\u044f\u0449\u0438\u0439 \u0440\u0430\u0437\u043c\u0435\u0440 \u0444\u0430\u0439\u043b\u0430 \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u0442\u044c \u0432 \u043f\u043e\u043b\u0435 i_size \u0430\u0439\u043d\u043e\u0434\u0430 (\u043e\u0442\u043c\u0435\u0447\u0435\u043d \u0441\u0438\u043d\u0438\u043c \u043f\u0440\u044f\u043c\u043e\u0443\u0433\u043e\u043b\u044c\u043d\u0438\u043a\u043e\u043c \u043d\u0430 \u0440\u0438\u0441. 4): 0x00000017 \u2014 \u0438\u043c\u0435\u043d\u043d\u043e \u0441\u0442\u043e\u043b\u044c\u043a\u043e \u0431\u044b\u043b\u043e \u0437\u0430\u043f\u0438\u0441\u0430\u043d\u043e \u043a\u043e\u043c\u0430\u043d\u0434\u043e\u0439 echo \u201cMy secret file content\u201d + \u0441\u0438\u043c\u0432\u043e\u043b \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u0430 \u0441\u0442\u0440\u043e\u043a\u0438 0x0A.<\/p>\n<h3>3. \u0420\u0430\u0441\u0448\u0438\u0444\u0440\u043e\u0432\u043a\u0430<\/h3>\n<p>  <b>\u0420\u0430\u0441\u0448\u0438\u0444\u0440\u043e\u0432\u043a\u0430 \u0438\u043c\u0435\u043d\u0438 \u0444\u0430\u0439\u043b\u0430<\/b><\/p>\n<p>  \u0421\u043e\u0433\u043b\u0430\u0441\u043d\u043e EXT4 Encryption Design Document [2] \u0440\u0430\u0441\u0448\u0438\u0444\u0440\u043e\u0432\u043a\u0430 \u0438\u043c\u0435\u043d \u0444\u0430\u0439\u043b\u043e\u0432 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u0432 \u0434\u0432\u0430 \u044d\u0442\u0430\u043f\u0430:<\/p>\n<p>  1. DerivedKey = AES-128-ECB(data=MasterKey, key=DirNonce);<br \/>  2. EncFileName = AES-256-CBC-CTS(data=DecFileName, key=DerivedKey);<\/p>\n<p>  \u0422.\u0435. \u043d\u0430 \u043f\u0435\u0440\u0432\u043e\u043c \u044d\u0442\u0430\u043f\u0435 \u043d\u0430\u0434\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043a\u043b\u044e\u0447 \u0434\u043b\u044f \u0440\u0430\u0441\u0448\u0438\u0444\u0440\u043e\u0432\u043a\u0438. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u0434\u0430\u043d\u043d\u044b\u0435 \u041c\u0430\u0441\u0442\u0435\u0440-\u043a\u043b\u044e\u0447\u0430, \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u043e\u0433\u043e \u043f\u0440\u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0438 \u043a\u043b\u044e\u0447\u0430 \u0432 keyring, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0448\u0438\u0444\u0440\u0443\u044e\u0442\u0441\u044f \u043f\u043e AES-ECB 128-\u0431\u0438\u0442\u043d\u044b\u043c \u043a\u043b\u044e\u0447\u043e\u043c DirNonce. \u041d\u0430 \u0432\u0442\u043e\u0440\u043e\u043c \u044d\u0442\u0430\u043f\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0444\u0438\u043a\u0441\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u0432\u0435\u043a\u0442\u043e\u0440 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 (IV), \u0437\u0430\u043f\u043e\u043b\u043d\u0435\u043d\u043d\u044b\u0439 \u043d\u0443\u043b\u044f\u043c\u0438. \u0414\u043b\u044f AES-ECB \u0432\u0435\u043a\u0442\u043e\u0440 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043d\u0435 \u043d\u0443\u0436\u0435\u043d.<\/p>\n<p>  \u0427\u0442\u043e \u0442\u0430\u043a\u043e\u0435 DirNonce? \u0412 \u0430\u0439\u043d\u043e\u0434\u0435 \u0437\u0430\u0448\u0438\u0444\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0439 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438 \u0435\u0441\u0442\u044c extended attribute.<\/p>\n<p>  <img decoding=\"async\" src=\"http:\/\/sergeshibaev.ru\/images\/encryption\/dir_inode.png\" alt=\"image\"\/><br \/>  <i>\u0420\u0438\u0441. 6. \u0410\u0439\u043d\u043e\u0434 \u0437\u0430\u0448\u0438\u0444\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0439 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438 \u0438 \u0435\u0433\u043e extended attribute<\/i><\/p>\n<p>  \u041f\u0440\u0438 \u0440\u0430\u0437\u043c\u0435\u0440\u0435 \u0430\u0439\u043d\u043e\u0434\u0430 \u0432 256 \u0431\u0430\u0439\u0442 \u0432 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0435 \u043e\u0441\u0442\u0430\u0435\u0442\u0441\u044f \u043e\u043a\u043e\u043b\u043e \u0441\u043e\u0442\u043d\u0438 \u043d\u0435\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0445 \u0431\u0430\u0439\u0442 (0x100 \u2014 EXT2_GOOD_OLD_INODE_SIZE \u2014 i_extra_size), \u0432 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043c\u043e\u0436\u043d\u043e \u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e (\u043a\u0440\u0430\u0441\u043d\u0430\u044f \u043e\u0431\u043b\u0430\u0441\u0442\u044c \u043d\u0430 \u0440\u0438\u0441. 6). \u041a\u0430\u043a \u0432\u0438\u0434\u043d\u043e \u043f\u043e \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u0443 0xEA020000 \u0432 \u043f\u0435\u0440\u0432\u044b\u0445 \u0447\u0435\u0442\u044b\u0440\u0435\u0445 \u0431\u0430\u0439\u0442\u0430\u0445 \u044d\u0442\u043e\u0439 \u043e\u0431\u043b\u0430\u0441\u0442\u0438, \u0437\u0434\u0435\u0441\u044c \u0445\u0440\u0430\u043d\u0438\u0442\u0441\u044f extended attribute \u0441 \u0438\u043d\u0434\u0435\u043a\u0441\u043e\u043c 09, \u0434\u0430\u043d\u043d\u044b\u0435 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0441\u043c\u0435\u0449\u0435\u043d\u044b \u043d\u0430 0x40 \u0431\u0430\u0439\u0442 \u043e\u0442 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u0430 \u0438 \u0438\u043c\u0435\u044e\u0442 \u0440\u0430\u0437\u043c\u0435\u0440 0x1C. \u041e\u0431\u043b\u0430\u0441\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0445 \u043f\u043e\u0434\u0435\u043b\u0435\u043d\u0430 \u043d\u0430 3 \u0437\u043e\u043d\u044b: \u0432 \u043f\u0435\u0440\u0432\u043e\u0439 (01 01 04 00) \u0437\u0430\u043f\u0438\u0441\u0430\u043d\u044b \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u044b, \u043f\u043e \u043a\u043e\u0442\u043e\u0440\u044b\u043c \u0431\u044b\u043b \u0437\u0430\u0448\u0438\u0444\u0440\u043e\u0432\u0430\u043d \u0430\u0439\u043d\u043e\u0434. \u0412\u043e \u0432\u0442\u043e\u0440\u043e\u0439 \u2014 \u0445\u0440\u0430\u043d\u0438\u0442\u0441\u044f 8 \u0431\u0430\u0439\u0442 (8E 67 9E 44 49 BB 92 35), \u043f\u043e\u0432\u0442\u043e\u0440\u044f\u044e\u0449\u0438\u0435 \u0434\u0435\u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0440 \u043a\u043b\u044e\u0447\u0430. \u0412 \u0442\u0440\u0435\u0442\u044c\u0435\u0439 \u2014 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442\u0441\u044f 16-\u0431\u0430\u0439\u0442\u043e\u0432\u044b\u0439 \u043e\u0434\u043d\u043e\u0440\u0430\u0437\u043e\u0432\u044b\u0439 \u043a\u043e\u0434 (\u043d\u043e\u043d\u0441 [3]), \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0439 \u043f\u0440\u0438 \u0448\u0438\u0444\u0440\u043e\u0432\u0430\u043d\u0438\u0438 \u041c\u0430\u0441\u0442\u0435\u0440-\u043a\u043b\u044e\u0447\u0430.<\/p>\n<p>  \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u0434\u043b\u044f \u0440\u0430\u0441\u0448\u0438\u0444\u0440\u043e\u0432\u043a\u0438 \u0438\u043c\u0435\u043d\u0438 \u0444\u0430\u0439\u043b\u0430, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e:<\/p>\n<p>  1) \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0431\u0435\u0437\u044b\u043c\u044f\u043d\u043d\u043e\u0433\u043e extended attribute \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438 \u0441 \u0438\u043d\u0434\u0435\u043a\u0441\u043e\u043c 9 \u2014 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u043d\u043e\u043d\u0441 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438;<br \/>  2) \u043f\u043e \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0443 AES-ECB \u0437\u0430\u0448\u0438\u0444\u0440\u043e\u0432\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u041c\u0430\u0441\u0442\u0435\u0440-\u043a\u043b\u044e\u0447\u0430, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043a\u043b\u044e\u0447\u0430 128 \u0431\u0438\u0442 \u043d\u043e\u043d\u0441\u0430 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438;<br \/>  3) \u043f\u043e \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0443 AES-CBC-CTS \u0440\u0430\u0441\u0448\u0438\u0444\u0440\u043e\u0432\u0430\u0442\u044c \u0438\u043c\u044f \u0444\u0430\u0439\u043b\u0430, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043a\u043b\u044e\u0447\u0430 \u043f\u0435\u0440\u0432\u044b\u0435 256 \u0431\u0438\u0442 (\u043f\u043e\u043b\u043e\u0432\u0438\u043d\u0443) \u043a\u043b\u044e\u0447\u0430, \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u043e\u0433\u043e \u043d\u0430 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u043c \u044d\u0442\u0430\u043f\u0435.<\/p>\n<p>  <b>\u0420\u0430\u0441\u0448\u0438\u0444\u0440\u043e\u0432\u043a\u0430 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0433\u043e \u0444\u0430\u0439\u043b\u0430<\/b><\/p>\n<p>  \u0412\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u043e \u043f\u0440\u043e\u0446\u0435\u0434\u0443\u0440\u0435 \u0440\u0430\u0441\u0448\u0438\u0444\u0440\u043e\u0432\u043a\u0438 \u0438\u043c\u0435\u043d\u0438 \u0444\u0430\u0439\u043b\u0430, \u0437\u0430 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435\u043c \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043d\u043e\u043d\u0441\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 extended attribute, \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u043e\u0435 \u0438\u0437 \u0430\u0439\u043d\u043e\u0434\u0430 \u0444\u0430\u0439\u043b\u0430. \u0418 \u0432\u043c\u0435\u0441\u0442\u043e CBC \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u0434\u0435\u0448\u0438\u0444\u0440\u0443\u0435\u0442\u0441\u044f \u043f\u043e \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0443 AES-XTS \u0441 \u043f\u043e\u043b\u043d\u044b\u043c 64-\u0431\u0430\u0439\u0442\u043e\u0432\u044b\u043c \u043a\u043b\u044e\u0447\u043e\u043c. \u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 IV \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f Logical Block Offset \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043d\u0430\u0447\u0430\u043b\u0430 \u0444\u0430\u0439\u043b\u0430<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/lh5.googleusercontent.com\/BqgJ2Y6k1uOGL8jRlWjJs83G0Leww0c8sZWkulegzu1uwyUFBnDX8C6Yc64Gs7-KP8ArC4QZ5TheQ_hecIKn1lFRR0uLV5ro_5In7vZ4iX71xrPkw_JJkmbW2M9z0Obo79HSvKr1\" alt=\"image\"\/><br \/>  <i>\u0420\u0438\u0441. 7. \u0410\u0439\u043d\u043e\u0434 \u0437\u0430\u0448\u0438\u0444\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0433\u043e \u0444\u0430\u0439\u043b\u0430 \u0438 \u0435\u0433\u043e extended attribute.<\/i><\/p>\n<p>  \u0421\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u044f \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 extended attribute \u0437\u0430\u0448\u0438\u0444\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0433\u043e \u0444\u0430\u0439\u043b\u0430 \u0438 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438, \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e \u0438\u0445 \u043d\u043e\u043d\u0441\u044b \u0440\u0430\u0437\u043b\u0438\u0447\u0430\u044e\u0442\u0441\u044f, \u0432 \u0442\u043e \u0432\u0440\u0435\u043c\u044f \u043a\u0430\u043a \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u044b \u0448\u0438\u0444\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0438 \u0434\u0435\u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0440\u044b \u043a\u043b\u044e\u0447\u0435\u0439 \u0441\u043e\u0432\u043f\u0430\u0434\u0430\u044e\u0442 (\u0436\u0435\u043b\u0442\u0430\u044f \u0438 \u0441\u0438\u043d\u044f\u044f \u0437\u043e\u043d\u044b \u043d\u0430 \u0440\u0438\u0441\u0443\u043d\u043a\u0430\u0445).<\/p>\n<p>  \u0421\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u0444\u0430\u0439\u043b\u043e\u0432 \u0448\u0438\u0444\u0440\u0443\u0435\u0442\u0441\u044f \u043f\u043e\u0441\u0442\u0440\u0430\u043d\u0438\u0447\u043d\u043e, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0434\u043b\u044f \u0440\u0430\u0441\u0448\u0438\u0444\u0440\u043e\u0432\u043a\u0438 \u043a\u043e\u043d\u0442\u0435\u043d\u0442\u0430 \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0446\u0435\u043b\u044b\u0439 \u043a\u043b\u0430\u0441\u0442\u0435\u0440 \u0444\u0430\u0439\u043b\u0430 (4K), \u0430 \u043d\u0435 \u0440\u0430\u0437\u043c\u0435\u0440, \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u044b\u0439 \u0432 \u043f\u043e\u043b\u0435 i_size \u0430\u0439\u043d\u043e\u0434\u0430.<\/p>\n<p>  <b>4. \u0420\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f<\/b><\/p>\n<p>  \u0420\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0434\u0435\u0448\u0438\u0444\u0440\u0430\u0442\u043e\u0440\u0430 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0430 \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 Linux Kernel Crypto API [4]. \u0412 \u0446\u0435\u043f\u043e\u0447\u043a\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0434\u0432\u0430 \u0432\u0438\u0434\u0430 \u0448\u0438\u0444\u0440\u0430\u0442\u043e\u0440\u043e\u0432 \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u043f\u0440\u043e\u043f\u0438\u0441\u0430\u043d\u043e \u0432 \/proc\/crypto \u0434\u043b\u044f \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u043e\u0432 ebc(aes), cts(cbc(aes)), xts(aes). \u0420\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0435\u043c \u044f\u0434\u0440\u043e 4.10.0-19: \u0448\u0438\u0444\u0440 ebc \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u0442\u0441\u044f \u0447\u0435\u0440\u0435\u0437 blkcipher, cts(cbc) \u0438 xts \u2014 \u0447\u0435\u0440\u0435\u0437 skcipher:<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">$ cat \/proc\/crypto<\/b><\/p>\n<div class=\"spoiler_text\">$ cat \/proc\/crypto<br \/>  name: ecb(aes)<br \/>  driver: ecb(aes-aesni)<br \/>  module: kernel<br \/>  priority: 300<br \/>  internal: no<br \/>  type: blkcipher<br \/>  blocksize: 16<br \/>  min keysize: 16<br \/>  max keysize: 32<br \/>  ivsize: 0<br \/>  geniv: default<\/p>\n<p>  name: cts(cbc(aes))<br \/>  driver: cts(cbc-aes-aesni)<br \/>  module: kernel<br \/>  priority: 400<br \/>  internal: no<br \/>  type: skcipher<br \/>  async: yes<br \/>  blocksize: 16<br \/>  min keysize: 16<br \/>  max keysize: 32<br \/>  ivsize: 16<br \/>  chunksize: 16<\/p>\n<p>  name: xts(aes)<br \/>  driver: xts-aes-aesni<br \/>  module: aesni_intel<br \/>  priority: 401<br \/>  internal: no<br \/>  type: skcipher<br \/>  async: yes<br \/>  blocksize: 16<br \/>  min keysize: 32<br \/>  max keysize: 64<br \/>  ivsize: 16<br \/>  chunksize: 16  <\/div>\n<\/div>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0420\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0448\u0438\u0444\u0440\u0430\u0442\u043e\u0440\u0430 \u0447\u0435\u0440\u0435\u0437 blkcipher<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"cpp\">typedef enum { ENCRYPT, DECRYPT } cipher_mode;  static int do_blkcrypt(const u8* cipher, const u8* key, u32 key_len,    void* iv, void* dst, void* src, size_t src_len, cipher_mode mode) {   int res;   struct crypto_blkcipher* blk;   struct blkcipher_desc desc;   struct scatterlist sg_src, sg_dst;     blk = crypto_alloc_blkcipher(cipher, 0, 0);   if (IS_ERR(blk))   {     printk(KERN_WARNING &quot;Failed to initialize blkcipher mode %s\\n&quot;, cipher);     return PTR_ERR(blk);   }     res = crypto_blkcipher_setkey(blk, key, key_len);   if (res)   {     printk(KERN_WARNING &quot;Failed to set key. len=%#x\\n&quot;, key_len);     crypto_free_blkcipher(blk);     return res;   }     crypto_blkcipher_set_iv(blk, iv, 16);     sg_init_one(&sg_src, src, src_len);   sg_init_one(&sg_dst, dst, src_len);     desc.tfm = blk;   desc.flags = 0;     if (mode == ENCRYPT)     res = crypto_blkcipher_encrypt(&desc, &sg_dst, &sg_src, src_len);   else     res = crypto_blkcipher_decrypt(&desc, &sg_dst, &sg_src, src_len);     crypto_free_blkcipher(blk);     return res; } <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0420\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0448\u0438\u0444\u0440\u0430\u0442\u043e\u0440\u0430 \u0447\u0435\u0440\u0435\u0437 skcipher<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"cpp\">struct tcrypt_result {     struct completion completion;     int err; };   static void crypt_complete_cb(struct crypto_async_request* req, int error) {     struct tcrypt_result* res = req-&gt;data;       if (error == -EINPROGRESS)         return;       res-&gt;err = error;     complete(&res-&gt;completion); }   static int do_skcrypt(const u8* cipher, const u8* key, u32 key_len,    void* iv, void* dst, void* src, size_t src_len, cipher_mode mode) {     struct scatterlist          src_sg, dst_sg;     struct crypto_skcipher*     tfm;     struct skcipher_request*    req = 0;     struct tcrypt_result        crypt_res;     int res = -EFAULT;       tfm = crypto_alloc_skcipher(cipher, 0, 0);     if (IS_ERR(tfm))     {         printk(KERN_WARNING &quot;Failed to initialize skcipher mode %s\\n&quot;, cipher);         res = PTR_ERR(tfm);         tfm = NULL;         goto out;     }       req = skcipher_request_alloc(tfm, GFP_NOFS);     if (!req)     {         printk(KERN_WARNING &quot;Couldn't allocate skcipher handle\\n&quot;);         res = -ENOMEM;         goto out;     }       skcipher_request_set_callback(req, CRYPTO_TFM_REQ_MAY_BACKLOG | CRYPTO_TFM_REQ_MAY_SLEEP,                                    crypt_complete_cb, &crypt_res);       if (crypto_skcipher_setkey(tfm, key, key_len))     {         printk(KERN_WARNING &quot;Failed to set key\\n&quot;);         res = -EINVAL;         goto out;     }       sg_init_one(&src_sg, src, src_len);     sg_init_one(&dst_sg, dst, src_len);       skcipher_request_set_crypt(req, &src_sg, &dst_sg, src_len, iv);     init_completion(&crypt_res.completion);       if (mode == ENCRYPT)         res = crypto_skcipher_encrypt(req);     else         res = crypto_skcipher_decrypt(req);       switch (res)     {     case 0: break;     case -EINPROGRESS:     case -EBUSY:         wait_for_completion(&crypt_res.completion);         if (!res && !crypt_res.err)         {             reinit_completion(&crypt_res.completion);             break;         }     default:         printk(&quot;Skcipher %scrypt returned with err = %d, result %#x\\n&quot;,  mode == ENCRYPT ? &quot;en&quot; : &quot;de&quot;, res, crypt_res.err);         break;     }   out:     if (tfm)         crypto_free_skcipher(tfm);     if (req)         skcipher_request_free(req);       return res; } <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0427\u0442\u0435\u043d\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 (payload) \u041c\u0430\u0441\u0442\u0435\u0440-\u043a\u043b\u044e\u0447\u0430<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"cpp\">#define MASTER_KEY_SIZE 64  static int GetMasterKey(const u8* descriptor, u8* raw) {   struct key* keyring_key = NULL;   const struct user_key_payload* ukp;   struct fscrypt_key* master_key;     keyring_key = request_key(&key_type_logon, descriptor, NULL);     if (IS_ERR(keyring_key))     return -EINVAL;     if (keyring_key-&gt;type != &key_type_logon)   {     printk_once(KERN_WARNING &quot;%s: key type must be 'logon'\\n&quot;, __func__);     return -EINVAL;   }     down_read(&keyring_key-&gt;sem);   ukp = user_key_payload(keyring_key);     master_key = (struct fscrypt_key*)ukp-&gt;data;   up_read(&keyring_key-&gt;sem);     if (master_key-&gt;size != MASTER_KEY_SIZE)   {     printk(KERN_WARNING &quot;Wrong Master key size %#x\\n&quot;, master_key-&gt;size);     return -EINVAL;   }     memcpy(raw, master_key-&gt;raw, master_key-&gt;size);     return 0; }<\/code><\/pre>\n<\/p><\/div>\n<\/div>\n<p>  <b>NOTE: <\/b>\u0412 \u0432\u0435\u0440\u0441\u0438\u044f\u0445 \u044f\u0434\u0440\u0430 \u043c\u043b\u0430\u0434\u0448\u0435 4.4 \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u0444\u0443\u043d\u043a\u0446\u0438\u044f user_key_payload. \u0414\u0430\u043d\u043d\u044b\u0435 \u043a\u043b\u044e\u0447\u0430 \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u0442\u044c \u043d\u0435\u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0438\u0437 struct key* keyring_key.<\/p>\n<p>  <b>\u0420\u0430\u0441\u0448\u0438\u0444\u0440\u043e\u0432\u043a\u0430 \u0438\u043c\u0435\u043d\u0438 \u0444\u0430\u0439\u043b\u0430<\/b><\/p>\n<pre><code class=\"cpp\">int err; u8 iv[16] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; u8 nonce_dir[16] = { ... }; u8 master_key[64], derived_key[64]; u8 dec_file_name[] = { ... }; u8 enc_file_name[sizeof(dec_file_name)];   err = do_blkcrypt(&quot;ecb(aes)&quot;, nonce_dir, 16, iv, derived_key, master_key,                    MASTER_KEY_SIZE, ENCRYPT); if (err)   return err;   err = do_skcrypt(&quot;cts(cbc(aes))&quot;, derived_key, MASTER_KEY_SIZE \/ 2, iv,                   dec_file_name, enc_file_name, sizeof(dec_file_name), DECRYPT);  return err;<\/code><\/pre>\n<p>  <b>\u0420\u0430\u0441\u0448\u0438\u0444\u0440\u043e\u0432\u043a\u0430 \u043a\u043e\u043d\u0442\u0435\u043d\u0442\u0430<\/b><\/p>\n<p>  \u0414\u043b\u044f \u0443\u043f\u0440\u043e\u0449\u0435\u043d\u0438\u044f \u043e\u043f\u0443\u0449\u0435\u043d\u0430 \u0440\u0430\u0431\u043e\u0442\u0430 \u0441 \u043f\u0430\u043c\u044f\u0442\u044c\u044e. \u041f\u0440\u0435\u0434\u043f\u043e\u043b\u043e\u0436\u0438\u043c, 2 x PAGE_SIZE \u043d\u0430\u043c \u0434\u0430\u043b\u0438 \u043d\u0430 \u0441\u0442\u0435\u043a\u0435.<\/p>\n<pre><code class=\"cpp\">u8 nonce_file[16] = { ... }; u8 enc_file_data[PAGE_SIZE] = { ... }; u8 dec_file_data[PAGE_SIZE];   err = do_blkcrypt(&quot;ecb(aes)&quot;, nonce_file, 16, iv, derived_key, master_key,                    MASTER_KEY_SIZE, ENCRYPT); if (err)   return err;  err = do_skcrypt(&quot;xts(aes)&quot;, derived_key, MASTER_KEY_SIZE, iv,                    dec_file_data, enc_file_data, PAGE_SIZE, DECRYPT);   return err; <\/code><\/pre>\n<p>  <b>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0435 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u0447\u043d\u044b\u0435 \u0444\u0430\u0439\u043b\u044b (\u0430\u043a\u0442\u0443\u0430\u043b\u044c\u043d\u043e \u0434\u043b\u044f 4.10.0-19)<\/b><\/p>\n<pre><code class=\"cpp\">#include &lt;linux\/kernel.h&gt; #include &lt;linux\/module.h&gt; #include &lt;linux\/scatterlist.h&gt; #include &lt;linux\/fscrypto.h&gt; <\/code><\/pre>\n<p>  <b>Makefile<\/b><\/p>\n<pre><code>obj-m += ciphertest.o  all: \tmake -C \/lib\/modules\/$(shell uname -r)\/build M=$(PWD) modules  clean: \tmake -C \/lib\/modules\/$(shell uname -r)\/build M=$(PWD) clean <\/code><\/pre>\n<p>  <\/p>\n<h3>5. \u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b<\/h3>\n<p>  \u0418\u0441\u0445\u043e\u0434\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435:<\/p>\n<pre><code class=\"cpp\">u8 master_key[MASTER_KEY_SIZE] = {   0xa5, 0xb5, 0xc9, 0x23, 0x02, 0x14, 0xfc, 0xf7,   0x28, 0xdc, 0x90, 0x25, 0x24, 0x9e, 0xe6, 0xbc,   0x7c, 0xa8, 0xf8, 0xe1, 0x94, 0xf6, 0x67, 0x32,   0x33, 0xc4, 0xc1, 0xe8, 0x78, 0x59, 0xab, 0xfb,   0xae, 0xb0, 0xbf, 0x5d, 0x2c, 0x69, 0xc3, 0x8f,   0x51, 0x37, 0x26, 0x3f, 0xd1, 0xce, 0x37, 0xef,   0x3f, 0x80, 0xe3, 0x2d, 0xd5, 0xfd, 0x78, 0x45,   0x62, 0xf3, 0xa5, 0x24, 0x6b, 0xcf, 0x4a, 0x88  }; u8 enc_file_name[] = {   0x41, 0xa8, 0x4e, 0x4d, 0xd4, 0x1c, 0x43, 0x00,    0xa7, 0x5a, 0x2f, 0xd5, 0xaa, 0xa0, 0x5d, 0xb0 }; u8 nonce_dir[] = {   0x37, 0xba, 0x14, 0x16, 0x3e, 0xa8, 0xd5, 0x48,    0xd1, 0x3c, 0xb5, 0x6a, 0x01, 0xb7, 0x7c, 0x41 }; u8 nonce_file[] = {   0x61, 0x63, 0xb8, 0x31, 0xf4, 0xf5, 0xfc, 0x99,    0x1e, 0x3c, 0xf1, 0x8a, 0x23, 0xaf, 0x1e, 0xa8 }; <\/code><\/pre>\n<p>  \u0417\u0430\u043a\u043e\u0434\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0435 \u0438\u043c\u044f \u0444\u0430\u0439\u043b\u0430 enc_file_name \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043e \u0438\u0437 \u0434\u0430\u043c\u043f\u0430 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438 (\u0440\u0438\u0441. 3).<br \/>  \u041d\u043e\u043d\u0441 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438 nonce_dir \u043f\u043e\u043b\u0443\u0447\u0435\u043d \u0438\u0437 \u0434\u0430\u043c\u043f\u0430 \u0430\u0439\u043d\u043e\u0434\u0430 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438 (\u0440\u0438\u0441. 6)<br \/>  \u041d\u043e\u043d\u0441 \u0444\u0430\u0439\u043b\u0430 nonce_file \u043f\u043e\u043b\u0443\u0447\u0435\u043d \u0438\u0437 \u0434\u0430\u043c\u043f\u0430 \u0430\u0439\u043d\u043e\u0434\u0430 \u0444\u0430\u0439\u043b\u0430 (\u0440\u0438\u0441. 7)<\/p>\n<p>  \u041c\u0430\u0441\u0442\u0435\u0440-\u043a\u043b\u044e\u0447 \u043f\u043e\u043a\u0430\u0437\u0430\u043d \u0437\u0434\u0435\u0441\u044c \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u0434\u043b\u044f \u043d\u0430\u0433\u043b\u044f\u0434\u043d\u043e\u0441\u0442\u0438. \u0415\u0433\u043e \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043f\u0440\u0438 \u043e\u0442\u043b\u0430\u0434\u043a\u0435 e4crypt:<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/lh3.googleusercontent.com\/Xx3w3fLflX-z5aU6FsngBDquRpaSMU6aZxVyw-GaBaB-6JzoHyzH57de18Q-aE6Rcm-_wrmrP7voI69rABIEmxc2DnFS0UZpI6tZZUTuHoOzaL8SevaHHqT6fGXFqcGkebmdra4u\" alt=\"image\"\/><\/p>\n<p>  \u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0440\u0430\u0431\u043e\u0442\u044b \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u043e\u0433\u043e \u0434\u0440\u0430\u0439\u0432\u0435\u0440\u0430<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/lh5.googleusercontent.com\/h8SqFmkiK3NTAl3hz1G160oFK-LXlyZ5yPGgWxpgT4ffXx2USwgRuBy6RwWZWNWivb5uILWPQkhBlmateLSgLKYMkjyZ9fvYKqaHVacifRuJ_G9uBHn1C9APi_66D5oawrmyTEW4\" alt=\"image\"\/><\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0421\u0441\u044b\u043b\u043a\u0438<\/b><\/p>\n<div class=\"spoiler_text\">[1] KERNEL KEY RETENTION SERVICE, <a href=\"https:\/\/www.kernel.org\/doc\/Documentation\/security\/keys.txt\">www.kernel.org\/doc\/Documentation\/security\/keys.txt<\/a><br \/>  [2] EXT4 Encryption Design Document, <a href=\"https:\/\/docs.google.com\/document\/d\/1ft26lUQyuSpiu6VleP70_npaWdRfXFoNnB8JYnykNTg\/edit\">docs.google.com\/document\/d\/1ft26lUQyuSpiu6VleP70_npaWdRfXFoNnB8JYnykNTg\/edit<\/a><br \/>  [3] Wikipedia \u2014 Nonce, <a href=\"https:\/\/ru.wikipedia.org\/wiki\/Nonce\">ru.wikipedia.org\/wiki\/Nonce<\/a><br \/>  [4] Linux Kernel Crypto API, <a href=\"https:\/\/www.kernel.org\/doc\/html\/latest\/crypto\/index.html\">www.kernel.org\/doc\/html\/latest\/crypto\/index.html<\/a><\/div>\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:\/\/habrahabr.ru\/post\/327682\/\"> https:\/\/habrahabr.ru\/post\/327682\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p><img decoding=\"async\" src=\"https:\/\/upload.wikimedia.org\/wikipedia\/commons\/f\/f0\/Tux_ecb.jpg\" alt=\"image\" align=\"left\"\/> \u041f\u0430\u0440\u0430\u043d\u043e\u0439\u044f \u043d\u0435 \u043b\u0435\u0447\u0438\u0442\u0441\u044f! \u041d\u043e \u0438 \u043d\u0435 \u043f\u0440\u0435\u0441\u043b\u0435\u0434\u0443\u0435\u0442\u0441\u044f \u043f\u043e \u0437\u0430\u043a\u043e\u043d\u0443. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0432 Linux Kernel 4.1 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0430 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0430 \u0448\u0438\u0444\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0444\u0430\u0439\u043b\u043e\u0432\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b ext4 \u043d\u0430 \u0443\u0440\u043e\u0432\u043d\u0435 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0445 \u0444\u0430\u0439\u043b\u043e\u0432 \u0438 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0439. \u0417\u0430\u0448\u0438\u0444\u0440\u043e\u0432\u0430\u0442\u044c \u043c\u043e\u0436\u043d\u043e \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u0443\u0441\u0442\u0443\u044e \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044e. \u0412\u0441\u0435 \u0444\u0430\u0439\u043b\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0431\u0443\u0434\u0443\u0442 \u0441\u043e\u0437\u0434\u0430\u043d\u044b \u0432 \u0442\u0430\u043a\u043e\u0439 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438, \u0442\u0430\u043a\u0436\u0435 \u0431\u0443\u0434\u0443\u0442 \u0437\u0430\u0448\u0438\u0444\u0440\u043e\u0432\u0430\u043d\u044b. \u0428\u0438\u0444\u0440\u0443\u044e\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u0438\u043c\u0435\u043d\u0430 \u0444\u0430\u0439\u043b\u043e\u0432 \u0438 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435, \u043c\u0435\u0442\u0430\u0434\u0430\u043d\u043d\u044b\u0435 \u043d\u0435 \u0448\u0438\u0444\u0440\u0443\u044e\u0442\u0441\u044f, inline data (\u043a\u043e\u0433\u0434\u0430 \u0434\u0430\u043d\u043d\u044b\u0435 \u0444\u0430\u0439\u043b\u0430, \u043d\u0435 \u043f\u0440\u0435\u0432\u044b\u0448\u0430\u044e\u0449\u0438\u0435 \u043f\u043e \u0440\u0430\u0437\u043c\u0435\u0440\u0443 60 \u0431\u0430\u0439\u0442, \u0445\u0440\u0430\u043d\u044f\u0442\u0441\u044f \u0432 \u0430\u0439\u043d\u043e\u0434\u0435) \u0432 \u0444\u0430\u0439\u043b\u0430\u0445 \u043d\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442\u0441\u044f. \u041f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u0440\u0430\u0441\u0448\u0438\u0444\u0440\u043e\u0432\u043a\u0430 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0433\u043e \u0444\u0430\u0439\u043b\u0430 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u043d\u0435\u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0432 \u043f\u0430\u043c\u044f\u0442\u0438, \u0448\u0438\u0444\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u043e \u0442\u043e\u043b\u044c\u043a\u043e \u0432 \u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435, \u043a\u043e\u0433\u0434\u0430 \u0440\u0430\u0437\u043c\u0435\u0440 \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0430 \u0441\u043e\u0432\u043f\u0430\u0434\u0430\u0435\u0442 \u0441 PAGE_SIZE, \u0442.\u0435. \u0440\u0430\u0432\u0435\u043d 4\u041a.  <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-285764","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/285764","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=285764"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/285764\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=285764"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=285764"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=285764"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}