mishakorzik / AllHackingTools

All-in-One Hacking Tools For Hackers! And more hacking tools! For termux.
GNU General Public License v3.0
3.25k stars 470 forks source link

Insecure password generation #32

Closed murphy60dotcom closed 2 years ago

murphy60dotcom commented 2 years ago

The password generator at src/PassGenerator.sh looks like this.

sleep 0.1
echo 835fU930sgi52fGs
echo 42jdU5BJ62w5283wW
echo 724gIEN62o0wU
echo Yni623nfooa42Gr52H
sleep 0.1
echo Hack724Ge62nfiT28
echo he42I73NdW8IN3J2g
echo jEwbU52nsI8Ns897B2
echo uw42Bwo72KdbW72EqN

This will generate the same passwords for each time so it is not secure.

Consider reading random bytes from /dev/urandom and encoding them in base64, like this:

dd bs=16 count=1 if=/dev/urandom status=none | base64

This will read 16 bytes from /dev/urandom which is cryptographically secure and encode them in base64.

For example, it will output this: 0vWfBcEmH9XU8nALMk8meg==.

mishakorzik commented 2 years ago

Okay