Skip to content

Instantly share code, notes, and snippets.

View arik-so's full-sized avatar

Arik arik-so

View GitHub Profile
@arik-so
arik-so / unifying-frost-and-musig.md
Created March 22, 2023 16:44 — forked from LLFourn/unifing-frost-and-musig.md
Unifying FROST and MuSig

Unifying FROST and MuSig

There might be a secure scheme that non-interactively generates a n-of-n FROST key and from there you can interactively turn it into a t-of-n by issuing new shares (i.e. enrolment). I don't really know if this is a useful contribution even if it works. There might be some utility in not having multiple schemes but rather a one size fits all approach.

Idea

MuSig takes a "multiset" of n public keys and outputs a single aggregated key which takes n-of-n secret keys to sign. Set z_i = H(X_1,.. X_i, .. X_n, X_i) for i = 1,2, .. n.

@arik-so
arik-so / mac-git-gpg-troubleshoot.md
Created February 2, 2023 23:51 — forked from paolocarrasco/README.md
How to understand the `gpg failed to sign the data` problem in git

Problem

You have installed GPG, then tried to commit and suddenly you see this error message after it:

error: gpg failed to sign the data
fatal: failed to write commit object

Debug

@arik-so
arik-so / key.md
Created February 2, 2023 17:02
Twitter (un)official Consumer Key

Twitter Official Consumer Key

Twitter for Android

type:            PIN
Consumer key:    3nVuSoBZnx6U4vzUxf5w
Consumer secret: Bcs59EFbbsdF6Sl9Ng71smgStWEGwXXKSjYvPVt7qys

Twitter for iPhone

type:            PIN

Consumer key: IQKbtAYlXLripLGPWd0HUA

@arik-so
arik-so / secure_crypto_asset_custody.md
Created January 27, 2023 04:23 — forked from lrvick/secure_crypto_asset_custody.md
Secure Crypto Asset Custody Requirements

Secure Crypto-Asset Custody

Summary

This document seeks to outline a broad set of requirements for crypto-asset custodians based on lessons learned from historical failures to understand and remove attack surface.

It will also assume that not everyone has equal resources or equal risk and as such four incrementally harder security levels to that effect, depending on

@arik-so
arik-so / bad_place_notify.py
Created September 4, 2020 21:01 — forked from ekager/bad_place_notify.py
Searches for specified search terms and sends emails if found
"""
This script will search 4chan (need to specify a board unfortunately) and then
search all comments on Reddit for specific keywords. If found, it will then send
an email with the links to any matching posts.
Because 4chan posts are archived after ~48 hours I would recommend setting this up
to run on that cadence as well.
Sender email will need "Allow less secure apps" to ON or similar setting.
I followed these instructions for setting that up:
@arik-so
arik-so / schnorr_signature.js
Last active November 5, 2022 17:48
Schnorr Experimenting
const ecurve = require('ecurve');
let secp256k1 = ecurve.getCurveByName('secp256k1');
const BigInteger = require('bigi');
const crypto = require('crypto');
const calculateHash = (R, P, message) => {
const hashPreimage = Buffer.concat([R.getEncoded(true), P.getEncoded(true), Buffer.from(message, 'utf-8')]);
return BigInteger.fromHex(crypto.createHash('sha256').update(hashPreimage).digest('hex')).mod(secp256k1.n);
};
@arik-so
arik-so / pedersen_commitment.js
Last active November 5, 2022 17:49
Javascript Pedersen Commitment Experiment
const BigInteger = require('bigi');
const _ = require('lodash');
const prova = require('prova-lib');
const crypto = require('crypto');
const ecurve = require('ecurve');
let secp256k1 = ecurve.getCurveByName('secp256k1');
/**
@arik-so
arik-so / ring_signature.js
Last active June 15, 2018 19:25
Javascript Ring Signature Experiment
const BigInteger = require('bigi');
const _ = require('lodash');
const prova = require('prova-lib');
const crypto = require('crypto');
const bitcoin = require('bitgo-utxo-lib');
const ecurve = require('ecurve');
let secp256k1 = ecurve.getCurveByName('secp256k1');
@arik-so
arik-so / think_different.md
Last active October 10, 2022 17:59
MacBook Complaints
  • Bad keyboard (keys either not registering presses, or registering too many. Particularly annoying when it's the command key that is not working, making copy/paste operations difficult)
  • Bad trackpad (phantom mouse movements, unintended scrolling or navigation)
  • Crackling audio
  • Subdued audio (as though underwater)
  • Screen brightness low on unlock (even after disabling auto brightness)
  • Screen desaturated after unlock
  • Plays random loud sound when plugging into power source (audio volume is ZERO)
  • Cursor haphazardly just isn't fucking there, and typing does nothing
  • Unlock screen slow after boot (FileVault is enabled, two accounts)
  • Random crashes after sleep
@arik-so
arik-so / ECCTest.php
Last active December 29, 2015 03:44
PHP Diffie Hellman Implementation
<?php
namespace Tests\ArikCrypto;
use BitcoinPHP\BitcoinECDSA\BitcoinECDSA;
class ECCTest extends \PHPUnit_Framework_TestCase {
public function testDiffieHellman() {