npm update all dependencies to their latest version

Here’s a little one-liner I came up with that I had a hard time googling for:

$  npm outdated | tail -n +2 | awk '{print $1}' | xargs -I % sh -c 'npm i %@latest --save-exact'

It will simply update each outdated dependency to their latest version, I recommend using --save-exact but that’s optional.

Nothing too fancy but hopefully it saves me a headache later when I have to search for it again!

Shamir’s Secret Sharing

I made a little website that allows you to encrypt and decrypt shared secrets using Shamir’s Secret Sharing algorithm:

https://bewmdone.com/encrypt

It was just a fun little project that I decided to do, nothing ground breaking. I used an existing library on npm (shamir) for the encryption and decryption, the rest was just hooking it up to a UI and getting some technical details around static sites and AWS hosting worked out.

One interesting thing I learned while implementing this is that while you only need a quorum of keys to decrypt the secret you also need them to be put into the correct index in the input. Which makes sense when you think about how the algorithm works, but I didn’t immediately realize this.

Full source code for the site is available here: https://github.com/justinmchase/bewmdone.com

I’ve been thinking about what happens to my data and accounts if I were to die suddenly. I’m not planning on that happening any time soon but you never know. I’d like to think that my wife and kid(s) could theoretically have the information they need to recover my accounts and get access to my data if I were to pass away but I’m not real thrilled with the available options I’ve come up with so far.

I don’t really want to give any one source all of the keys to the castle for example. I don’t know how practical or cost effective it is to be putting everything down on paper and storing it in a safety deposit box either. On the other hand, with this method I could give various friends and family members all their own keys, which by themselves are not enough to see the secrets, and then ask them to send the parts they have to my wife upon unexpected death.

It might make an interesting business model if there was a service that generated the shared keys and kept one key but refused to release the key except upon receipt of a death certificate. Then that service could generate key trios for you and whoever you want to grant access to and neither party can individually see your secrets until the death event and they come together to unlock it…

A little morbid, I know! But an interesting subject.