secure jwt
This commit is contained in:
14
secure_bytes.sh
Normal file
14
secure_bytes.sh
Normal file
@@ -0,0 +1,14 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Define the number of bytes you want to generate
|
||||
num_bytes=16
|
||||
|
||||
# Use dd to read cryptographically secure bytes from /dev/urandom
|
||||
# and convert them to integers using od
|
||||
secure_bytes=$(dd if=/dev/urandom bs=1 count=$num_bytes 2>/dev/null | od -An -tu1)
|
||||
|
||||
# Remove leading/trailing spaces and replace spaces with commas
|
||||
secure_bytes=$(echo $secure_bytes | sed 's/ /,/g')
|
||||
|
||||
# Output the result as a comma-separated list of integers
|
||||
echo "Cryptographically secure bytes (as integers): $secure_bytes"
|
||||
Reference in New Issue
Block a user