Need help with some syntax

65 views
Skip to first unread message

Joe Ayers

unread,
Sep 18, 2020, 3:20:10 PM9/18/20
to age-dev
So I'm trying to decrypt a file that was sent to me using my own private key, the file is called return_message.txt.age. I'm working through the command prompt on windows, and I just can't seem to get it to work. I was wondering if someone could show me what I should write in order to see the message. 


Ben Cox

unread,
Sep 18, 2020, 3:25:07 PM9/18/20
to Joe Ayers, age-dev
Here is an example:

[20:23:11] ben@metropolis:/tmp$ age-keygen | tee privkey
Public key: age12qe2u8x2vgc5kl36rrfysr0q327nx59gftvq7csuhsdcfr0sreaqqpc57s
# created: 2020-09-18T20:23:18+01:00
# public key: age12qe2u8x2vgc5kl36rrfysr0q327nx59gftvq7csuhsdcfr0sreaqqpc57s
AGE-SECRET-KEY-1EYFNGA4KCHJ9CY4N0AK8N88D5VN2MSK3KF6CJREQ9U3YYT388ZPS6J9DJ9

[20:23:30] ben@metropolis:/tmp$ uname | age -r
age12qe2u8x2vgc5kl36rrfysr0q327nx59gftvq7csuhsdcfr0sreaqqpc57s >
out.enc

[20:23:49] ben@metropolis:/tmp$ cat out.enc | age -i privkey -d
Linux

[20:23:54] ben@metropolis:/tmp$

On Fri, Sep 18, 2020 at 8:20 PM Joe Ayers <cezar...@gmail.com> wrote:
>
> So I'm trying to decrypt a file that was sent to me using my own private key, the file is called return_message.txt.age. I'm working through the command prompt on windows, and I just can't seem to get it to work. I was wondering if someone could show me what I should write in order to see the message.
>
>
> --
> You received this message because you are subscribed to the Google Groups "age-dev" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to age-dev+u...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/age-dev/bc017764-1ed0-42ec-a631-753cb6df3c6bn%40googlegroups.com.

Joe Ayers

unread,
Sep 18, 2020, 3:28:33 PM9/18/20
to age-dev
yeah so I have my private key but the problem is that when I try to decrypt, I'll write it as (age --decrypt -o return_message.txt -i 1Z4VGEUZPPSJP9PG2VTGX8TS72UXUTH56F3SJHJG4KSST75LPV40S5UZDUX return_message.txt.age). I've tried it many other ways, but none of them seem to work, so I was wondering if someone could show me what I'm writing wrong. 

Brian Williams

unread,
Sep 18, 2020, 3:35:49 PM9/18/20
to Joe Ayers, age-dev
Age expects -i to be a file name for a file containing the private key, because putting the private key in the command line arguments is insecure (it shows up in bash history, process monitors, endpoint protection systems, etc.).

Put your private key inside a file like `age.key` And then do 
age --decrypt -o return_message.txt -i age.key return_message.txt.age

On Sep 18, 2020, at 2:28 PM, Joe Ayers <cezar...@gmail.com> wrote:

yeah so I have my private key but the problem is that when I try to decrypt, I'll write it as (age --decrypt -o return_message.txt -i 1Z4VGEUZPPSJP9PG2VTGX8TS72UXUTH56F3SJHJG4KSST75LPV40S5UZDUX return_message.txt.age). I've tried it many other ways, but none of them seem to work, so I was wondering if someone could show me what I'm writing wrong. 

Joe Ayers

unread,
Sep 18, 2020, 3:46:10 PM9/18/20
to age-dev

Awesome it worked. Thank you so much!!!!
Reply all
Reply to author
Forward
0 new messages