Skip to content

Instantly share code, notes, and snippets.

View tarcieri's full-sized avatar

Tony Arcieri tarcieri

View GitHub Profile
@lifthrasiir
lifthrasiir / .gitignore
Last active August 29, 2015 14:04
Rust-consttime (An obsoleted proof of concept; DO NOT USE THIS!)
target
doc
anonymous
anonymous / yolo-ca.pem
Created September 14, 2013 01:54
YOLOcrypto's CAcert: World's Most YOLO CA Bitches!
Bag Attributes
friendlyName: World's Most YOLO CA Bitches!
localKeyID: E9 50 D2 3B 6E 98 C5 AB D5 48 96 B8 B6 31 0D C2 65 D7 7F 34
subject=/CN=World's Most YOLO CA Bitches!/O=YOLOs Everywhere/OU=YOLO Crypto/ST=CA/C=US/L=Laguna Beach/emailAddress=yolocrypto@gmail.com
issuer=/CN=World's Most YOLO CA Bitches!/O=YOLOs Everywhere/OU=YOLO Crypto/ST=CA/C=US/L=Laguna Beach/emailAddress=yolocrypto@gmail.com
-----BEGIN CERTIFICATE-----
MIIC8zCCArGgAwIBAgICAaQwCQYHKoZIzjgEAzCBrzEmMCQGA1UEAwwdV29ybGQn
cyBNb3N0IFlPTE8gQ0EgQml0Y2hlcyExGTAXBgNVBAoMEFlPTE9zIEV2ZXJ5d2hl
cmUxFDASBgNVBAsMC1lPTE8gQ3J5cHRvMQswCQYDVQQIDAJDQTELMAkGA1UEBhMC
VVMxFTATBgNVBAcMDExhZ3VuYSBCZWFjaDEjMCEGCSqGSIb3DQEJARYUeW9sb2Ny
@knewter
knewter / .rvmrc
Last active December 18, 2015 17:19
Simultaneous Read Write hanging with sslsocket in celluloid-io in jruby
rvm jruby-1.7.4@celluloid_jruby_ssl_repro --create
#rvm ruby-1.9.3@celluloid_jruby_ssl_repro --create
@namelessjon
namelessjon / mounted_server.rb
Last active December 17, 2015 01:09
Combine a rack app with reel, to get the best of both worlds: A rack app (could be sinatra or even rails) for routing and dealing with pure HTTP requests, and all the power of reel and celluloid for dealing with things like websockets.
# Copyright (c) 2013 Jonathan Stott
#
# Permission is hereby granted, free of charge, to any person ob-
# taining a copy of this software and associated documentation
# files (the "Software"), to deal in the Software without restric-
# tion, including without limitation the rights to use, copy, modi-
# fy, merge, publish, distribute, sublicense, and/or sell copies of
# the Software, and to permit persons to whom the Software is fur-
# nished to do so, subject to the following conditions:
#
@grantr
grantr / curvecp_handshake.rb
Last active July 19, 2018 15:16
CurveCP handshake protocol in Ruby
# A demonstration of the CurveCP handshake protocol. This protocol has many
# favorable security properties described at http://curvecp.org.
#
# In addition to its security advantages, it has the following favorable properties:
# * Needs only 2 messages (1 from client, 1 from server) before application
# messages can be exchanged (3 before the server can send application messages)
# * Does not require the server to keep protocol state between handshake messages.
#
# An overview of the protocol:
#

"Logic Programming can be broadly defined as “using logic to infer computational steps from existing propositions” However, mathematical logic cannot always infer computational steps because computational systems make use of arbitration for determining which message is processed next by a recipient that is sent multiple messages concurrently. Since arrival orders are in general indeterminate, they cannot be inferred from prior information by mathematical logic alone." - Carl Hewitt

http://arxiv.org/pdf/0904.3036v25.pdf

@cararemixed
cararemixed / monkey_patch.rb
Created April 19, 2012 20:32
An experimental Celluloid::ActorProxy patch.
module Celluloid
class ActorProxy
private
def def_async(method)
impl = ->(*a, &b) {Actor.async @mailbox, method, *a, &b}
ActorProxy.class_eval {define_method("#{method}!", &impl)}
impl
end
@emboss
emboss / gist:1597215
Created January 11, 2012 22:40
Hashed key as IV vs. KDF
I looked into http://grothoff.org/christian/esed.pdf when I found that
they produce a RIPEMD-160 hash to generate a key from 128 bits and take
the rest for the IV.
You could use a similar approach to generate key and IV where the IV is
independent (somewhat) of the key by using a non-salted key derivation
function that is normally used in Diffie-Hellman-like Key Exchange
protocols. They are used to generate arbitrary-length output from an
initial fixed-size output. (see the KDFs in http://www.di-mgt.com.au/cryptoKDFs.html)
The salt is not needed in our case, since the underlying data (the