Generate public/private key for bitcoin with openssl I want to understand how bitcoin works and I do not trust tools or bitcoin platforms.
I have read this on Internet. Can you confirm me this lines are generating a bitcoin public/private key safely ?
openssl ecparam -genkey -name secp256k1 -rand /dev/urandom -out tmp_private.txt
openssl ec -in tmp_private.txt -outform DER \
    | tail -c +8 | head -c 32 | xxd -p -c 32 &gt; private.txt
openssl ec -in tmp_private.txt -pubout -outform DER \
    | tail -c 65 | xxd -p -c 65 &gt; public.txt
rm tmp_private.txt

I know it is not a good thing to store private key in a basic clear text file, I just want to know if the way generating the key is good.
Is there an openssl command which can generate a bitcoin address from public.txt file?
Yes, it's randomness is trustworthy, so it's safe.

The only problem I see is that "rm" does not remove all of its traces from the hard drive. The private key may be recovered. The pedantic way to erase such secrets is to use the Gutmann method which overwrites files 35 times.

To derive the address you need to use something like https://bitcoin.stackexchange.com/a/67093