1

I came across a post about generating random passwords.

Apparently the preferred way is

date | md5sum

I am aware that using the date for this is bad, but how bad is it?

How does it fare when compared to (what seems to me) a more reasonable one:

< /dev/urandom tr -dc _A-Z-a-z-0-9 | head -c32
4
  • I know that entropy-wise this isn't very different from using the actual date. But I would appreciate concrete answers from experts in the area. Commented Nov 29, 2018 at 18:00
  • You could do date +%s%N to get nanosecond resolution, but it'd still be bad...
    – forest
    Commented Nov 30, 2018 at 4:59
  • Related: crypto.stackexchange.com/q/18207/1343 Commented Nov 30, 2018 at 11:51
  • 1
    Further thoughts: Hashing the date can be considered a kind of key stretching, it's just that it is a particularly weak key stretching strategy and the initial "key" being stretched is very predictable. Commented Nov 30, 2018 at 12:14

2 Answers 2

11

Let's assume I know the day or week you created your password, but not the exact time. This assumption seems reasonable:

  • Many online services display account creation dates
  • Many online services publicly recommend changing passwords due to breaches (I can guess that you changed your password within a week of the service's last publicly disclosed breach)
  • Many people change passwords "just to be safe" if something fishy happens, send a spoofed email to the victim and there's a decent chance you'll get lucky
  • In the event of a database leak, many services store the date of last password change (for example to enforce the (now obsolete) 3 month password change type of requirement)

You're password from urandom has log2(6432) = 192 bits of entropy. As passwords go, this is excellent.

If we assume I know the day you generated your date | md5 password, you have log2(60*60*24) ≈ 16.4 bits of entropy (86,400 possible passwords); this is very bad. Even with unusually strong Argon2 parameters that require 1 second per attempt, it would only take 1 day (at most) to crack, and an MD5 hash could be cracked almost instantly. In the event of an online attack rate limiting may help, but I certainly wouldn't rely on it (the attacker could use many IPs and spread out guesses over several weeks).

If I only know what week you generated the password it's only 7 times better, which is still nearly instantaneous when cracking an MD5 hash.

2

If an adversary knows the date value (or close to it) when you made your password then he can trivially reproduce the password. Seems bad.

5
  • haha @ downvoter :)
    – DarkMatter
    Commented Nov 29, 2018 at 19:16
  • This does not provide an answer to the question. To critique or request clarification from an author, leave a comment below their post. - From Review
    – Vilican
    Commented Nov 29, 2018 at 21:10
  • @Vilican It does provide the answer...with a dose of humor. Is that really against our policy on this SE?
    – DarkMatter
    Commented Nov 29, 2018 at 21:13
  • basically, for me, your "dose of humour" makes (at least for me) the answer only harder to understand and also it lacks any important technical information.
    – Vilican
    Commented Nov 29, 2018 at 21:25
  • 1
    @Vilican Okay, I edited it for clarity. Better?
    – DarkMatter
    Commented Nov 29, 2018 at 21:29

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .