Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UX: Rage does not encrypt data piped in from stdin when using -p/--passphrase #374

Open
matthewmummert5 opened this issue Mar 20, 2023 · 1 comment

Comments

@matthewmummert5
Copy link

matthewmummert5 commented Mar 20, 2023

What were you trying to do

Encrypt data piped in from stdin using a passphrase.

What happened

It refused to encrypt data piped in from stdin using a passphrase. This works just fine with age, but not rage. rage will also decrypt data piped in from stdin just fine, but not encrypt.

$ echo "Attack at dawn!" | rage --armor --passphrase
Error: File to encrypt must be passed as an argument when using -p/--passphrase

[ Did rage not do what you expected? Could an error be more useful? ]
[ Tell us: https://str4d.xyz/rage/report                            ]

This same thing works with age, and rage has no problem decrypting data from stdin.

$ echo "Attack at dawn!" | age --armor --passphrase | rage -d
Attack at dawn!

@matthewmummert5
Copy link
Author

matthewmummert5 commented Mar 21, 2023

Upon further investigation, it appears that rage requires you to specify - as the filename if you want to encrypt data piped in from stdin with a passphrase, like this:

$ rage-keygen | rage --armor --passphrase -
Public key: age16ju2609mvqchrucn5qnsndrtwshveyhfuc4zn5xfvycjazpw0gmsd68gue
-----BEGIN AGE ENCRYPTED FILE-----
YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IHNjcnlwdCBrM0I2azU4YlpNaGVVS29n
SThZL2dRIDE5CjlJc1BvcTRBaG04elphbEh0T3FXWXVsUFZRaWdJRGg5d2Zxa0ox
WFpoa2MKLS0tIGJXRWVQaEdpOXRzSUpFK3pIMS9DQnhBVEdkK083NlNYQmhWNlVI
U3M0QjgKqC9MIDQS+XouvauCbNjx6I73D2YljpP2SJUK4QduGx1VUKOqTPLFA4WO
XBVoZ9T5l+t8NEA5IVT+aw2crDHowJGe4oANYsA6+cSWxRfaJhxG902bFSeOyjUa
s88wPNmwYBjnh0dz0MG8O/UCErI+J1Zx1PuShDmo/6UB7G//wck3v9E1XtXmlFl+
d1EVx6g86XSLGi/HAovihwHBNpEL/y7uShw+di67jFfirV3ejmanEkpe4vb4AhvA
DG4vvVnD25k1RTETr8+17W8ifX+4G0Vo+qclNpi53D8Hbpc=
-----END AGE ENCRYPTED FILE-----

This is inconsistent with the go implementation. This is also inconsistent with rage in the case of using public-key encryption. But at least there's a workaround. Is this the desired behavior?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant