-
Notifications
You must be signed in to change notification settings - Fork 0
/
cryptnos_export1.xsd
139 lines (117 loc) · 6.27 KB
/
cryptnos_export1.xsd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
<?xml version="1.0" encoding="UTF-8"?>
<!--
Cryptnos Common Parameter Export Format
Version 1
Jeffrey T. Darlington
April 27, 2010
This XML schema defines the common site parameter export format to be used
by all future versions of the Cryptnos password generating program.
Previously, each platform had its own export format, which was sufficent
for backing up data for that platform or moving from one instance of the
program on that platform to another. But it didn't really help when it came
to copying data from one platform to another. This common export format is
meant to rectify that issue, giving a common XML-based parameter format that
all platforms should use going forward. Support for each original platform-
specific format should be maintained for backward compatibility, but all
versions should use this format going forward.
Note that this XML file will likely be encrypted and possibly compressed;
it should never be used completely unencrypted except for testing purposes.
Encryption will be maditory, using a password-based AES-256 algorithm.
Compression is still on the drawing board and may or may not be used; if
used, the XML will be compressed before encryption and decompressed after
decryption. The current plan is to include compression so long as it does
not significantly impact performance on all platforms.
Required elements will include the version number of this format (which for
now will be hard-coded to "1") and a <sites> element that will include a
list of individual <site> entries. Each <site> will include all the
parameters required to recreate the user's generated password, with the
exception of the master password which is never saved. An optional but
recommended <generator> attribute should include the name of the application
that created the file including its user-readable version number. An
optional <comment> field is also allowed, but for now will be ignored since
these files should never be human readable.
-->
<xs:schema
targetNamespace="http://www.cryptnos.com/"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:cryptnos="http://www.cryptnos.com/"
elementFormDefault="qualified"
attributeFormDefault="qualified">
<!-- ******************************************************************* -->
<!-- Basic type definitions: -->
<!-- Version can only be 1 (for now): -->
<xs:simpleType name="versionType">
<xs:restriction base="xs:NMTOKEN">
<xs:enumeration value="1"/>
</xs:restriction>
</xs:simpleType>
<!-- Define integers. I'm not sure if I should be using a home-grown value
here or not; this may get replaced with a standard value later. The
main concern is that this must be a positive value. -->
<xs:simpleType name="integer">
<xs:restriction base="xs:string">
<xs:pattern value="[0-9]+"/>
</xs:restriction>
</xs:simpleType>
<!-- ******************************************************************* -->
<!-- Define the individual site parameter definition. A set of parameters
consists primarily of a site token string (often a domain name but it
can be literally any unique string), a string representing the crypto-
graphic hash to use to generate the password, a positive integer
greater than zero specifying the number of hash iterations, an integer
that specifies the character type class (all characters, only alpha-
numerics, etc.), and a positive integer greater than or equal to zero
that represents the limit on the number of characters returned. If the
character limit is zero, it is assumed that there is no limit imposed.
The number of hash iterations is actuall 1 <= x <= 500; the upper limit
is imposed due to performance issues on Google Android. There will be
only one of each parameter per site block, so this should be a fairly
simple definition. -->
<xs:complexType name="siteType">
<xs:sequence>
<xs:element name="siteToken" type="xs:string" minOccurs="1" maxOccurs="1"/>
<xs:element name="hash" type="xs:string" minOccurs="1" maxOccurs="1"/>
<xs:element name="iterations" type="cryptnos:integer" minOccurs="1" maxOccurs="1"/>
<xs:element name="charTypes" type="cryptnos:integer" minOccurs="1" maxOccurs="1"/>
<xs:element name="charLimit" type="cryptnos:integer" minOccurs="1" maxOccurs="1"/>
</xs:sequence>
</xs:complexType>
<!-- Define the site list block. This is just a list of one or more
individual site blocks as defined above. There must be at least one
site in the list for the parameter file to be useful. However, we
won't set an upper limit. -->
<xs:complexType name="siteListType">
<xs:sequence>
<xs:element name="site" type="cryptnos:siteType" minOccurs="1" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
<!-- ******************************************************************* -->
<!-- Define the main body of the XML file: -->
<!-- The main element: -->
<xs:element name="cryptnos">
<xs:complexType>
<xs:sequence>
<!-- The version number. This is required. -->
<xs:element name="version" type="cryptnos:versionType" minOccurs="1" maxOccurs="1"/>
<!-- An optional generator string. If nothing else, this should
identify which application, including version number,
generated the parameter file. That will help when it comes
to debugging cross-platform issues. -->
<xs:element name="generator" type="xs:string" minOccurs="0" maxOccurs="1"/>
<!-- An optional comment string. I'm not sure if this will ever
get used, since these files should be system generated and
never appear decrypted. That said, I don't see a valid
reason NOT to have it, and adding it now might be easier,
just in case it's needed later. -->
<xs:element name="comment" type="xs:string" minOccurs="0" maxOccurs="1"/>
<!-- The count of the number of sites listed in the site block
below. Technically, this isn't really necessary, but it
makes some reporting on Android a bit easier. -->
<xs:element name="siteCount" type="cryptnos:integer" minOccurs="1" maxOccurs="1"/>
<!-- The site list block, as defined above. There should be
only one site list block per file. -->
<xs:element name="sites" type="cryptnos:siteListType" minOccurs="1" maxOccurs="1"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>