Skip to content

Instantly share code, notes, and snippets.

🎯
Focusing

David Wong mimoo

🎯
Focusing
Block or report user

Report or block mimoo

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
@mimoo
mimoo / restaurants.md
Last active Jul 5, 2019
San Francisco
View restaurants.md

Chinese

  • ChongQingXiaoMian. Order all of this: beef in picked mustard green noodles soup, wonton with spicy oil, lamb skewer, braised beef with rice

  • Spicy King. Pretty much like ChongQingXiaoMian (same menu I think)

  • The House of Pancake. Get a bit of everything (pancake, skewers, noodles, etc.)

  • Mr Szechuan. Get food, and get their dark sugar iced milk drink with boba and egg pudding.

  • Z&Y. Solid sichuan food for big groups.

  • Dumpling Time. (fusion)

View BFTree.py
# Receive the candidate block info from the block producer
block_info_candidate = receive_from_block_producer()
(block_hash, prior_block_depth, proposed_current_block_depth) = block_info_candidate
# Verify the block info candidate using HotStuff and chain rules.
if verify_block(block_info_candidate, ...):
block_info = block_info_candidate
else:
block_info = (None, current_block_depth)
@mimoo
mimoo / todo.md
Created Jun 3, 2019
San Francisco
View todo.md

San Francisco

Restaurants

Chinese

  • the pancake house
  • Z & Y
  • chongqingxiaomian
  • dumpling time
@mimoo
mimoo / ECC.md
Last active Jun 3, 2019
Elliptic Curve Cryptography
View ECC.md

Elliptic Curve Cryptography (ECC)

Abstract

ECC is about a group created via:

  • a 2-dimension elliptic curve: an equation with unknowns x and y
    • every Elliptic Curve follows this formula: y2 + a1 x y + a3 y = x3 + a2 x2 + a4 x + a6 (for some specified a1, a2, a3, a4, a6)
    • actually, it can be shorten to this y2 = x3 + a x + b (short weierstrass form) in practice because the characteristic (order of a prime field) 2 and 3 points in prime fields (except for binary (GF(2x)) and GF(3x) curves)
    • a curve of characteristic 2 (defined over GF(2x)) can be simplified to y2 + xy = x3 + ax2 + b
@mimoo
mimoo / MAC.md
Last active May 8, 2019
history of mac
View MAC.md

Message Authentication Codes

  • why is it called MAC?

MACs seems to be used for:

  • authentication and integrity
  • randomness, if used as a PRF (not all MACs are PRFs, HMAC is)
  • key derivation, if used as a PRF in a KDF (HKDF)
@mimoo
mimoo / post_quantum_crypto.md
Last active Apr 3, 2019
Quantum Computers and Cryptography
View post_quantum_crypto.md

I estimate the chance of a practical ECC-breaking quantum computer to be low, e.g. 2^(-10)

Dan Brown

I do not view the threat as particular urgent (i.e. 10+ years away, if ever)

Tony Arcieri

@mimoo
mimoo / disk_encryption.md
Last active Mar 9, 2019
Disk Encryption: Tweakable Wide-block ciphers
View disk_encryption.md

Introduction

This is useful for disk encryption. We need:

  • wide blocks, because we can't store an authentication tag
  • tweakable, because we can't store a nonce

But why can't we transform the metadata into a nonce? Maybe that's what tweak is (or can be).

It looks like:

@mimoo
mimoo / tweak.md
Last active Mar 9, 2019
Tweakable block ciphers
View tweak.md

Introduction

tweaks seems to be the password hashing salts of tweakable block ciphers:

  • it can be public
  • it randomizes the encryption even more
  • it's cheap.

Timeline

@mimoo
mimoo / fpe.md
Last active Mar 9, 2019
History of Format-Preserving Encryption
View fpe.md

Introduction

Format Preserving Encryption (FPE) seems to have been invented principally to encrypt credit card numbers into something that looks like a credit card number. Effectively, FPE is a permutation over the domain of the input.

It seems like the main reason is legacy: a lot of databases where created with size and alphabet restrictions on the field of credit card numbers, other systems and applications were probably built to deal with similar restrictions in order to process or transport these credit card numbers. Since it was deemed (I'm guessing) too costly to improve things so that a ciphertext, an IV and an authentication tag could have been stored in there instead; instead rich banks threw money at the problem and cryptographers took the bait.

It seems like there are three ways to do it:

  • Prefix. Your input domain is very small: write the permutation yourself (01 => 10, 00 => 11, etc.). If you don't have imagination, use AES to encrypt your input domain, and truncate. Hopefully it crea
@mimoo
mimoo / siv.md
Last active Mar 8, 2019
History of SIV mode
View siv.md

Introduction

Here is an history of the Synthetic IV mode of operation which has been two things:

  • a key-wrapper algorithm: that was the main motivation. The point of a key wrapping algorithm is that you do not need to "randomize" the encryption with a nonce (since the key is already random), but you do want to keep the authentication of AEADs.
  • an authenticated cipher that is nonce-misuse resistant: if you use AES-GCM with the same (key, nonce) pair twice, an attacker can then steal the authentication key (and probably forge messages). Using the same (key,nonce) pair twice with SIV only renders the encryption deterministic (so an attacker will notice if a plaintext is encrypted twice).

There has been many versions of SIV, the most promising is the one being standardized by Google and named AES-GCM-SIV.

Timeline

You can’t perform that action at this time.