FiloSottile / age

A simple, modern and secure encryption tool (and Go library) with small explicit keys, no config options, and UNIX-style composability.
https://age-encryption.org
BSD 3-Clause "New" or "Revised" License
15.95k stars 482 forks source link

age-keygen -y generates spurious warning when redirecting stdout to a file #267

Closed ryancdotorg closed 3 years ago

ryancdotorg commented 3 years ago

Environment

What were you trying to do

Create public key file

What happened

rc@pxl:~/code/age$ ls -al ~/.age.key 
-r-------- 1 ryanc ryanc 189 May 18 11:25 /home/ryanc/.agekey
rc@pxl:~/code/age$ age-keygen -y ~/.age.key > ~/age.pub
Warning: writing secret key to a world-readable file.

I'm not writing a secret key here.

If I instead remove ~/age.pub and run age-keygen -y -o ~/age.pub ~/.age.key I do not get the warning.

FiloSottile commented 3 years ago

Ah, good catch, thank you!