News for hackers. Stuff that matters.
Re:Show HN: Django Secret Key Generator by bwackwat on Tuesday August 09, 2016 @12:58PM (#12255982)
>import os

>os.urandom(24)

'\x17\x96e\x94]\xa0\xb8\x1e\x8b\xee\xdd\xe9\x91^\x9c\xda\x94\t\xe8S\xa1Oe_'

>os.urandom(24).encode('hex')

'cd48e1c22de0961d5d1bfb14f8a66e006cfb1cfbf3f0c0f3'

Re:Show HN: Django Secret Key Generator by StavrosK on Tuesday August 09, 2016 @01:27PM (#12256208)
Why limit your entropy like that? I just use pwgen:

> pwgen -s 64 1 | xsel -b

aepei5hooNu2Zaic6EQueeCiish7eighaibahwaejohchaizo0zei0eiwongaeza

Re:Show HN: Django Secret Key Generator by bwackwat on Tuesday August 09, 2016 @01:35PM (#12256276)
I was stickin' to Python :)

That's a cool alternative though, thanks.

Re:Show HN: Django Secret Key Generator by StavrosK on Tuesday August 09, 2016 @03:21PM (#12257102)
Ah, that's valid, but at least base64 encode the password (for more entropy per character). It doesn't really matter anyway, if you're using a long secret (and nothing stops you, since it's not like you need to remember it).
Re:Show HN: Django Secret Key Generator by avian on Tuesday August 09, 2016 @02:04PM (#12256528)
Why limit your entropy? Use "pwgen -s".
Re:Show HN: Django Secret Key Generator by StavrosK on Tuesday August 09, 2016 @03:20PM (#12257097)
Good tip, thanks. What's the difference between with and without -s?