DIARY
Section: User Commands (1)
Index
Return to Main Contents
BSD mandoc
NAME
diary
- easily encrypt and decrypt secret data
SYNOPSIS
[-headyx
]
[-mkio file
]
DESCRIPTION
The
utility facilitates straightforward, secure encryption/decryption
operations from the standard input to the standard output.
It also features a special
``modification''
mode,
which allows an encrypted
text file to be edited in-place using a text editor of your choice.
One of the four modes below must be specified at all times.
The options are as follows:
- -h
-
Print the short help text.
- -e
-
Activate encryption mode,
which encrypts the standard input and dumps the result into the standard
output.
- -d
-
Activate decryption mode,
which decrypts the standard input and dumps the result into the standard
output.
- -a
-
Activate append mode,
which appends the content of the unencrypted standard input to the
encrypted output file specified by
-o
The content of the input goes after the output.
- -x
-
Used in conjunction with append mode,
retrieves encrypted data from the standard input instead (encrypted with
the same key as the output file)
- -y
-
Suppress non-critical dialogs, such as the file overwrite confirmation
when an existing output file is specified.
- -m file
-
Modify an encrypted file in-place,
using an environment-specified text editor.
- -k file
-
Specify a key file instead of prompting for a password.
Everything after the first 128 bytes is ignored.
- -i file
-
Normally,
in encrypt/decrypt mode,
the program looks for input on the standard input.
This option allows the standard input to be overriden with a given file,
instead of using shell redirection to achieve the same effect.
- -o file
-
Ditto, but overrides the standard output.
This provides better safety than shell redirection,
because it will ask you to confirm if the target output file
already exists.
You can suppress this check with
-y
(see above).
EXIT STATUS
Ex -std diary
ENVIRONMENT
Some environment variables control aspects of the program's operation.
It may be helpful to set these in the
.cshrc
.profile
or
.login
file.
- EDITOR
-
The name of the user's preferred text editor.
On most sytems,
this is set to
vi
EXAMPLES
The command:
diary -d < file
will ask for a password and print the decrypted content of
file
The command:
diary -e -i file1 -o file2
will ask for a password and encrypt
file1
and dump the result into
file2
See the manual page for your shell (e.g.,
sh(1))
for more information on redirection.
The command:
diary -m file
will open your chosen text editor to the decrypted content of
file
and then wait for you to finish editing it.
After you are done and have exited the editor,
it will re-encrypt the content and return it to
file
SEE ALSO
drecord(1),
dagent(1),
dpwgen(1)
BUGS
Due to the format of the encrypted data,
it is not possible to append or concatenate to encrypted files
created with
,
so you must decrypt the files,
append or concatenate them,
and only then re-encrypt the results.
stores no redundancy or error-correction data.
If even a single bit of your encrypted files is flipped/corrupted,
your data will be unrecoverable,
due to the nature of authenticated encryption algorithms.
Take backups of your data very regularly, and use reliable storage
media with its own error-correction facilities (this includes most
commercially available hard disk drives,
although they may not always be reliable).
Avoid floppy disks where possible, unless you can provide some other
means of correcting for unreadable sectors.
Index
- NAME
-
- SYNOPSIS
-
- DESCRIPTION
-
- EXIT STATUS
-
- ENVIRONMENT
-
- EXAMPLES
-
- SEE ALSO
-
- BUGS
-
This document was created by
man2html,
using the manual pages.
Time: 20:41:42 GMT, July 27, 2026