Skip to content

Instantly share code, notes, and snippets.

Cryptographic Best Practices

Putting cryptographic primitives together is a lot like putting a jigsaw puzzle together, where all the pieces are cut exactly the same way, but there is only one correct solution. Thankfully, there are some projects out there that are working hard to make sure developers are getting it right.

The following advice comes from years of research from leading security researchers, developers, and cryptographers. This Gist was [forked from Thomas Ptacek's Gist][1] to be more readable. Additions have been added from

@edmt
edmt / loop.rb
Created November 24, 2019 20:54
Looping with Untyped λ-calculus in Ruby (inspired on Paged Out zine #2, page 23 article)
->(f, n) { puts(n) + f.(f, n + 1) }.(->(f, n) { puts(n) + f.(f, n + 1) }, 1)
->(f) { f.(f, 1) }.(->(f, n) { puts(n) + f.(f, n + 1) })
@edmt
edmt / README.md
Created October 4, 2019 18:15
README template

$project

$project will solve your problem of where to start with documentation, by providing a basic explanation of how to do it easily.

Look how easy it is to use:

import project

Get your stuff done

@edmt
edmt / preprocessor_fun.h
Created April 22, 2016 16:31 — forked from aras-p/preprocessor_fun.h
Things to commit just before leaving your job
// Just before switching jobs:
// Add one of these.
// Preferably into the same commit where you do a large merge.
//
// This started as a tweet with a joke of "C++ pro-tip: #define private public",
// and then it quickly escalated into more and more evil suggestions.
// I've tried to capture interesting suggestions here.
//
// Contributors: @r2d2rigo, @joeldevahl, @msinilo, @_Humus_,
// @YuriyODonnell, @rygorous, @cmuratori, @mike_acton, @grumpygiant,
@edmt
edmt / desafio.exs
Last active October 23, 2015 16:45
Desafio: Divisores y primos (retronet.com.ar/?p=64)
divisors = fn(n) ->
for d <- 1..n, rem(n, d) == 0, do: d
end
possible_primes = fn(n) ->
for d <- 1..n, rem(n, d) == 0, do: div(n, d) + d
end
primes = %{}
@edmt
edmt / server.c
Created March 7, 2014 15:28
Hello World Server in C (example)
#include <zmq.h>
#include <stdio.h>
#include <unistd.h>
#include <string.h>
#include <assert.h>
int main (void)
{
void *context = zmq_ctx_new();
void *responder = zmq_socket(context, ZMQ_REP);
@edmt
edmt / gist:9360534
Last active August 29, 2015 13:57
Hello World Server (example)
import time
import zmq
context = zmq.Context()
socket = context.socket(zmq.REP)
socket.bind("tcp://*:5555")
while True:
# Wait for next request from client
message = socket.recv()

Bearded's Hourly Contract

Date: [[Date of Document]] Between [Our Company] and [Your Company]

Summary

We’re not big on formality, but sometimes it’s best to have a few simple things written down so that we’re all on the same page. In this contract you won’t find complicated legal terms or large passages of unreadable text. We have no desire to trick you into signing something that you might later regret. We do want what’s best for the safety of both parties, now and in the future.