nats-io / natscli

The NATS Command Line Interface
Apache License 2.0
472 stars 96 forks source link

adds xkey seal/open functionality to commandline #1031

Closed jordan-rash closed 4 months ago

jordan-rash commented 5 months ago

Adds the helper command to NATS cli to allow encryptions/decryption via xkeys.

└─❯ cat message.txt
hello

└─❯ go run . auth nkey seal message.txt ./my.key XBZ6MJBDOTEIMIEHHFWY2TBGNGOVU7QRMGHDUSOZ5OPJ2EYWCRUB32W4 --output derp.enc

└─❯ cat derp.enc
xkv1����݋i8���fܮ L^T��^K�o�^Y��$U΄�]���^^�F���r-�G

└─❯ go run . auth nkey open derp.enc ./their.key XDBAJQRNSD6OD6A6X66UWNQTQDFJWGDFJBCVKQJSZ5NA2WM7CVYA7UUP
hello
ripienaar commented 5 months ago

We should maybe by default nase64 or he encode the encoded file with an option to disable?

not reviewed the code yet will next week when I am back

jordan-rash commented 5 months ago

We should maybe by default nase64 or he encode the encoded file with an option to disable?

not reviewed the code yet will next week when I am back

Switched the sealed data output default to b64 with the ability to disable

jordan-rash commented 5 months ago

was OOO last week, will get all these edits in today. thanks!

jordan-rash commented 4 months ago

I think i got them all. Thanks for the feedback!