Skip to content

Instantly share code, notes, and snippets.

View cite-reader's full-sized avatar

Allie cite-reader

View GitHub Profile
@cite-reader
cite-reader / history-of-password-storage.md
Last active July 9, 2020 18:24
An oral history of password storage

This oral his­to­ry of pass­word stor­age on the Web orig­i­nal­ly ap­peared as a re­mark in the #in­fos­ec chan­nel of the Hang­ops slack—the con­ver­sa­tion had turned to a men­tion of “hashed, salt­ed pass­words” in a breach an­nounce­ment in a way that made me sus­pect at least some of our friends had not stud­ied the top­ic in de­tail. Sev­er­al par­tic­i­pants then en­cour­aged me to ex­pand the re­mark into a blog post, and now here we are.While I was around for some of this, much of it pre­dates my ca­reer; every­thing is as ac­cu­rate as I can rea­son­ably make it, but cor­rec­tions of gross er­rors are wel­comed.The first time peo­ple at­tempt to de­sign a Web lo­gin sys­tem, they will usu­al­ly de­fault to sim­ply in­sert­ing their users’ pass­words in their data­base. This so­lu­tion is sim­ple, ob­vi­ous, and wrong.The prob­lem is that data­base stor­age is not near­ly as pri­vate as we would all like it to be. Even the data­bas­es that we’d

@cite-reader
cite-reader / Cargo.toml
Created September 21, 2019 19:29
Example code for authenticating CURVE peers
[package]
name = "curve-authenticator"
version = "0.1.0"
edition = "2018"
[dependencies]
env_logger = "0.6"
log = "0.4"
zmq = "0.9.2"
@cite-reader
cite-reader / main.rs
Created June 5, 2016 23:46
Testing a Clap arg with default value
extern crate clap;
use clap::{Arg, App};
fn main() {
let matches = App::new("A test")
.arg(Arg::with_name("has-default")
.short("d")
.takes_value(true))
.get_matches();
@cite-reader
cite-reader / Cargo.toml
Created May 14, 2016 06:09
OpenSSL from Rust
[package]
name = "openssl-ex"
version = "0.1.0"
authors = ["Alex Hill <alexander.d.hill.89@gmail.com>"]
[dependencies.openssl]
version = "0.7"
features = ["tlsv1_2"]
@cite-reader
cite-reader / valid_utf8_prefix.rs
Created May 14, 2016 05:36
Sometimes you want to parse as much UTF-8 as possible.
//! Parsing UTF-8 prefixes out of bytes
/*
Copyright 2016 Alex hill
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
@cite-reader
cite-reader / rowlet.hs
Created May 13, 2016 03:20
In celebration of the new Pokemon.
-- https://twitter.com/rowletbot/status/730385243958554624
module Main (main) where
import Control.Concurrent (threadDelay)
import Control.Monad (forever)
-- | __spins furiously__
main :: IO ()
main = forever $ do
@cite-reader
cite-reader / pollen.rkt
Created November 19, 2015 00:51
I was going to write something, but wrote a tool to render what I'd written instead.
#lang racket/base
(require (for-syntax racket/base)
pollen/world pollen/decode racket/function hyphenate)
(provide (except-out (all-defined-out)
default-postprocessor define-tag-handler
define-trivial-html-handler))
(module config racket/base
(provide poly-targets)
@cite-reader
cite-reader / lib.rs
Created September 30, 2015 17:57
Cracking the Coding Interview exercise: baby names
use std::collections::HashMap;
pub fn aggregate_baby_names<'a>(name_frequencies: &[(&'a str, usize)],
name_mappings: &[(&'a str, &'a str)])
-> Vec<(&'a str, usize)>
{
let mut disambiguation = HashMap::with_capacity(name_mappings.len());
let mut coalesced_index = 0;
let mut canonical_names = Vec::with_capacity(name_frequencies.len());
for &(syn1, syn2) in name_mappings {
@cite-reader
cite-reader / 0001-Guess-in-parallel.patch
Created October 19, 2014 18:11
Haskell: easiest parallelization ever.
From 076066f4d671c59924c2425e20e4697cbce816e0 Mon Sep 17 00:00:00 2001
From: Alex Hill <alexander.d.hill.89+git@gmail.com>
Date: Sun, 19 Oct 2014 11:06:18 -0700
Subject: [PATCH] Guess in parallel.
---
matasano-challenge.cabal | 5 +++--
src/Main.hs | 3 ++-
2 files changed, 5 insertions(+), 3 deletions(-)