-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathluks.html
326 lines (316 loc) · 17.3 KB
/
luks.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
<!DOCTYPE html>
<!--
(The MIT License)
Copyright (c) 2016 Kura
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the 'Software'), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
-->
<html lang="en">
<head id="head">
<meta charset="utf-8">
<meta name="viewport"
content="width=device-width, initial-scale=1.0, minimum-scale=1.0">
<link rel="alternate" href="https://nekopy.github.io" hreflang="en" />
<link rel="dns-prefetch" href="https://nekopy.github.io">
<link rel="dns-prefetch" href="//code.getmdl.io">
<link rel="shortcut icon" href="https://nekopy.github.io/favicon.ico">
<title>LUKS vs eCryptfs</title>
</head>
<body>
<div class="eevee-layout mdl-layout mdl-js-layout mdl-color--grey-50">
<header class="eevee-header mdl-color--grey-50 mdl-color-text--grey-800"
itemscope itemtype="http://schema.org/WPHeader">
<div class="mdl-layout__header-row" id="top">
<div aria-expanded="false" role="button" tabindex="0"
class="mdl-layout__drawer-button mdl-color-text--accent eevee-mobile-button mdl-layout--small-screen-only">
<i class="material-icons"></i>
</div>
<span class="eevee-logo mdl-color-text--accent mdl-layout-title">
<h2>
<a href="https://nekopy.github.io" rel="bookmark"
title="stderr">
stderr
</a>
</h2>
</span>
<div class="mdl-layout-spacer" role="presentation"></div>
<nav class="eevee-nav mdl-navigation mdl-layout--large-screen-only"
itemscope itemtype="http://schema.org/SiteNavigationElement"
aria-label="Header navigation">
<a class="mdl-color-text--accent mdl-navigation__link"
href="https://github.com/nekopy" itemprop="url" rel="bookmark">
Profile
</a>
</nav>
</div>
</header>
<div class="eevee-mobile-header mdl-layout__drawer mdl-color--white"
aria-hidden="true">
<span class="mdl-layout-title">
<h2 class="eevee-mobile-logo mdl-color-text--accent">
stderr
</h2>
</span>
<div class="mdl-navigation mdl-color--white">
<nav class="eevee-nav mdl-navigation" itemscope
itemtype="http://schema.org/SiteNavigationElement"
aria-label="Header navigation">
<a class="mdl-color-text--accent mdl-navigation__link"
href="https://nekopy.github.io" itemprop="url" rel="bookmark">
Home
</a>
<a class="mdl-color-text--accent mdl-navigation__link"
href="https://github.com/nekopy" itemprop="url" rel="bookmark">
Profile
</a>
</nav>
</div>
</div>
<div class="eevee-ribbon mdl-color--primary-dark" role="presentation">
</div>
<main class="eevee-main mdl-layout__content">
<div class="eevee-container mdl-grid">
<div role="presentation"
class="mdl-cell mdl-cell--2-col mdl-cell--hide-tablet mdl-cell--hide-phone">
</div>
<div class="eevee-content mdl-color--white mdl-shadow--4dp mdl-color-text--grey-800 mdl-cell mdl-cell--8-col"
aria-label="Main content">
<article itemscope itemtype="http://schema.org/BlogPosting">
<meta itemprop="accessibilityControl" content="fullKeyboardControl">
<meta itemprop="accessibilityControl" content="fullMouseControl">
<meta itemprop="accessibilityControl" content="bookmarks">
<meta itemprop="accessibilityControl" content="captions">
<meta itemprop="accessibilityControl" content="alternativeText">
<meta itemprop="accessibilityControl" content="index">
<meta itemprop="accessibilityControl" content="readingOrder">
<meta itemprop="accessibilityControl" content="structuralNavigation">
<meta itemprop="accessibilityControl" content="tableOfContents">
<meta itemprop="accessibilityHazard" content="noFlashingHazard">
<meta itemprop="accessibilityHazard" content="noMotionSimulationHazard">
<meta itemprop="accessibilityHazard" content="noSoundHazard">
<meta itemprop="accessibilityAPI" content="ARIA">
<div itemprop="author" itemscope
itemtype="https://schema.org/Person" role="presentation">
<a href="https://nekopy.github.io/author/nekopy.html" class="hidden"
itemprop="url" role="presentation">
<span class="hidden" itemprop="name" role="presentation">
neko.py
</span>
</a>
</div>
<meta itemprop="keywords"
content="ecryptfs,luks,linux,encryption,security,privacy">
<meta itemprop="keywords" content="linux">
<div class="eevee-meta eevee-share">
<div class="mdl-layout-spacer"></div>
<div>
<ul class="social-share mdl-navigation">
<li class="social-share__link social-share__link--twitter">
<a href="https://twitter.com/intent/tweet?text=LUKS%20vs%20eCryptfs&url=https%3A//nekopy.github.io/luks.html"
title="Share 'LUKS vs eCryptfs' on Twitter"
onclick="window.open(this.href, 'twitter-share', 'width=550,height=235'); return false;">
<i class="fa fa-twitter" aria-hidden="true"></i>
</a>
</li>
<li class="social-share__link social-share__link--facebook">
<a href="https://www.facebook.com/sharer/sharer.php?u=https%3A//nekopy.github.io/luks.html"
title="Share 'LUKS vs eCryptfs' on Facebook"
onclick="window.open(this.href, 'facebook-share', 'width=580,height=296'); return false;">
<i class="fa fa-facebook" aria-hidden="true"></i>
</a>
</li>
<li class="social-share__link social-share__link--google-plus">
<a href="https://plus.google.com/share?url=https%3A//nekopy.github.io/luks.html"
title="Share 'LUKS vs eCryptfs' on Google+"
onclick="window.open(this.href, 'google-plus-share', 'width=490,height=530');return false;">
<i class="fa fa-google" aria-hidden="true"></i>
</a>
</li>
<li class="social-share__link social-share__link--email">
<a href="mailto:?subject=LUKS%20vs%20eCryptfs&body=LUKS%20vs%20eCryptfs%20-%20https%3A//nekopy.github.io/luks.html%0A%0ATo%20round%20off%20my%20research%20from%20last%20week%2C%20I%27m%20making%20a%20quick%20comparison%20between%20eCryptfs%20and%20LUKS.%20I%20present%20a%20quick%20introduction%20to%20LUKS%2C%20compare%20and%20contrast%20with%20eCryptfs%20and%20discuss%20their%20relative%20strengths.' via email">
<i class="material-icons" aria-hidden="true"></i>
</a>
</li>
</ul>
</div>
</div>
<div class="eevee-article">
<div class="eevee-meta mdl-color-text--grey-500">
<time datetime="2017-03-15T20:59:40-07:00"
itemprop="datePublished">
Wed 15 March 2017
</time>
</div>
<h1 itemprop="name">
<a href="https://nekopy.github.io/luks.html" rel="bookmark"
title="Permalink to 'LUKS vs eCryptfs'"
itemprop="url">
LUKS vs eCryptfs
</a>
</h1>
<section itemprop="articleBody" class="article-content">
<p>Last week, I talked about setting up eCryptfs. I've been happily running it since. However, some of the major disadvantages of the system cropped up very quickly. The major issue I had was that even with eCryptfs I still had some more private documents that I didn't feel comfortable having decrypted whenever I'm logged into the laptop. </p>
<p>Instead, I grabbed my large external harddrive and made a standard encrypted partion. I selected LUKS + ext4. The major difference between LUKS and eCryptfs is that eCryptfs files are encrypted on their own, whereas LUKS crypto is applied to the entire partition. This is good and bad. eCryptfs likens themselves to PGP in this way, since the files have everything they need to be decrypted separately. So apparently you could migrate files from one machine to the other without them needing to be encrypted for transport.</p>
<p>Creating the encrypted partition was dead simple. The GNOME disk utility got me all set up making the partition. Then I just followed the long, slow process of migrating files. However, USB 3.0 made things move pretty quickly...</p>
<p>Now, I can access the disk only when I want to, decrypting it when I need it rather than all the time.</p>
<p>My next major interest was identifying how the cipher strength of default LUKS compares with default eCryptfs. So I went off to investigate how to figure out what kind of crypto was being used by each.</p>
<p>I used some fairly different commands for each. First, let's look at LUKS. Obviously, first make sure you've decrypted your disk.</p>
<div class="highlight"><pre><span></span>lsblk -f
</pre></div>
<p>This is going to give you information about the block devices on the system. Importantly, it'll give you the ID of the LUKS partition. We need this in order to query cryptsetup for information about LUKS.</p>
<div class="highlight"><pre><span></span>cryptsetup status <id>
</pre></div>
<p>From this, I'm able to see that my LUKS partition is using AES with a 256-bit key size. That's pretty good. It's FIPS 140-2 compliant, which is pretty good if you trust the NSA. Now how about eCryptfs?</p>
<div class="highlight"><pre><span></span>mount
</pre></div>
<p>This shows us all the info we need. Much less work... We can see from the mount attributes that we're also using AES. And the key size is 16 <em>bytes</em>, or 128 bits. So that's AES 128. Not too shabby, but could be better. Initially I misread the keysize as 16 <em>bits</em> and I was kind of terrified for a moment. </p>
<p>So, you get better encryption with LUKS, <em>and</em> better performance, I believe. When I was moving my stuff into my eCryptfs folder it brought the entire system to a crawl. And since it's going on in the kernel, I couldnt even set a nice value or tune it or anything. Yuck. However I didnt have that issue when moving files to LUKS for some reason, despite it needing to still encrypt the data on the fly. </p>
<p>So personally, I now have two levels of secure storage. First, there's the eCryptfs mount on my laptop I use for normal stuff. For more sensitive content that I can afford to have off-box, I use LUKS. </p>
</section>
</div>
</article>
</div>
</div>
</main>
<div class="eevee-pagination__container eevee-container mdl-grid">
<div role="presentation"
class="mdl-cell mdl-cell--2-col mdl-cell--hide-tablet mdl-cell--hide-phone">
</div>
<div class="mdl-color-text--grey-800 mdl-cell mdl-cell--8-col">
<nav class="eevee-pagination mdl-cell mdl-cell--12-col" itemscope
itemtype="http://schema.org/SiteNavigationElement"
aria-label="Pagination">
<div class="eevee-spacer"></div>
</nav> </div>
</div>
<footer class="mdl-mega-footer" itemscope
itemtype="http://schema.org/SiteNavigationElement">
<div class="mdl-mega-footer--top-section">
<div class="mdl-mega-footer--drop-down-section">
<ul class="mdl-mega-footer--link-list">
<li>
<a href="#top" itemprop="url"
title="Back to the top of the page">
Back to the top of the page
</a>
</li>
</ul>
</div>
</div>
<div class="mdl-mega-footer--middle-section" itemscope
itemtype="http://schema.org/SiteNavigationElement"
aria-label="Footer navigation">
<div class="mdl-mega-footer--drop-down-section">
<h1 class="mdl-mega-footer--heading">Menu</h1>
<ul class="mdl-mega-footer--link-list">
<li>
<a href="https://github.com/nekopy" itemprop="url" rel="bookmark">
Profile
</a>
</li>
</ul>
</div>
<div class="mdl-mega-footer--drop-down-section">
<h1 class="mdl-mega-footer--heading">Categories</h1>
<ul class="mdl-mega-footer--link-list">
<li>
<a href="https://nekopy.github.io/category/linux.html" itemprop="url"
rel="bookmark">
linux
</a>
</li>
<li>
<a href="https://nekopy.github.io/category/misc.html" itemprop="url"
rel="bookmark">
misc
</a>
</li>
<li>
<a href="https://nekopy.github.io/category/web-analysis.html" itemprop="url"
rel="bookmark">
Web Analysis
</a>
</li>
</ul>
</div>
<div class="mdl-mega-footer--drop-down-section">
<h1 class="mdl-mega-footer--heading">Social</h1>
<ul class="mdl-mega-footer--link-list">
<li>
<a href="https://discord.gg/Baka" itemprop="url" rel="bookmark">
Bakabot Discord
</a>
</li>
</ul>
</div>
<div class="mdl-mega-footer--drop-down-section">
<h1 class="mdl-mega-footer--heading">Links</h1>
<ul class="mdl-mega-footer--link-list">
<li>
<a href="http://getpelican.com/" itemprop="url" rel="bookmark">
Pelican
</a>
</li>
<li>
<a href="https://www.eff.org/" itemprop="url" rel="bookmark">
EFF
</a>
</li>
<li>
<a href="https://fsf.org/" itemprop="url" rel="bookmark">
The Free Software Foundation
</a>
</li>
<li>
<a href="https://creativecommons.org/" itemprop="url" rel="bookmark">
Creative Commons
</a>
</li>
</ul>
</div>
</div> <div class="mdl-mega-footer--bottom-section">
<div class="mdl-logo">
<a href="https://nekopy.github.io" rel="bookmark" itemprop="url"
title="stderr">
stderr
</a>
</div>
<ul class="eevee-footer mdl-mega-footer--link-list">
<li>Powered by love & rainbow sparkles.</li>
<li><a href="https://kura.io/eevee/" title="Eevee">Eevee</a> theme by <a href="https://kura.io/" title="kura.io">kura.io</a></li>
<li>
<iframe src="https://keroserene.net/snowflake/embed.html" width="88" height="16" frameborder="0" scrolling="no"></iframe>
</li>
</ul>
</div>
</footer>
</div>
<link rel="stylesheet"
href="//code.getmdl.io/1.1.3/material.blue_grey-indigo.min.css">
<link rel="stylesheet" type="text/css"
href="https://nekopy.github.io/theme/css/font-awesome.css">
<link rel="stylesheet" type="text/css"
href="https://nekopy.github.io/theme/css/material-icons.css">
<link rel="stylesheet" type="text/css"
href="https://nekopy.github.io/theme/css/pygments.css">
<link rel="stylesheet" type="text/css"
href="https://nekopy.github.io/theme/css/eevee.css">
<link rel="stylesheet" type="text/css"
href="https://nekopy.github.io/theme/css/custom.css">
<script async src="https://nekopy.github.io/theme/js/material.js">
</script>
</body>
</html>