0 Replies - 705 Views - Last Post: 29 September 2020 - 08:08 PM Rate Topic: -----

#1 Cookie Mobster   User is offline

  • nooneenooneenooonee
  • member icon

Reputation: 8
  • View blog
  • Posts: 4,737
  • Joined: 12-October 01

Random URL creation question.

Posted 29 September 2020 - 08:08 PM

Just have a quick question about generating some random strings to use as url for a lookup table to redirect to a page.

Suppose I am making a random URL with 6 bytes of length. (basically token_urlsafe from the secrets module)
def make_url():
   return urandom(6).hex()

would it be the same level of security if I made two 3 byte length urls and passed them as two variables?
def make_url():
   return urandom(3).hex() +b"/"+ urandom(3).hex()

Does anyone know the math on this, is the difficultly in guessing the random url the same or does one method offer more or less protection from intrusion.

This post has been edited by Cookie Mobster: 29 September 2020 - 08:26 PM

Is This A Good Question/Topic? 0
  • +

Page 1 of 1