summaryrefslogtreecommitdiffabout
path: root/pwmanager/file-format
Unidiff
Diffstat (limited to 'pwmanager/file-format') (more/less context) (ignore whitespace changes)
-rw-r--r--pwmanager/file-format137
1 files changed, 137 insertions, 0 deletions
diff --git a/pwmanager/file-format b/pwmanager/file-format
new file mode 100644
index 0000000..610ab51
--- a/dev/null
+++ b/pwmanager/file-format
@@ -0,0 +1,137 @@
1<========================>
2< Format of *.pwm file >
3<========================>
4fileversion: 0x05 revision: 0x01
5
6(note: another revision doesn't change fore- or
7 backward compatibility)
8
9
10The file has a header and a data-body.
11
12****************************************************
13* The header is build from the following elements: *
14****************************************************
15PWM_PASSWORD_FILE
16[FILEVER]
17[KEY-HASH-ALGO]
18[DATA-HASH-ALGO]
19[CRYPT-ALGO]
20[COMPRESSED-FLAG]
21[MPW-FLAG]
22[BYTES-RESERVED]
23[KEY-HASH]
24[DATA-HASH]
25
26
27(note: fields marked with ~ were added _after_
28 revision 0x01)
29
30
31PWM_PASSWORD_FILE is a magic string to indentify the file.
32This string is put directly at offset 0x00 of the file.
33
34[FILEVER] is one byte for holding the file-version.
35This byte is directly appended to the "magic-string".
36(no newline or other separators between these fields)
37
38[HASH-ALGO] is one byte for holding the type of the hash-algorithm
39used to hash the key.
400x01 => SHA1
41
42[DATA-HASH-ALGO] is one byte for holding the type of the
43hash-algorithm used to hash the raw data-stream.
440x01 => SHA1
45
46[CRYPT-ALGO] is one byte containing the type of the crypt-algorithm
47used to encrypt the data.
480x01 => Blowfish
49
50[COMPRESSED-FLAG] is one byte which can be
510x00 => not compressed
520x01 => compressed with gzip
530x02 => compressed with bzip2
54
55[MPW-FLAG] is one byte, either 0x00 if
56we used a master password to encrypt the data,
57or 0x01, if we used a chipcard to encrypt the data.
58
59[BYTES-RESERVED]
6064-bytes reserved for future-use.
61Set all these to 0x00.
62
63[KEY-HASH] is the hash of the key. This field has no constant
64length, because it's length depends on the algorithm
65used in HASH-ALGO.
66
67[DATA-HASH] is a hash of the raw, unencrypted, serialized
68data stream.
69
70
71**************
72* Data-body: *
73**************
74
75The data-body follows the header directly.
76It contains the encrypted serialized data in XML-format.
77It may be compressed.
78For an example
79how to serialize the data, have a look at:
80PwMDoc::serializeDta();
81PwMDoc::deSerializeDta();
82The class "Serializer"
83PwMDoc::encrypt();
84PwMDoc::decrypt();
85
86These functions are called by:
87PwMDoc::saveDoc();
88PwMDoc::openDoc();
89so, please have a look at these two functions, too.
90
91
92
93Example of an XML-data-block:
94
95<PwM-xml-dat ver="0x02">
96 <categories>
97 <cat_0 name="catName">
98 <entry_0>
99 <desc>sampleDesc</desc>
100 <name>sampleName</name>
101 <pw>samplePw</pw>
102 <comment>sampleComment</comment>
103 <url>sampleUrl</url>
104 <launcher>sampleLauncher</launcher>
105 <listViewPos>sampleListViewPos</listViewPos>
106 <b>0</b>
107 </entry_0>
108 <entry_1>
109 <desc>sampleDesc</desc>
110 <name>sampleName</name>
111 <pw>samplePw</pw>
112 <comment>sampleComment</comment>
113 <url>sampleUrl</url>
114 <launcher>sampleLauncher</launcher>
115 <listViewPos>sampleListViewPos</listViewPos>
116 <b>1</b>
117 </entry_1>
118 </cat_0>
119 </categories>
120</PwM-xml-dat>
121
1222004-06-05:
123So I introduced shorter names for the entries. We also have to support
124the old names to be backward compatibel.
125New names are:
126 PwM-xml-dat = P
127 <categories> = <c>
128 <cat_X> = <cX>
129 <entry_X> = <eX>
130 <desc> = <d>
131 <name> = <n>
132 <pw> = <p>
133 <comment> = <c>
134 <url> = <u>
135 <launcher> = <l>
136 <listViewPos> = <v>
137 <b> = <b>