1AESPIPE(1)                         COMMANDS                         AESPIPE(1)
2
3
4

NAME

6       aespipe - AES encrypting or decrypting pipe
7

SYNOPSIS

9       aespipe [options] <inputfile >outputfile
10

DESCRIPTION

12       aespipe reads from standard input and writes to standard output. It can
13       be used to create and restore encrypted tar or cpio archives. It can be
14       used  to encrypt and decrypt loop-AES compatible encrypted disk images.
15       aespipe encrypts and decrypts blocks of data. If you  are  looking  for
16       general purpose encrypting tool that preserves data size at byte granu‐
17       larity, then please take a look at GnuPG.
18
19       The AES cipher is used in CBC (cipher block  chaining)  mode.  Data  is
20       encrypted and decrypted in 512 byte chains.  aespipe supports three key
21       setup modes; single-key, multi-key-v2 and multi-key-v3  modes.  Single-
22       key  mode  uses simple sector IV and one AES key to encrypt and decrypt
23       all data sectors. Multi-key-v2 mode uses cryptographically more  secure
24       MD5  IV  and 64 different AES keys to encrypt and decrypt data sectors.
25       In multi-key mode first key is used for first sector,  second  key  for
26       second  sector,  and so on. Multi-key-v3 is same as multi-key-v2 except
27       is uses one extra 65th key as additional input to MD5  IV  computation.
28       See  -K  option  for  more information about how to enable multi-key-v3
29       mode.
30
31       Recommended key setup mode is  multi-key-v3,  which  is  based  on  gpg
32       encrypted  key files. In this mode, the passphrase is protected against
33       optimized dictionary attacks via salting  and  key  iteration  of  gpg.
34       Passphrase length should be 20 characters or more.
35
36       Single-key  mode preserves input size at 16 byte granularity. Multi-key
37       mode preserves input size at 512 byte granularity. If input size is not
38       multiple  of  16  or 512 bytes, input data is padded with null bytes so
39       that both input and output sizes are multiples of 16 or 512 bytes.
40
41       If "ulimit -l" is set to "unlimited" then aespipe attempts to lock  its
42       RAM so that encryption keys do not leak to unencrypted swap. If "ulimit
43       -l" is something other than "unlimited" then aespipe will proceed with‐
44       out locked RAM.
45

OPTIONS

