-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
779 lines (378 loc) · 19.3 KB
/
index.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
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
<!DOCTYPE html>
<!--[if IEMobile 7 ]><html class="no-js iem7"><![endif]-->
<!--[if lt IE 9]><html class="no-js lte-ie8"><![endif]-->
<!--[if (gt IE 8)|(gt IEMobile 7)|!(IEMobile)|!(IE)]><!--><html class="no-js" lang="en"><!--<![endif]-->
<head>
<meta charset="utf-8">
<title>PyTux | Trips of a curious penguin</title>
<meta name="author" content="Filippo Valsorda">
<meta name="description" content="Everyone will tell you that the best practice for password storage is [sb]crypt with random salt. Ok, we got that and even maybe got everyone to …">
<!-- http://t.co/dKP3o1e -->
<meta name="HandheldFriendly" content="True">
<meta name="MobileOptimized" content="320">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="canonical" href="https://filippo.io/">
<link href="/favicon.png" rel="icon">
<link href="/stylesheets/screen.css" media="screen, projection" rel="stylesheet" type="text/css">
<script src="/javascripts/modernizr-2.0.js"></script>
<script src="/javascripts/ender.js"></script>
<script src="/javascripts/octopress.js" type="text/javascript"></script>
<link href="/atom.xml" rel="alternate" title="PyTux" type="application/atom+xml">
<!--Fonts from Google"s Web font directory at http://google.com/webfonts -->
<link href="//fonts.googleapis.com/css?family=PT+Serif:regular,italic,bold,bolditalic" rel="stylesheet" type="text/css">
<link href="//fonts.googleapis.com/css?family=PT+Sans:regular,italic,bold,bolditalic" rel="stylesheet" type="text/css">
<!-- mathjax config similar to math.stackexchange -->
<script type="text/x-mathjax-config">
MathJax.Hub.Config({
jax: ["input/TeX", "output/HTML-CSS"],
tex2jax: {
inlineMath: [ ['$', '$'] ],
displayMath: [ ['$$', '$$']],
processEscapes: true,
skipTags: ['script', 'noscript', 'style', 'textarea', 'pre', 'code']
},
messageStyle: "none",
"HTML-CSS": { preferredFont: "TeX", availableFonts: ["STIX","TeX"] }
});
</script>
<script src="//cdnjs.cloudflare.com/ajax/libs/mathjax/2.3/MathJax.js" type="text/javascript"></script>
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-37225193-1']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>
</head>
<body >
<header role="banner"><hgroup>
<h1><a href="/">PyTux</a></h1>
<h2>Trips of a curious penguin.</h2>
</hgroup>
<a href="https://filippo.io/Heartbleed/">
<img class="heartbleed" src="/images/heartbleed.png">
<div class="heartbleed">Go to the Heartbleed test!</div>
</a>
</header>
<nav role="navigation"><ul class="subscription" data-subscription="rss">
<li><a href="/atom.xml" rel="subscribe-rss" title="subscribe via RSS">RSS</a></li>
</ul>
<form action="http://google.com/search" method="get">
<fieldset role="search">
<input type="hidden" name="q" value="site:filippo.io" />
<input class="search" type="text" name="q" results="0" placeholder="Search"/>
</fieldset>
</form>
<ul class="main-navigation">
<li><a href="/">Blog</a></li>
<li><a href="/archives">Archives</a></li>
<li><a href="/links">Links</a></li>
<li><a href="/CV">CV</a></li>
<li><a href="https://github.com/FiloSottile">GitHub</a></li>
</ul>
</nav>
<nav role="navigation">
<ul class="main-navigation"><li><a><strong>Projects</strong></a></li>
<li><a href="https://github.com/rg3/youtube-dl">youtube-dl</a></li>
<li><a href="https://filippo.io/Biglumber-map/">Biglumber map</a></li>
<li><a href="https://apps.facebook.com/coverflipper/">Cover flipper</a></li>
<li><a href="https://traviscron.pythonanywhere.com/">Travis cron trigger</a></li>
<li><a href="https://ruzzlemap.it/">Ruzzle map</a></li>
<li><a href="https://www.recapthelaw.org/">RECAP</a></li>
<li><a href="/linux-syscall-table">Syscall table</a></li>
<li><a href="https://twitter.com/HNTitles">HN Titles</a></li>
</ul>
</nav>
<div id="main">
<div id="content">
<div class="blog-index">
<article>
<header>
<!-- Now we're back to normal posts. Note the links used under href in both headers. -->
<h1 class="entry-title"><a href="/salt-and-pepper/">Salt & Pepper, please: a note on password storage</a></h1>
<p class="meta">
<time datetime="2014-05-28T19:50:00+02:00" pubdate data-updated="true" class="updated">May 28<span>th</span>, 2014</time>
</p>
</header>
<div class="entry-content"><p>Everyone will tell you that the best practice for password storage is [sb]crypt with random salt. Ok, we got that and even maybe got everyone to agree. But let me bump that up a notch: do you know what pepper is?</p>
<p>The concept of peppering is simple: <strong>add a extra fixed, hardcoded salt</strong>. (On top of what you are already doing, obviously.)</p>
<p>That is, do something like:</p>
<div class="bogus-wrapper"><notextile><figure class="code"><figcaption><span></span></figcaption><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class="line-number">1</span>
<span class="line-number">2</span>
<span class="line-number">3</span>
<span class="line-number">4</span>
</pre></td><td class="code"><pre><code class="python"><span class="line"><span class="n">salt</span> <span class="o">=</span> <span class="n">urandom</span><span class="p">(</span><span class="mi">16</span><span class="p">)</span>
</span><span class="line"><span class="n">pepper</span> <span class="o">=</span> <span class="s">"oFMLjbFr2Bb3XR)aKKst@kBF}tHD9q"</span> <span class="c"># or, getenv('PEPPER')</span>
</span><span class="line"><span class="n">hashed_password</span> <span class="o">=</span> <span class="n">scrypt</span><span class="p">(</span><span class="n">password</span><span class="p">,</span> <span class="n">salt</span> <span class="o">+</span> <span class="n">pepper</span><span class="p">)</span>
</span><span class="line"><span class="n">store</span><span class="p">(</span><span class="n">hashed_password</span><span class="p">,</span> <span class="n">salt</span><span class="p">)</span>
</span></code></pre></td></tr></table></div></figure></notextile></div>
<p>Does this seem useless? Well if you think about it, most password leaks happen because of database leaks (SQL injection, DB credential compromise, DB auth bypass…) and attackers might not necessarily get access to the webserver. In that case, the hashes would be <em>completely useless</em>.</p>
<p>Yes, this is not sureproof, attackers might also get access to your webserver, but security is all about layers and raising cost, no? Who knows, maybe the eBay leaked hashes would have been useless to the attackers were they peppered.</p>
</div>
</article>
<article>
<header>
<!-- Now we're back to normal posts. Note the links used under href in both headers. -->
<h1 class="entry-title"><a href="/sqlalchemy-plus-mysql-plus-python-3-plus-pip/">SQLAlchemy + MySQL + Python 3 + pip</a></h1>
<p class="meta">
<time datetime="2014-05-02T00:40:00+02:00" pubdate data-updated="true" class="updated">May 2<span>nd</span>, 2014</time>
</p>
</header>
</article>
<article>
<header>
<!-- Now we're back to normal posts. Note the links used under href in both headers. -->
<h1 class="entry-title"><a href="/on-keybase-dot-io-and-encrypted-private-key-sharing/">On Keybase.io and encrypted private key uploading</a></h1>
<p class="meta">
<time datetime="2014-03-31T21:15:00+02:00" pubdate data-updated="true" class="updated">Mar 31<span>st</span>, 2014</time>
</p>
</header>
</article>
<article>
<header>
<!-- Now we're back to normal posts. Note the links used under href in both headers. -->
<h1 class="entry-title"><a href="/why-go-is-elegant-and-makes-my-code-elegant/">Why Go is elegant and makes my code elegant</a></h1>
<p class="meta">
<time datetime="2014-03-26T18:16:00+01:00" pubdate data-updated="true" class="updated">Mar 26<span>th</span>, 2014</time>
</p>
</header>
</article>
<article>
<header>
<!-- Now we're back to normal posts. Note the links used under href in both headers. -->
<h1 class="entry-title"><a href="/my-remote-shell-session-setup/">My remote shell session setup</a></h1>
<p class="meta">
<time datetime="2014-03-18T04:08:00+01:00" pubdate data-updated="true" class="updated">Mar 18<span>th</span>, 2014</time>
</p>
</header>
</article>
<article>
<header>
<!-- Now we're back to normal posts. Note the links used under href in both headers. -->
<h1 class="entry-title"><a href="/native-scrolling-and-iterm2/">Native scrolling and iTerm2</a></h1>
<p class="meta">
<time datetime="2014-03-13T03:15:00+01:00" pubdate data-updated="true" class="updated">Mar 13<span>th</span>, 2014</time>
</p>
</header>
</article>
<article>
<header>
<!-- Now we're back to normal posts. Note the links used under href in both headers. -->
<h1 class="entry-title"><a href="/scraping-a-video-out-of-a-more-stubborn-site/">Scraping the hell out of a more stubborn site</a></h1>
<p class="meta">
<time datetime="2014-02-03T03:47:00+01:00" pubdate data-updated="true" class="updated">Feb 3<span>rd</span>, 2014</time>
</p>
</header>
</article>
<article>
<header>
<!-- Now we're back to normal posts. Note the links used under href in both headers. -->
<h1 class="entry-title"><a href="/add-support-for-a-new-video-site-to-youtube-dl/">Add support for a new video site to youtube-dl</a></h1>
<p class="meta">
<time datetime="2014-01-27T02:12:00+01:00" pubdate data-updated="true" class="updated">Jan 27<span>th</span>, 2014</time>
</p>
</header>
</article>
<article>
<header>
<!-- Now we're back to normal posts. Note the links used under href in both headers. -->
<h1 class="entry-title"><a href="/callback-based-combinations-in-go/">Callback-based combinations (in Go)</a></h1>
<p class="meta">
<time datetime="2014-01-16T15:20:00+01:00" pubdate data-updated="true" class="updated">Jan 16<span>th</span>, 2014</time>
</p>
</header>
</article>
<article>
<header>
<!-- Now we're back to normal posts. Note the links used under href in both headers. -->
<h1 class="entry-title"><a href="/how-the-new-gmail-image-proxy-works-and-what-does-this-mean-for-you/">How the new Gmail image proxy actually works and what does this mean for you</a></h1>
<p class="meta">
<time datetime="2013-12-12T17:52:00+01:00" pubdate data-updated="true" class="updated">Dec 12<span>th</span>, 2013</time>
</p>
</header>
</article>
<div class="pagination">
<a class="prev" href="/blog/page/2/">← Older</a>
<a href="/archives">Blog Archives</a>
</div>
</div>
<aside class="sidebar">
<section class="aboutme">
<h1>About Me</h1>
<p>I am <span class="name">Filippo Valsorda</span> (<a href="https://twitter.com/FiloSottile">@FiloSottile</a>) an Italian consultant specialized in cryptography and security with a passion for Python, Go and maths.
I am one of the guys currently behind <a href="https://github.com/rg3/youtube-dl">youtube-dl</a> and I attended <a href="http://hackerschool.com">Hacker School</a> in NYC. Now I’m in Milan.</p>
<p><span style="cursor: pointer" onclick="this.textContent = ('hi' + '@filippo' + String.fromCharCode(46) + 'io'); this.onclick = null; this.style.cursor='default'">Click here to reveal my email.</span></p>
<img src="//projecteuler.net/profile/FiloSottile.png">
<p style="display:none"><a href="https://plus.google.com/u/0/+FilippoValsorda/?rel=author">Google+</a></p>
</section>
<section>
<h1>Recent Posts</h1>
<ul id="recent_posts">
<li class="post">
<a href="/salt-and-pepper/">Salt & Pepper, please: a note on password storage</a>
</li>
<li class="post">
<a href="/sqlalchemy-plus-mysql-plus-python-3-plus-pip/">SQLAlchemy + MySQL + Python 3 + pip</a>
</li>
<li class="post">
<a href="/on-keybase-dot-io-and-encrypted-private-key-sharing/">On Keybase.io and encrypted private key uploading</a>
</li>
<li class="post">
<a href="/why-go-is-elegant-and-makes-my-code-elegant/">Why Go is elegant and makes my code elegant</a>
</li>
<li class="post">
<a href="/my-remote-shell-session-setup/">My remote shell session setup</a>
</li>
</ul>
</section>
<section class="coderwall">
<h1>Coderwall<a href="https://coderwall.com/filosottile"><img alt="Endorse"
src="//api.coderwall.com/filosottile/endorsecount.png" /></a></h1>
<ul id="cw_badges">
<li class="loading">Status updating…</li>
</ul>
<script type="text/javascript">
var coderwall = (function(){
function render(options, badges){
var fragment = '',
t = $(options.target),
height = 65,
width = 65,
index;
for (index in badges) {
fragment += '<a class="cw_badge"title="' + badges[index].description + '" href="http://coderwall.com/' + options.user + '">';
fragment += '<img alt="' + badges[index].description + '" height="' + width + '" width="' + height + '" src="' + badges[index].badge + '"/>';
fragment += '</a>';
}
t.html(fragment);
}
return {
showBadges: function(options){
$.ajax({
url: 'https://coderwall.com/' + options.user + '.json?callback=call19543'
, type: 'jsonp'
, jsonpCallback: 'callback'
, jsonpCallbackName: 'call19543'
, error: function (err) { $(options.target + ' li.loading').addClass('error').text("Error loading feed"); }
, success: function(res) {
render(options, res.data.badges);
}
});
}
};
})();
$(document).ready(function(){
coderwall.showBadges({
user: 'FiloSottile',
target: '#cw_badges'
});
});
</script>
<style type="text/css">
.cw_badge img {
padding: 5px;
border: 0 none !important;
-moz-box-shadow: none !important;
-webkit-box-shadow: none !important;
-o-box-shadow: none !important;
box-shadow: none !important;
}
</style>
</section>
<section>
<h1>GitHub Repos</h1>
<ul id="gh_repos">
<li class="loading">Status updating…</li>
</ul>
<a href="https://github.com/FiloSottile">@FiloSottile</a> on GitHub
<script type="text/javascript">
$.domReady(function(){
if (!window.jXHR){
var jxhr = document.createElement('script');
jxhr.type = 'text/javascript';
jxhr.src = '/javascripts/libs/jXHR.js';
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(jxhr, s);
}
github.showRepos({
user: 'FiloSottile',
count: 5,
skip_forks: false,
target: '#gh_repos'
});
});
</script>
<script src="/javascripts/github.js" type="text/javascript"> </script>
</section>
<section>
<h1>Latest Tweets</h1>
<ul id="tweets" class="reset-zoom">
<a class="twitter-timeline" data-dnt="true" href="https://twitter.com/FiloSottile" data-widget-id="369235929669435393" data-link-color="#1863a1" data-tweet-limit="4" data-chrome="noheader nofooter transparent noscrollbar">Tweets by @FiloSottile</a>
<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+"://platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script>
</ul>
<p>Follow <a href="http://twitter.com/FiloSottile">@FiloSottile</a></p>
</section>
<section>
<h1>My Pinboard</h1>
<ul id="pinboard_linkroll">Fetching linkroll…</ul>
<p><a href="http://pinboard.in/u:FiloSottile">My Pinboard Bookmarks »</a></p>
</section>
<script type="text/javascript">
var linkroll = 'pinboard_linkroll'; //id target for pinboard list
var pinboard_user = "FiloSottile"; //id target for pinboard list
var pinboard_count = 3; //id target for pinboard list
(function(){
var pinboardInit = document.createElement('script');
pinboardInit.type = 'text/javascript';
pinboardInit.async = true;
pinboardInit.src = '/javascripts/pinboard.js';
document.getElementsByTagName('head')[0].appendChild(pinboardInit);
})();
</script>
</aside>
</div>
</div>
<footer role="contentinfo"><p>
Copyright © 2014 - Filippo Valsorda -
<span class="credit">Powered by <a href="http://octopress.org">Octopress</a></span>
</p>
</footer>
<script type="text/javascript">
var disqus_shortname = 'pytux';
var disqus_script = 'count.js';
(function () {
var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
dsq.src = '//' + disqus_shortname + '.disqus.com/' + disqus_script;
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
}());
</script>
<script type="text/javascript">
(function() {
var script = document.createElement('script'); script.type = 'text/javascript'; script.async = true;
script.src = 'https://apis.google.com/js/plusone.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(script, s);
})();
</script>
<script type="text/javascript">
(function(){
var twitterWidgets = document.createElement('script');
twitterWidgets.type = 'text/javascript';
twitterWidgets.async = true;
twitterWidgets.src = '//platform.twitter.com/widgets.js';
document.getElementsByTagName('head')[0].appendChild(twitterWidgets);
})();
</script>
<!-- (MIT License) - Copyright (c) 2012 Ilya Grigorik -->
<script>
(function(d, t) {
var g = d.createElement(t),
s = d.getElementsByTagName(t)[0];
g.src = '//hnbutton.appspot.com/static/hn.min.js';
s.parentNode.insertBefore(g, s);
}(document, 'script'));
</script>
</body>
</html>