Skip to content

Commit 4116747

Browse files
committed
doc: include warning in age-plugin-batchpass(1)
1 parent 4444afb commit 4116747

File tree

2 files changed

+40
-4
lines changed

2 files changed

+40
-4
lines changed

cmd/age-plugin-batchpass/plugin-batchpass.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import (
1717
const usage = `age-plugin-batchpass is an age plugin that enables non-interactive
1818
passphrase-based encryption and decryption using environment variables.
1919
20-
WARNING:
20+
WARNING: IN 90% OF CASES, YOU DON'T NEED THIS PLUGIN.
2121
2222
This functionality is not built into the age CLI because most applications
2323
should use native keys instead of scripting passphrase-based encryption.

doc/age-plugin-batchpass.1.ronn

Lines changed: 39 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,51 @@ age-plugin-batchpass(1) -- non-interactive passphrase encryption plugin for age(
44
## SYNOPSIS
55

66
`age` `-e` `-j` `batchpass`<br>
7-
`age` `-d` `-j` `batchpass`
7+
`age` `-d` `-j` `batchpass`<br>
88

99
## DESCRIPTION
1010

1111
`age-plugin-batchpass` is an age(1) plugin that enables non-interactive
1212
passphrase-based encryption and decryption using environment variables.
1313

14-
It is not built into the age CLI because most applications should use
15-
native keys instead of scripting passphrase-based encryption.
14+
## WARNING
15+
16+
This functionality is not built into the age CLI because most applications
17+
should use native keys instead of scripting passphrase-based encryption.
18+
19+
Humans are notoriously bad at remembering and generating strong passphrases.
20+
age uses scrypt to partially mitigate this, which is necessarily very slow.
21+
22+
If a computer will be doing the remembering anyway, you can and should use
23+
native keys instead. There is no need to manage separate public and private
24+
keys, you encrypt directly to the private key:
25+
26+
$ age-keygen -o key.txt
27+
$ age -e -i key.txt file.txt > file.txt.age
28+
$ age -d -i key.txt file.txt.age > file.txt
29+
30+
Likewise, you can store a native identity string in an environment variable
31+
or through your CI secrets manager and use it to encrypt and decrypt files
32+
non-interactively:
33+
34+
$ export AGE_SECRET=$(age-keygen)
35+
$ age -e -i <(echo "$AGE_SECRET") file.txt > file.txt.age
36+
$ age -d -i <(echo "$AGE_SECRET") file.txt.age > file.txt
37+
38+
The age CLI also natively supports passphrase-encrypted identity files, so you
39+
can use that functionality to non-interactively encrypt multiple files such that
40+
you will be able to decrypt them later by entering the same passphrase:
41+
42+
$ age-keygen -pq | age -p -o encrypted-identity.txt
43+
Public key: age1pq1cd[... 1950 more characters ...]
44+
Enter passphrase (leave empty to autogenerate a secure one):
45+
age: using autogenerated passphrase "eternal-erase-keen-suffer-fog-exclude-huge-scorpion-escape-scrub"
46+
$ age -r age1pq1cd[... 1950 more characters ...] file.txt > file.txt.age
47+
$ age -d -i encrypted-identity.txt file.txt.age > file.txt
48+
Enter passphrase for identity file "encrypted-identity.txt":
49+
50+
Finally, when using this plugin care should be taken not to let the password be
51+
persisted in the shell history or leaked to other users on multi-user systems.
1652

1753
## ENVIRONMENT
1854

0 commit comments

Comments
 (0)