man aespipe (Commandes) - AES encrypting or decrypting pipe

NAME

aespipe - AES encrypting or decrypting pipe

SYNOPSIS

aespipe [options] <inputfile >outputfile

DESCRIPTION

aespipe reads from standard input and writes to standard output. It can be used to create and restore encrypted tar or cpio archives. It can be used to encrypt and decrypt loop-AES compatible encrypted disk images.

The AES cipher is used in CBC (cipher block chaining) mode. Data is encrypted and decrypted in 512 byte chains. aespipe supports three key setup modes; single-key, multi-key-v2 and multi-key-v3 modes. Single-key mode uses simple sector IV and one AES key to encrypt and decrypt all data sectors. Multi-key-v2 mode uses cryptographically more secure MD5 IV and 64 different AES keys to encrypt and decrypt data sectors. In multi-key mode first key is used for first sector, second key for second sector, and so on. Multi-key-v3 is same as multi-key-v2 except is uses one extra 65th key as additional input to MD5 IV computation. See -K option for more information about how to enable multi-key-v3 mode.

Single-key mode preserves input size at 16 byte granularity. Multi-key mode preserves input size at 512 byte granularity. If input size is not multiple of 16 or 512 bytes, input data is padded with null bytes so that both input and output sizes are multiples of 16 or 512 bytes.

Password string has a minimum length of 20 characters (or 1 character when using rmd160 password hash). Optional password seed (salt) and key iteration count can be used to slow down dictionary attacks. Password seed is appended to user supplied password before password is hashed using one way hash. If password iteration count is specified, password hash output is encrypted N thousand times using AES-256. Unique seed prevents an adversary from precomputing hashes of passwords in his dictionary in advance, and thus making an optimized attack slower. Large password iteration count makes dictionary attack painfully slow.

OPTIONS

-C itercountk
Runs hashed password through itercountk thousand iterations of AES-256 before using it for data encryption. This consumes lots of CPU cycles at program start time but not thereafter. In combination with password seed this slows down dictionary attacks. Iteration is not done in multi-key mode.
-d
Decrypt data. If this option is not specified, default operation is to encrypt data.
-e encryption
Following encryption types are recognized: AES128 (default), AES192 and AES256. Encryption type names are case insensitive. AES128 defaults to using SHA-256 password hash, AES192 defaults to using SHA-384 password hash, and AES256 defaults to using SHA-512 password hash.
-G gpghome
Set gpg home directory to gpghome, so that gpg uses public/private keys on gpghome directory. This is only used when gpgkey file needs to be decrypted using public/private keys. If gpgkey file is encrypted with symmetric cipher only, public/private keys are not required and this option has no effect.
-H phash
Uses phash function to hash password. Available hash functions are sha256, sha384, sha512 and rmd160. Hash type names are case insensitive.
-K gpgkey
Password is piped to gpg so that gpg can decrypt file gpgkey which contains the real keys that are used to encrypt data. If decryption requires public/private keys and gpghome is not specified, all users use their own gpg public/private keys to decrypt gpgkey. Decrypted gpgkey should contain 1 or 64 or 65 keys, each key at least 20 characters and separated by newline. If decrypted gpgkey contains 64 or 65 keys, then aespipe is put to multi-key mode. 65th key, if present, is used as additional input to MD5 IV computation.
-O sectornumber
Set IV offset in 512 byte units. Default is zero. Data is encrypted in 512 byte CBC chains and each 512 byte chain starts with unique IV. This option can be used to start encryption or decryption in middle of some existing encrypted disk image.
-p fdnumber
Read the password from file descriptor fdnumber instead of the terminal. If -K option is not being used (no gpg key file), then aespipe attempts to read 65 keys from passwdfd, each key at least 20 characters and separated by newline. If aespipe successfully reads 64 or 65 keys, then aespipe is put to multi-key mode. If aespipe encounters end-of-file before 64 keys are read, then only first key is used in single-key mode.
-q
Be quiet and don't complain about write errors.
-S pseed
Sets encryption password seed pseed which is appended to user supplied password before hashing. Using different seeds makes dictionary attacks slower but does not prevent them if user supplied password is guessable. Seed is not used in multi-key mode.
-T
Asks password twice instead of just once.
-w number
Wait number seconds before asking password.

RETURN VALUE

aespipe returns 0 on success, nonzero on failure.

AVAILABILITY

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

AUTHORS

Jari Ruusu