FiloSottile / age

A simple, modern and secure encryption tool (and Go library) with small explicit keys, no config options, and UNIX-style composability.

Home Page:https://age-encryption.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

ryancdotorg opened this issue · comments

Environment

  • OS: Debian 10.9
  • age version: (devel) - 2021-05-18

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.

Ah, good catch, thank you!