3 In the .NET framework cryptography can be found under a number of
4 namespaces in several assemblies.
8 *** Namespace: <b>System.Security.Cryptography</b>
10 Thanks to the work of many people this namespace is almost complete.
14 * Every classes are present.
16 * Most classes have their unit tests.
21 * Support for adding/modifying algorithms and OID using the
22 <code>machine.config</code> configuration file (in progress).
24 * RNGCryptoServiceProvider is currently only working on Linux.
25 The current implementation reside in Mono's runtime and use
26 the <code>/dev/[u]random</code> device (which do not exists
27 under Windows). A Windows alternative is in the work...
29 * Keypair persistance for RSA and DSA. This persistance must
30 somehow be linked with X509 certificate stores (in planning).
32 * <code>PasswordDeriveBytes</code> is currently limited to
33 generating keys with the maximum length equals to the hash
34 output (as specified in PKCS #5). However the framework
35 implementation allows for longer keys to be generated. Also
36 the algorithms used by CryptDeriveKey (used by Windows
37 applications) are unknown.
39 * Analyse the current coverage of the unit tests on the
40 cryptographic classes and complete the unit tests.
42 * Optimizations (performance) on most class are possible. Some
43 have been done using the Community Edition of BoundChecker
44 (a free VisualStudio addon) - recommanded!
49 * All cryptographic algorithms are entirely managed, including
50 classes named <code>*CryptoServiceProvider</code>, with the
51 exception of <code>RNGCryptoServiceProvider</code> (which
52 resides in the runtime).
56 *** Namespace: <b>System.Security.Cryptography.X509Certificates</b>
60 * X.509 certificates are parsed using 100% managed code.
62 * Software Publisher Certificates (SPC) used by Authenticode
63 (tm) to sign assemblies are supported (extraction from PE
64 files) but <b>not</b> validated.
66 * Tests are generated from a set of existing certificates
67 (about a dozen) each having different properties. Another
68 set of certificates (more than 300) are used for a more
69 complete test (but isn't part of the test suite for size
70 and time consideration).
75 * Authenticode(tm) support is incomplete. We can extract the
76 certificates from PE files but cannot validate the signature
77 nor the certificate chain (and we're still missing some trust
80 * Integration with CryptoAPI isn't possible as long as the
81 <code>X509Certificate(IntPtr)</code> constructor isn't
87 * <b>There's no validation of the certificates</b> done in this
88 class (this isn't a restriction of Mono!). This means that
89 certificate signatures and validity dates are never checked!
91 * The newer X509Certificate class included in Microsoft's Web
92 Service Enhancement (WSE) is a little better (as it includes
95 * Microsoft implementation of <code>X509Certificate</code> is
96 done by using CryptoAPI. From the exceptions thrown
97 Authenticode(tm) support is done via COM.
101 ** Assembly: System.Security
103 *** Namespace: <b>System.Security.Cryptography.Xml</b>
105 This namespace implements the XML Digital Signature specification from
110 * All classes are present but some are only stubbed.
112 * Most classes have their unit tests.
114 * This assembly is present in CVS but isn't (yet) part of the
120 * All the transforms needs to be done. But this requires far
121 more XML knowledge than crypto.
123 * Fix the tests (see notes) then include the assembly into the
129 * Many current tests fails because the XML generated by Mono
130 isn't exactly the same as the one produced by the Microsoft
131 implementation (but 100% equivalent). We'll either have to
132 change the XML code or the tests.
134 * Testing is difficult because the classes use CryptoConfig
135 to create the required cryptographic objects. When running
136 the unit tests the CryptoConfig executing is the one in
137 mscorlib (not Mono's one) so it doesn't return the expected
138 objects. This results in InvalidCastException.
142 ** Assembly: Mono.Security.Win32
144 This assembly is to provide maximum compatibility with CryptoAPI to
145 application running with Mono's runtime on the Windows operating
148 <b>This assembly should NEVER be used directly by any application</b>.
149 The classes should only be used by modifying the <code>machine.config
150 </code> configuration file (and then only if this increased
151 compatibility is required by an application).
153 *** Namespace: Mono.Security.Cryptography
157 * A RNGCryptoServiceProvider built on top of CryptoAPI.
159 * Not (yet) commited in CVS.
164 * Unmanaged versions of hash algorithms (SHA1 and MD5).
165 * Unmanaged versions of symmetric encryption algorithms
166 (like DES, TripleDES, RC2 and others present in CryptoAPI).
167 * Unmanaged versions of asymmetric algorithms (like DSA and
168 RSA) which persist their keypair into the specified CSP.
172 ** Assembly: Microsoft.Web.Services
174 Microsoft Web Service Enhancement (WSE), known as Web Service
175 Development Kit (WSDK) in it's beta days, is an add-on the .NET
176 framework that implements WS-Security (and other WS-* specifications).
177 It also includes improved support for XML Signature (replacing and/or
178 extending <code>System.Security.Cryptography.Xml</code>) and X509
181 Note: WSE is distributed as an add-on because the WS-Security
182 specification isn't yet completed by OASIS.
184 <b>There are some licensing issues to consider before stating to
185 implement WS-Security. All contributors must sign an agreement with
186 Microsoft before commiting anything related to WS-Security into CVS.
189 *** Namespace: Microsoft.Web.Services.Security
193 * Nothing (yet) commited in CVS.
196 *** Namespace: Microsoft.Web.Services.Security.X509
200 * Nothing (yet) commited in CVS.
205 * We need to define certificate stores (for both users and
206 machines). These sames stores must be linked with asymmetric
207 keypairs. This could also be used to store the SPC roots.
213 There are other, not so visible, uses of cryptography both inside and
214 outside the class library - such as:
217 * SSL/TLS for secure communication (investigation under way).
219 * Assembly signing (and verification) using StrongNames.
221 * Assembly signing (and verification) using Authenticode(tm).
227 There are many tools in the .NET framework that indirectly interacts
228 with some cryptographic classes. Mono will eventually need these tools.
232 The following tools are complete:
234 * <code>secutil</code> is a tool to extract certificates and
235 strongnames from assemblies in a format that can be easily
236 re-used in source code (C# or VB.NET syntax).
238 * <code>cert2spc</code> is a tool to transform multiple X.509
239 certificates (a chain) into a Software Publisher Certificate
240 (SPC) - which is a long name for a simple PKCS#7 file.
244 The following tools are still missing or incomplete:
246 * <code>monosn</code> is a clone of the <code>sn</code> to manage
247 strongnames. This tools is part of the runtime (not the class
248 library) and as such is written in C.
250 * <code>signcode</code> and <code>chktrust</code> for signing
251 and validating Authenticode(tm) signatures on assemblies.
253 * <code>makecert</code> to create X.509 test certificates that
254 can be used (once transformed in SPC) to sign assemblies.
256 * Other tools like a, GUI-based, certificate manager...
259 Note that many of the tools requires the class library and/or the
260 runtime to be ready for them.
265 Complete any of the TODO (and feel good about it ;-).
267 Add missing unit tests to classes or methods.
269 Write some documentation on the cryptographic classes for MonkeyGuide
270 (as I'm not a good writer - but you must be a good reader if you got to
273 Optimization can also be done on algorithms as crypto is never fast
274 enough. Just be sure to test every optimization (using the unit test)
275 carefully - it's so fast to break an algorithm ;-).
277 Contact Sebastien Pouliot (<a href="mailto:spouliot@videotron.ca">home</a>
278 , <a href="mailto:spouliot@motus.com">work</a>) if you need additional
279 informations about the status of the cryptographic classes.