User Tools

Site Tools


budget:pysf

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
budget:pysf [2012/10/06 17:28]
andy
budget:pysf [2012/10/12 07:32] (current)
Line 11: Line 11:
  
 ===== File Header ===== ===== File Header =====
 +
 +The following table indicates the minimum header:
  
 ^ ^  0  ^  1  ^  2  ^  3  ^ ^ ^  0  ^  1  ^  2  ^  3  ^
 ^  0  |  ''​0xAA'' ​ |  ''​0x5F'' ​ |  Version ​ || ^  0  |  ''​0xAA'' ​ |  ''​0x5F'' ​ |  Version ​ ||
-^  4  |  Header length ​ ||  Cipher ​ |  Mode  | +^  4  |  Header length ​(bytes) ​ ​|| ​ Cipher ​ |  Mode  | 
-^  8  |  Key size  ||  Block size  ||+^  8  |  Key size (bytes) ​ ​| ​ Salt size (bytes)  ​|  Block size (bytes) ​ ||
 ^  12  |  Salt (encryption) ​ |||| ^  12  |  Salt (encryption) ​ ||||
 ^  16  | ::: |||| ^  16  | ::: ||||
Line 25: Line 27:
 ^  40  | ::: |||| ^  40  | ::: ||||
 ^  44  | ::: |||| ^  44  | ::: ||||
 +
 +Since the size of the salts is variable, the checksum may occur later.
 +
 +  * **Version:​** version of file format, where least significant byte is a minor version indicating backward compatibility and most significant byte is a major version indicating incompatible format changes.
 +  * **Header length:** offset of file data from start of file, which may extend beyond the actual header (for example, to align with blocks on disk).
 +  * **Cipher:** identifies cipher algorithm used (e.g. AES).
 +  * **Mode:** indicates chaining mode (e.g. CBC).
 +  * **Key size:** size of key for encryption and checksum //in bytes// (e.g. 16 for 128-bit key).
 +  * **Salt size:** size of salt used //in bytes// --- this determines the size of the two salt fields later and should be a multiple of 4 bytes to maintain alignment.
 +  * **Block size:** size of blocks into which file data is split prior to encryption, in bytes.
 +  * **Salt (encryption):​** salt used for generating encryption key from passphrase.
 +  * **Salt (checksum):​** salt used for generating key for HMAC checksumming from passphrase.
 +  * **Checksum:​** the XOR of the HMAC-SHA1 sums of each //​encrypted//​ block of the file.
 +
 +
budget/pysf.1349544512.txt.gz · Last modified: 2012/10/12 07:32 (external edit)