Skip to content

Instantly share code, notes, and snippets.

🔢
crypto

David Wong mimoo

🔢
crypto
View GitHub Profile
View gist:2878889192e54f9650215414470e98a8
  • process_local_timeout(round: Round)
    • if round_state.round does not match round, return
    • (if the timer is an interval timer, we do not need this step)
    • if round_state.vote_sent is empty, this is the first timeout this round (we haven't already voted for a timeout):
      • create a NIL block by calling nil_block = proposal_generator.generate_nil_block(round)
      • execute and store the block by calling executed_block = block_store.execute_and_insert_block(nil_block)
      • obtain a signed vote by calling safety_rules.vote(executed_block)
      • store the vote in round_state.vote_sent
    • if round_state.vote has an empty timeout_signature:
      • create a timeout payload with the current epoch and round:
@mimoo
mimoo / broadcast.md
Last active Jun 6, 2020
broadcast protocols
View broadcast.md

Broadcast Protocols

Abstract

  • broadcast protocols are about sending a request to enough peers, and the peers successfuly receiving it

  • there are different types of broadcasts protocols, and byzantine broadcast protocols work in the presence of adversaries

  • an atomic broadcast is what people refer to as a consensus protocol

  • byzantine broadcast protocols

    • the sender can be byzantine
@mimoo
mimoo / sas.md
Last active May 31, 2020
Short Authenticated Strings
View sas.md

Abstract

cross-authentication protocols using short authenticated strings:

  • pretty much an unauthenticated key exchange between two devices
  • followed by comparing a short value (6 digits usually) displayed by the devices to authenticate the transcript/output of the key exchange
  • this short value is public, but cannot be tampered with

Attacker Model

View how_to_cook.md

1. learn your ingredients

To cook great food, you need to know what are the different spices at your disposition, the different types of herbs, roots, mushrooms, and sauces. All of that.

example: how boring would cooking be if coconut milk didn't exist? or choriander? or fish sauce? etc.

Not only this: you must understand how they taste, how they taste on their own, how they taste when mixed with others, and how they taste raw, once heated, boiled, grilled, etc.

@mimoo
mimoo / patents.md
Last active Apr 8, 2020
patents in crypto
View patents.md

Infamous patents in cryptography

  • 1976-1977 - Diffie-Hellman - the patent was filled more than a year after the idea was circulated/published, thus was invalid. The invalid patent expired in 1997.
  • 1991 - Schnorr signatures - Schnorr is obviously the best signature scheme we have, yet the NIST went ahead and standardized the sub-primitives DSA and ECDSA to circumvent Schnorr's patents (Schnorr was not happy 1, 2). In 2008 the patents expired and EdDSA and other schnorr-based signatures started flourishing again.
  • 1996 - NTRU - The algorithm was placed in the public domain in 2017.

    A note on patents. One reason that NTRU is not more widely deployed is that there have been patents restricting its usage fo

View user-machine-auth.md

User <-> Machine Authentication

Solutions

  • PKI
  • PAKE
  • SAS

SAS

@mimoo
mimoo / evcxr_jupyter_tour.ipynb
Created Jan 5, 2020
evcxr_jupyter_tour.ipynb
View evcxr_jupyter_tour.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View LBFT.html
<!DOCTYPE html>
<html>
<head>
<meta charset='utf-8'>
<title>LibraBFT Specification</title>
<script src='https://www.w3.org/Tools/respec/respec-w3c-common' class='remove'></script>
<script class='remove'>
async function loadRust() {
//this is the function you call in 'preProcess', to load the highlighter
@mimoo
mimoo / hljs-proto.js
Last active Dec 5, 2019
HLJS browser shims for different languages (to be used with gitraw)
View hljs-proto.js
/*
Language: Protocol Buffers
Author: Dan Tao <daniel.tao@gmail.com>
Description: Protocol buffer message definition format
Website: https://developers.google.com/protocol-buffers/docs/proto3
Category: protocols
*/
var module = module ? module : {}; // shim for browser use
@mimoo
mimoo / e2e.md
Last active Jan 2, 2020
End-to-end encryption
View e2e.md

End-to-End encryption

Timeline

  • 1981 - RFC 788 - Simple Mail Transfer Protocol (SMTP) is published, the standard for email is born.
  • 1991 - The US government introduces the 1991 Senate Bill 266, which attempts to allow "the Government to obtain the plain text contents of voice, data, and other communications when appropriately authorized by law" from "providers of electronic communications services and manufacturers of electronic communications service equipment". The bill fails to pass into law.
  • 1991 - Pretty Good Privacy (PGP) - released by Phil Zimmermann.
  • 1993 - The US Government launches a criminal investigation against Phil Zimmermann for sharing a cryptographic tool to the world (at the time crypto exporting laws are a thing).
  • 1995 - Zimmermann publishes PGP's source code in a book via MIT Press, dodging the criminal investigation by using the first ammendment's protection of books.
  • 1995 - The RSA Data Security company proposes S/MIME as an
You can’t perform that action at this time.