Skip to content

Instantly share code, notes, and snippets.

Grant Rodgers grantr

Block or report user

Report or block grantr

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@grantr
grantr / curvecp_handshake.rb
Last active Jul 19, 2018
CurveCP handshake protocol in Ruby
View curvecp_handshake.rb
# 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:
#
@tarcieri
tarcieri / semiprivate.rb
Created Feb 9, 2013
Trying to put together a semiprivate key system
View semiprivate.rb
# Experimenting with implementing semiprivate keys with RbNaCl
require 'rbnacl'
require 'hkdf'
module Semiprivate
class WriteKey
def initialize(seed)
if seed.bytesize != 32
raise ArgumentError, "seed must be 32 bytes"
You can’t perform that action at this time.