file format on-the-fly when copying files from the source to mirror path, i.e., it reads a chunk of file data in memory, encrypts that data, and then writes the encrypted data to the destination file. It can also decrypt files in the same way. We are using the
specification v2 as described on that website (but not any code from that project). So, you can use the AESCrypt utility program from that website to decrypt files if needed. Note that you can also encrypt or decrypt files under the
page when copying files from a source to destination path.Below is a copy of the AES file format v2 used by MirrorFolder.
3 Octets - 'AES'
1 Octet - 0x02 (Version)
1 Octet - Reserved (set to 0x00)
.... Start of repeating extension block section
2 Octet - Length in octets (in network byte order) of an extension
identifier and contents. If 0x0000, then no further
extensions exist and the next octet is the start of the
Initialization Vector (IV). Following an extension,
this length indicator would appear again to indicate
presence or absence of another extension and the size of
any such extension.
nn Octets - Extension identifier. This is either a URI or an
identifier defined by the AES developer community and
documented on the standard extensions page, either
of which is terminated by a single 0x00 octet. All
extension identifiers are case sensitive.
MirrorFolder inserts the following URI:
urn:uuid:7EB104C5-C965-4DE9-ACFC-F9161D54DEBA
Then the following fields:
8 Octets - File size in bytes.
8 Octets - File modification time in Windows UTC format.
8 Octets - File creation time in Windows UTC format.
A URI was used to allow anybody to define extension
types, though we should strive to define a standard
set of extensions.
Examples of standard extension identifiers:
CREATED-DATE
CREATED-BY
A special extension is defined that has no name, but is
merely a "container" for extensions to be added after the
AES file is initially created. Such an extension avoids
the need to read and re-write the entire file in order to
add a small extension. Software tools that create AES
files should insert a 128-octet "container" extension,
placing a 0x00 in the first octet of the extension
identifier field. Developers may then insert extensions
into this "container" area and reduce the size of this
"container" as necessary. If larger extensions are added
or the "container" area is filled entirely, then reading
and re-writing the entire file would be necessary to add
additional extensions.
nn Octets - The contents of the extension
.... End of repeating extension block section
16 Octets - Initialization Vector (IV) used for encrypting the
IV and symmetric key that is actually used to encrypt
the bulk of the plaintext file.
48 Octets - Encrypted IV and 256-bit AES key used to encrypt the
bulk of the file
16 octets - initialization vector
32 octets - encryption key
32 Octets - HMAC
nn Octets - Encrypted message (2^64 octets max)
1 Octet - File size modulo 16 in least significant bit positions
32 Octets - HMAC