47       -A gpgAgentSocket
48              Read passphrase of gpg encrypted key file from gpg-agent instead
49              of the terminal. aespipe runs gpg to decrypt a key file, and gpg
50              talks to gpg-agent using gpgAgentSocket. Usually this data is in
51              GPG_AGENT_INFO environment variable.  The  environment  that  is
52              passed  to  gpg is very minimal.  Normally gpg passes some envi‐
53              ronment variables to gpg-agent, but in this case,  there  aren't
54              any.  For  best  results, you may want to configure gpg-agent so
55              that it "keeps" and uses its own  environment.  Defining  "keep-
56              tty", "keep-display" and "pinentry-program" in $HOME/.gnupg/gpg-
57              agent.conf configuration file is a good start.
58
59       -C itercountk
60              Runs hashed passphrase through itercountk thousand iterations of
61              AES-256  before using it for data encryption. This consumes lots
62              of CPU cycles at program start time but not thereafter. In  com‐
63              bination   with  passphrase  seed  this  slows  down  dictionary
64              attacks. Iteration is not done in multi-key mode.
65
66       -d     Decrypt data. If this option is not specified, default operation
67              is to encrypt data.
68
69       -e encryption
70              Following  encryption  types  are  recognized: AES128 (default),
71              AES192 and AES256. Encryption type names are  case  insensitive.
72              AES128   defaults  to  using  SHA-256  passphrase  hash,  AES192
73              defaults to using SHA-384 passphrase hash, and  AES256  defaults
74              to using SHA-512 passphrase hash.
75
76       -G gpghome
77              Set  gpg home directory to gpghome, so that gpg uses public/pri‐
78              vate keys on gpghome directory. This is only  used  when  gpgkey
79              file  needs to be decrypted using public/private keys. If gpgkey
80              file is encrypted with  symmetric  cipher  only,  public/private
81              keys are not required and this option has no effect.
82
83       -H phash
84              Uses phash function to hash passphrase. Available hash functions
85              are sha256, sha384, sha512 and rmd160. unhashed1  and  unhashed2
86              functions also exist for compatibility with some obsolete imple‐
87              mentations. Hash type names are case insensitive.
88
89       -K gpgkey
90              Passphrase is piped to gpg so that gpg can decrypt  file  gpgkey
91              which  contains  the real keys that are used to encrypt data. If
92              decryption requires public/private keys and gpghome is not spec‐
93              ified,  all  users  use  their  own  gpg  public/private keys to
94              decrypt gpgkey. Decrypted gpgkey should contain 1 or  64  or  65
95              keys,  each key at least 20 characters and separated by newline.
96              If decrypted gpgkey contains 64 or 65 keys, then aespipe is  put
97              to  multi-key  mode. 65th key, if present, is used as additional
98              input to MD5 IV computation.
99
100       -O sectornumber
101              Set IV offset in 512  byte  units.  Default  is  zero.  Data  is
102              encrypted  in 512 byte CBC chains and each 512 byte chain starts
103              with IV whose computation depends on  offset  within  the  data.
104              This  option  can  be  used to start encryption or decryption in
105              middle of some existing encrypted disk image.
106
107       -p fdnumber
108              Read the passphrase from file descriptor fdnumber instead of the
109              terminal. If -K option is not being used (no gpg key file), then
110              aespipe attempts to read 65 keys  from  passwdfd,  each  key  at
111              least  20  characters  and separated by newline. If aespipe suc‐
112              cessfully reads 64 or 65 keys, then aespipe is put to  multi-key
113              mode. If aespipe encounters end-of-file before 64 keys are read,
114              then only first key is used in single-key mode.
115
116       -P cleartextkey
117              Read the passphrase from file cleartextkey instead of the termi‐
118              nal.  If  -K  option  is  not being used (no gpg key file), then
119              aespipe attempts to read 65 keys from cleartextkey, each key  at
120              least  20  characters  and separated by newline. If aespipe suc‐
121              cessfully reads 64 or 65 keys, then aespipe is put to  multi-key
122              mode. If aespipe encounters end-of-file before 64 keys are read,
123              then only first key is used in single-key mode. If both  -p  and
124              -P  options are used, then -p option takes precedence. These are
125              equivalent:
126
127              aespipe -p3 -K foo.gpg -e AES128 ...   3<someFileName
128
129              aespipe -P someFileName -K foo.gpg -e AES128 ...
130
131              In first line of above example, in addition to normal open  file
132              descriptors (0==stdin 1==stdout 2==stderr), shell opens the file
133              and passes open file descriptor to started aespipe  program.  In
134              second line of above example, aespipe opens the file itself.
135
136       -q     Be quiet and don't complain about write errors.
137
138       -S pseed
139              Sets  encryption passphrase seed pseed which is appended to user
140              supplied passphrase before hashing. Using different seeds  makes
141              dictionary attacks slower but does not prevent them if user sup‐
142              plied passphrase is guessable.  Seed is not  used  in  multi-key
143              mode.
144
145       -T     Asks passphrase twice instead of just once.
146
147       -v     Verbose  mode.  Prints  diagnostics  to stderr about key length,
148              single/multi  key  mode,   and   selected   code   optimizations
149              (x86/amd64/padlock/intelaes).
150
151       -w number
152              Wait number seconds before asking passphrase.
153

RETURN VALUE

155       aespipe returns 0 on success, nonzero on failure.
156

AVAILABILITY

158       Source is available from http://loop-aes.sourceforge.net/
159

AUTHORS

161       Jari Ruusu
162
163
164
165LINUX                          February 23 2011                     AESPIPE(1)
Impressum