Skip to content

Instantly share code, notes, and snippets.

Symmetric Encryption

The only way to encrypt today is authenticated encryption, or "AEAD". ChaCha20-Poly1305 is faster in software than AES-GCM. AES-GCM will be faster than ChaCha20-Poly1305 with AES-NI. Poly1305 is also easier than GCM for library designers to implement safely. AES-GCM is the industry standard.

Use, in order of preference:

  1. The NaCl/libsodium default
@mnicky
mnicky / gist:7e0e21b8dfa07ee9ba57
Created December 18, 2015 10:04 — forked from grugq/gist:7713916
The text from: http://dee.su/uploads/baal.html On Underground Communications
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512
Undercover communication
It should be obvious by now, that the only way to communicate
stealthily and securely is to avoid raising suspicion to the
level at which the authorities might consider it worthwhile
to put you under active surveillance (e.g., park a van with
TEMPEST equipment by your apartment).
@mnicky
mnicky / mvnc.sh
Created June 4, 2014 12:55 — forked from japgolly/mvnc.sh
#!/bin/bash
RESET="\e[0m"
BLACK="\e[0;30m"
RED="\e[0;31m"
GREEN="\e[0;32m"
YELLOW="\e[0;33m"
BLUE="\e[0;34m"
MAGENTA="\e[0;35m"
CYAN="\e[0;36m"
"""A simple implementation of a greedy transition-based parser. Released under BSD license."""
from os import path
import os
import sys
from collections import defaultdict
import random
import time
import pickle
SHIFT = 0; RIGHT = 1; LEFT = 2;
@mnicky
mnicky / mk.scm
Created December 11, 2012 21:40 — forked from swannodette/gist:4262177
MiniKanren impl. in Scheme
#lang r5rs
(define-syntax var
(syntax-rules ()
((_ x) (vector x))))
(define-syntax var?
(syntax-rules ()
((_ x) (vector? x))))
;Lisp in Lisp in Golomb forests. Includes use of linked lists.
;Based on Paul Graham's version of McCarthy's paper and code.
;Uses only eq, cond, atom, quote, cons, car, and cdr.
(defun null. (x)
(eq x '()))
(defun and. (x y)
(cond (x
(cond (y 't)
@mnicky
mnicky / fsm.clj
Created November 22, 2012 12:38 — forked from Pet3ris/fsm.clj
Finite State Machine in Clojure core.logic
(ns fsm
(:refer-clojure :exclude [==])
(:use [clojure.core.logic]))
;; Encoding a Finite State Machine and recognizing strings in its language in Clojure core.logic
;; We will encode the following FSM:
;;
;; (ok) --+---b---> (fail)
;; ^ |
@mnicky
mnicky / gist:4027422
Created November 6, 2012 20:48 — forked from jlongster/gist:1712455
traditional lisp macros
;; outlet code for implementing traditional macro expansion
;; macros
(define (expand form)
(cond
((variable? form) form)
((literal? form) form)
((macro? (car form))
(expand ((macro-function (car form)) form)))
@mnicky
mnicky / sokuza-kanren.scm
Created October 25, 2012 11:26 — forked from fogus/sokuza-kanren.scm
Mini-kanren like logic programming in Scheme
; source: http://okmij.org/ftp/Scheme/sokuza-kanren.scm
; Quick miniKanren-like code
;
; written at the meeting of a Functional Programming Group
; (Toukyou/Shibuya, Apr 29, 2006), as a quick illustration of logic
; programming. The code is really quite trivial and unsophisticated:
; it was written without any preparation whatsoever. The present file
; adds comments and makes minor adjustments.