Comments on: 4 Ways to Generate a Strong Pre-Shared Key (PSK) in Linux https://www.tecmint.com/generate-pre-shared-key-in-linux/ Tecmint - Linux Howtos, Tutorials, Guides, News, Tips and Tricks. Thu, 13 Jul 2023 08:32:21 +0000 hourly 1 By: Ravi Saive https://www.tecmint.com/generate-pre-shared-key-in-linux/comment-page-1/#comment-1479424 Thu, 22 Apr 2021 06:07:05 +0000 https://www.tecmint.com/?p=36122#comment-1479424 In reply to Carlo Capocasa.

@Carlo,

Thanks for the tip, hope these commands helpful to our readers…

]]>
By: Carlo Capocasa https://www.tecmint.com/generate-pre-shared-key-in-linux/comment-page-1/#comment-1479288 Wed, 21 Apr 2021 20:33:32 +0000 https://www.tecmint.com/?p=36122#comment-1479288 My favorite, because you can choose which characters are used:

< /dev/urandom tr -dc a-zA-Z0-9 | head -c64

This will create a 64 character alphanumeric PSK.

Replace a-zA-Z0-9 with another list of characters and ranges to control which characters occur, and replace 64 with another number to control length.

e.g.

8 lower-case letters

< /dev/urandom tr -dc a-z | head -c8

16 handwriting-unambiguous alphanumeric characters

< /dev/urandom tr -dc a-jmnoqrtyA-HJLMNQRTY2-9 | head -c16

64 alphanumeric characters and all non-space printable ascii symbols (\ escapes the ! for the shell)

< /dev/urandom tr -dc \!-~ | head -c64

64 URL-safe characters (\ escapes the ()'!*; for the shell)

< /dev/urandom tr -dc a-zA-Z0-9-._~\(\)\'\!\*:@,\; | head -c64
]]>
By: Daniel Stiner https://www.tecmint.com/generate-pre-shared-key-in-linux/comment-page-1/#comment-1398831 Mon, 07 Dec 2020 02:29:25 +0000 https://www.tecmint.com/?p=36122#comment-1398831 Note that using “date” to generate keys is *not* secure.

date prints strings like “Sun Dec 6 18:05:53 PST 2020”. Since this string changes once per second, in any given day there are only 86,400 potential keys. This is a tiny number of keys that is easy for an attacker to brute force. In comparison “openssl rand -base64 32” has 256^32 potential keys, a vastly larger number that is difficult to brute force (115,792,089,237,316,195,423,570,985,008,687,907,853,269,984,665,640,564,039,457,584,007,913,129,639,936)

]]>
By: Ravi Saive https://www.tecmint.com/generate-pre-shared-key-in-linux/comment-page-1/#comment-1344226 Mon, 13 Jul 2020 04:53:54 +0000 https://www.tecmint.com/?p=36122#comment-1344226 In reply to Nooby.

@Nooby,

Thanks, corrected the command in the article.

]]>
By: Nooby https://www.tecmint.com/generate-pre-shared-key-in-linux/comment-page-1/#comment-1344105 Sun, 12 Jul 2020 16:28:04 +0000 https://www.tecmint.com/?p=36122#comment-1344105 “4. Using date and sha245sum Commands”
should read:
“4. Using date and sha256sum Commands”

It’s confusing enough without hurting the noob’s brain even more! ;-)

Thank-you.

]]>