I hereby claim:
- I am junderw on github.
- I am junderwood (https://keybase.io/junderwood) on keybase.
- I have a public key ASDoYhX66stiR0f07xk-EYyEh9z_eQJVYp5ozEJRHLbqpQo
To claim this, I am signing this object:
// Usage: | |
// getByteCount({'MULTISIG-P2SH:2-4':45},{'P2PKH':1}) Means "45 inputs of P2SH Multisig and 1 output of P2PKH" | |
// getByteCount({'P2PKH':1,'MULTISIG-P2SH:2-3':2},{'P2PKH':2}) means "1 P2PKH input and 2 Multisig P2SH (2 of 3) inputs along with 2 P2PKH outputs" | |
function getByteCount(inputs, outputs) { | |
var totalWeight = 0 | |
var hasWitness = false | |
var inputCount = 0 | |
var outputCount = 0 | |
// assumes compressed pubkeys in all cases. | |
var types = { |
async function aesEncrypt(data, password, difficulty = 10) { | |
const hashKey = await grindKey(password, difficulty) | |
const iv = await getIv(password, data) | |
const key = await window.crypto.subtle.importKey( | |
'raw', | |
hashKey, { | |
name: 'AES-GCM', | |
}, | |
false, |
# This is one big command. Fill it out in a text editor and copy-paste | |
# the whole thing to get tls.key and tls.cert files for use with lnd | |
openssl \ | |
req \ | |
-newkey ec:<(openssl ecparam -name prime256v1) \ | |
-nodes `# No password` \ | |
-keyout \ | |
tls.key `# private key filename` \ | |
-x509 \ |
I hereby claim:
To claim this, I am signing this object:
There is an increasing count of applications which use Authy for two-factor authentication. However many users who aren't using Authy, have their own authenticator setup up already and do not wish to use two applications for generating passwords.
Since I use 1Password for all of my password storing/generating needs, I was looking for a solution to use Authy passwords on that. I couldn't find any completely working solutions, however I stumbled upon a gist by Brian Hartvigsen. His post had a neat code with it to generate QR codes for you to use on your favorite authenticator.
His method is to extract the secret keys using Authy's Google Chrome app via Developer Tools. If this was not possible, I guess people would be reverse engineering the Android app or something like that. But when I tried that code, nothing appeared on the screen. My guess is that Brian used the
// Mimics Buffer.from(x, 'hex') logic | |
// Stops on first non-hex string and returns | |
// https://github.com/nodejs/node/blob/v14.18.1/src/string_bytes.cc#L246-L261 | |
Uint8Array.fromHex = function (hexString) { | |
const MAP_HEX = {0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,a:10,b:11,c:12,d:13,e:14,f:15,A:10,B:11,C:12,D:13,E:14,F:15}; | |
const bytes = new this(Math.floor((hexString || "").length / 2)); | |
let finalLen = bytes.length; | |
for (let i = 0; i < finalLen; i++) { | |
const a = MAP_HEX[hexString[i * 2]]; | |
const b = MAP_HEX[hexString[i * 2 + 1]]; |
/* | |
* input: "wpkh([d34db33f/84h/0h/0h]0279be667ef9dcbbac55a06295Ce870b07029Bfcdb2dce28d959f2815b16f81798)" | |
* output: "wpkh([d34db33f/84h/0h/0h]0279be667ef9dcbbac55a06295Ce870b07029Bfcdb2dce28d959f2815b16f81798)#qwlqgth7" | |
* (This has been checked to match bitcoin-core) | |
*/ | |
function descriptorChecksum(desc) { | |
if (!(typeof desc === 'string' || desc instanceof String)) throw new Error('desc must be string') | |
const descParts = desc.match(/^(.*?)(?:#([qpzry9x8gf2tvdw0s3jn54khce6mua7l]{8}))?$/); | |
if (descParts[1] === '') throw new Error('desc string must not be empty') |
class CBOREncoder { | |
private entryCount: number = 0; | |
private data: Uint8Array = Uint8Array.from([]); | |
pushBool(key: string, value: boolean): void { | |
this.entryCount++; | |
this.pushTextInternal(key); | |
this.pushBoolInternal(value); | |
} |
var POW31 = 0x80000000 | |
var MSK31 = 0x7FFFFFFF | |
function checkBitSize(bs) { | |
if (bs > 53 || bs < 1 || Math.floor(bs) !== bs) { | |
throw new Error('Invalid Bit Size') | |
} | |
} | |
function splitBits(val, size) { |
FROM ubuntu:16.04 | |
MAINTAINER Jonathan Underwood | |
# set env vars for linux user and keybase user | |
ENV LINUX_USER="kbuser" \ | |
KEYBASE_USER="youruser" | |
# use curl to grab the latest build from keybase.io | |
RUN apt update && apt install -y \ | |
curl |