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 12:47]
andy
budget:pysf [2012/10/12 07:32] (current)
Line 12: Line 12:
 ===== File Header ===== ===== File Header =====
  
-^^  ​Byte  ​^  ​Byte  ​^  ​Byte  ​^  ​Byte  ^ +The following table indicates the minimum header: 
-||  ''​0xAA'' ​ |  ''​0x5F'' ​ |  Version ​ || + 
-||  Header length ​ ||  Cipher ​ |  Mode  | +^ ^  ​ ​^  ​ ​^  ​ ​^  ​ ^ 
-||  Key size  ||  Block size  || +^  0  ​|  ''​0xAA'' ​ |  ''​0x5F'' ​ |  Version ​ || 
-||  Salt (encryption) ​ |||| +^  4  ​|  Header length ​(bytes) ​ ​|| ​ Cipher ​ |  Mode  | 
-|| ::: |||| +^  8  ​|  Key size (bytes) ​ ​| ​ Salt size (bytes)  ​|  Block size (bytes) ​ || 
-|| Foo ||||+^  12  ​|  Salt (encryption) ​ |||| 
 +^  16  ​::: |||| 
 +^  20  |  Salt (checksum) ​ |||| 
 +^  24  ​| ::: |||| 
 +^  28  ​ ​Checksum  ​|||| 
 +^  32  ​::: |||| 
 +^  36  | ::: |||| 
 +^  40  | ::: |||| 
 +^  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.1349527626.txt.gz · Last modified: 2012/10/12 07:32 (external edit)