vendredi 3 novembre 2023

How can I use openssl rand to generate more than 2GiB of data?

Can I use the "openssl rand" command to generate more than 2GiB of data?

openssl rand 2147483647 | pv > /dev/null 
2.00GiB 0:00:01 [1.45GiB/s] [        <=> 
openssl rand 2147483648
rand: Value "2147483648" outside integer range
rand: Use -help for summary.

The limit of 2GiB seems to be arbitrary.

Thank you!

PS: I'm using this command

openssl enc -e -chacha20 -k $(pwgen -ync 40 1) -pbkdf2 -in /dev/zero | openssl enc -e -aes-256-ctr -k $(pwgen -ync 40 1) -pbkdf2 | pv > /dev/null

to generate an endless stream of random data. It's useful for example to prepare the hard-drive for the encryption.




Aucun commentaire:

Enregistrer un commentaire