4 ms·
Looks nice – but it is not 'private'. Using only 6 characters as a 'private' URL is too small. How long does it take to have a bot that can make 1000 requests
by briantmaurer 11y ago
Looks nice – but it is not 'private'.
Using only 6 characters as a 'private' URL is too small. How long does it take to have a bot that can make 1000 requests per second to download every single URL in your URL space?
((alphabet_size^number_url_characters)/(request_speed))/secs/mins/hrs = time_in_days
((26^6)/(1000))/60/60/24 = 3.6 days
Reading every single paste in 3.6 days is not private.
You want to reduce the probability of a single URL guess colliding with an existing 'private' URL so that it would take years for a bot to have a decent chance of finding a URL that is already in use.
Read up on the probability of hashing collisions and how fast bots can make requests. Make sure it takes a long time to make enough guesses to have a chance at collision.
If you don't want to do math, just use as many characters as an established company that already has 'private URL sharing'. ex Dropbox, I think they use ~40 case-sensitive-alphanumeric-characters or something.
- StavrosK 11y agoI'll just ratelimit it to two requests per second, thanks.
- anilgulecha 11y agoSo only those with access to a botnet can do this in a shorter time than 3.6 days? The right fix would be to increase the length of your key.
- StavrosK 11y ago"Right" by what metric? Short keys are easier to type, so it would be the wrong fix, in that respect.
- Nadya 11y agoDoing what giphycat does would make it better, with a large enough dictionary of adjectives/colors/animals. Then you get URL's with easy-to-remember names like "TyrannicLavendarOrangutan" And "right" as in your solution doesn't solve the problem. It just limits it to "people with botnets".