Saturday, May 30, 2020
Saturday, April 4, 2020
Stateless Password Managers
An idea I've had for a while is a password generator where you take a master password, an optional per site password, and the site domain name, combine and hash them to get a unique password for any site.
This system has a unique benefit over traditional password managers in that you can't lose your passwords. Even if all your electronics were destroyed and you woke up naked in China tomorrow you could get your passwords just by using an online version of the tool (or failing that, manually doing the steps yourself with a hash generator).
However, the system has a unique drawback of not remembering what the password requirements are. Some sites require special characters, some don't allow them, some require more than 10 characters, some allow for a max of 8. It would be easy to translate your hash into whatever set of requirements you have, but you still need to either remember that, or store it somewhere else.
Today I discovered this idea has been implemented, a lot. It's called a stateless password manager, or a deterministic password manager. Two examples are:
https://masterpassword.app/
https://lesspass.com/#/
And here is an article discussing the flaws in this system:
https://tonyarcieri.com/4-fatal-flaws-in-deterministic-password-managers
This system has a unique benefit over traditional password managers in that you can't lose your passwords. Even if all your electronics were destroyed and you woke up naked in China tomorrow you could get your passwords just by using an online version of the tool (or failing that, manually doing the steps yourself with a hash generator).
However, the system has a unique drawback of not remembering what the password requirements are. Some sites require special characters, some don't allow them, some require more than 10 characters, some allow for a max of 8. It would be easy to translate your hash into whatever set of requirements you have, but you still need to either remember that, or store it somewhere else.
Today I discovered this idea has been implemented, a lot. It's called a stateless password manager, or a deterministic password manager. Two examples are:
https://masterpassword.app/
https://lesspass.com/#/
And here is an article discussing the flaws in this system:
https://tonyarcieri.com/4-fatal-flaws-in-deterministic-password-managers
Labels:
Links,
Stuff I Wrote
Tuesday, March 24, 2020
Social Distancing Scoreboard
According to the World Health Organization and the CDC, social distancing is currently the most effective way to slow the spread of COVID-19. We created this interactive Scoreboard, updated daily, to empower organizations to measure and understand the efficacy of social distancing initiatives at the local level.
https://www.unacast.com/covid19/social-distancing-scoreboard
Labels:
Links
Sunday, March 15, 2020
How do laser distance measures work?
I recently bought a laser tape measure; it's pretty great. One button to turn it on, then it gives you instant distance measurements to wherever you point the laser. There are more expensive ones that do further distances, but the one I got was $30 and goes up to 65 feet. I compared it to a normal tape measure and it was accurate and repeatable to an eighth of an inch. I was pretty impressed with it, and it was a great toy to add to my collection of measuring devices.
However, I began to wonder how it worked, especially since it worked so well, and was so cheap.
However, the devil is in the details, and getting that time precise enough to measure an 1/8th of an inch is going to be hard.
An 1/8th of an inch is 3.175 mm. The speed of light is 299,792,458 m/s. Or 299,792,458,000 mm/s. 3.175 mm / 299,792,458,000 mm/s = 1.059066002254133e-11 seconds. Which is about 10.59 picoseconds. Take the inverse of that and it's 94.42 Gigahertz. I'm going to go out on a limb and assume that the $30 laser tape measure I have in my pocket doesn't have a 100 GHz clock inside of it.
Here's an example
Where the top red line is the original signal, and the second blue line is the reflected version. Then the third green line is the XORed delta of the two.
When you measure something slightly further away the reflected wave gets more delayed and the delta version gets a longer pulse.
All you end up with is a slightly offset delta signal.
Now, all you have to do is measure the charge in the capacitor and turn that into a measurement you display. Let's review what we need:
However, I began to wonder how it worked, especially since it worked so well, and was so cheap.
How laser distance measures don't work
In principle it would be simple. Light has a very well known speed, so all you have to do is measure how long it takes for the light to go out and reflect back. Distance = speed x time. You could encode a binary number in the laser, just a counter incrementing and resetting when it runs out of numbers. Measure what number is being reflected back and how long ago you sent that number out and you know how long it took to come back.However, the devil is in the details, and getting that time precise enough to measure an 1/8th of an inch is going to be hard.
An 1/8th of an inch is 3.175 mm. The speed of light is 299,792,458 m/s. Or 299,792,458,000 mm/s. 3.175 mm / 299,792,458,000 mm/s = 1.059066002254133e-11 seconds. Which is about 10.59 picoseconds. Take the inverse of that and it's 94.42 Gigahertz. I'm going to go out on a limb and assume that the $30 laser tape measure I have in my pocket doesn't have a 100 GHz clock inside of it.
How do they actually work?
Instead of transmitting a counter, just send an alternating pulse. It doesn't have to be very fast, a MHz would be enough. Then your reflected pulse is the same wave, but delayed slightly. You only care about measuring the difference in time of the leading and falling edges of the two waves, or delta. This means you can just compare the two waves using an XOR gate, which is just a fancy way of saying "tell me whenever these waves are different".Here's an example
Where the top red line is the original signal, and the second blue line is the reflected version. Then the third green line is the XORed delta of the two.
When you measure something slightly further away the reflected wave gets more delayed and the delta version gets a longer pulse.
Are logic gates fast enough?
Logic gates like these are cheaper and faster than the circuitry you'd need for a timer. However, they still aren't quite fast enough for the precision we see in these tools. Luckily though, a delay doesn't really impact the measurement. As long as it's a consistent delay on both the rising and falling edges of the two waves.All you end up with is a slightly offset delta signal.
Who will measure the measurer?
It might seem like we're back to square one here, with the need to precisely measure the time of that pulse, but we actually just need take the average of that signal. There are a variety of ways we can do this, but as a proof of concept, imagine the delta signal is charging a capacitor, which is simultaneously being drained by a constant resistor. You'd end up with a level of charge in the capacitor which would translate into what percentage of time the delta single is high.Now, all you have to do is measure the charge in the capacitor and turn that into a measurement you display. Let's review what we need:
- Laser transmitter and optical sensor.
- MHz clock to turn laser on and off.
- XOR circuit to compare the two transmitted and received signals.
- A capacitor and resistor circuit to find average of the digital signal.
- A way to measure the charge in the capacitor.
- Something to take that measurement and convert it into the distance.
- A display.
Labels:
Stuff I Wrote
Saturday, February 29, 2020
Guessing Smart Phone PINs by Monitoring the Accelerometer
https://www.schneier.com/blog/archives/2013/02/guessing_smart.html
In controlled settings, our prediction model can on average classify the PIN entered 43% of the time and pattern 73% of the time within 5 attempts when selecting from a test set of 50 PINs and 50 patterns. In uncontrolled settings, while users are walking, our model can still classify 20% of the PINs and 40% of the patterns within 5 attempts.
Labels:
Links
Friday, January 31, 2020
Tuesday, December 31, 2019
Predictions for the decade, from 2010
https://news.ycombinator.com/item?id=1025681
This is a good look back at what people thought the 2010s would bring at the start of them.
This is a good look back at what people thought the 2010s would bring at the start of them.
Labels:
Links
Saturday, November 30, 2019
Wednesday, October 30, 2019
A comparision of AWS S3 Glacier Deep Archive region pricing
2024 update: I've written a quick script that scrapes the current AWS S3 pricing.
Using their tool: https://aws.amazon.com/s3/pricing/
If you're considering this keep in mind there are some important caveats. First you pay for each request, which means if you're storing 1,000,000 files you will pay $50 just for the requests. Doesn't matter if each file is 1 MB, or 1 KB, or even 1 byte each, it's $0.50 per 1000 PUT requests. You will then also pay storage fees every month on top of that. As far as I can tell, you don't pay for the bandwidth to upload the files.
Retrieving the files has more caveats. First you need to pick a speed, standard or bulk. Standard takes up to 12 hours, and bulk is up to 48 hours. Standard also costs about 10x as much as bulk. And here you pay for the individual requests, the data retrieved, and (I believe) bandwidth to download from S3.
So if you're storing many smallish files (documents) you're probably much better off combing them all into a single zip file, to reduce the number of requests you have to do. On the other hand if you're storing large files (videos), you'd probably be better off leaving them on their own so that ideally you just need to recover one or two, and then don't have to pay for the bandwidth to download them all.
I made this table to compare some scenarios. The first 3 rows shows the costs to retrieve 1 TB split across either 1, 1024, or1048576 file. The less file scenarios are cheaper, but not by a ton, and keep in mind if you only needed a few of those files it'd be much cheaper to just grab those individual files if they weren't zipped together.
The bottom 2 rows shows the cost to get 1 GB of files, either as 1 file or 1024 files. Here the cost is negligible, pretty much however you store and access it.
So it seems in any case the bandwidth is the biggest cost. Still, since you generally only pay for bandwidth out of S3 and not in to it, you should never really have to pay this, unless you're recovering from a pretty major disaster. There is also the option to use AWS Snowball, where they will mail you a physical drive which you keep for up to 10 days then mail back. That works out to be $200 + $0.03 per GB vs just $0.09 per GB for bandwidth. So you need to be transferring 10s of TBs before it makes sense.
Labels:
Stuff I Wrote
Sunday, September 29, 2019
Subscribe to:
Posts (Atom)







