summaryrefslogtreecommitdiff
path: root/src/lib/libssl/src/doc/ssleay.doc
diff options
context:
space:
mode:
authorcvs2svn <admin@example.com>1998-10-05 20:13:17 +0000
committercvs2svn <admin@example.com>1998-10-05 20:13:17 +0000
commite82f18fab47b698d93971f576f962a3068132912 (patch)
tree681519717892864935c3d0533cf171098afa649a /src/lib/libssl/src/doc/ssleay.doc
parent536c76cbb863bab152f19842ab88772c01e922c7 (diff)
downloadopenbsd-SSLeay_0_9_0b.tar.gz
openbsd-SSLeay_0_9_0b.tar.bz2
openbsd-SSLeay_0_9_0b.zip
This commit was manufactured by cvs2git to create tag 'SSLeay_0_9_0b'.SSLeay_0_9_0b
Diffstat (limited to 'src/lib/libssl/src/doc/ssleay.doc')
-rw-r--r--src/lib/libssl/src/doc/ssleay.doc213
1 files changed, 213 insertions, 0 deletions
diff --git a/src/lib/libssl/src/doc/ssleay.doc b/src/lib/libssl/src/doc/ssleay.doc
new file mode 100644
index 0000000000..a0e86aef7c
--- /dev/null
+++ b/src/lib/libssl/src/doc/ssleay.doc
@@ -0,0 +1,213 @@
1SSLeay: a cryptographic kitchen sink.
2
31st December 1995
4Way back at the start of April 1995, I was looking for a mindless
5programming project. A friend of mine (Tim Hudson) said "why don't you do SSL,
6it has DES encryption in it and I would not mind using it in a SSL telnet".
7While it was true I had written a DES library in previous years, litle
8did I know what an expansive task SSL would turn into.
9
10First of all, the SSL protocol contains DES encryption. Well and good. My
11DES library was fast and portable. It also contained the RSA's RC4 stream
12cipher. Again, not a problem, some-one had just posted to sci.crypt
13something that was claimed to be RC4. It also contained IDEA, I had the
14specifications, not a problem to implement. MD5, an RFC, trivial, at most
15I could spend a week or so trying to see if I could speed up the
16implementation. All in all a nice set of ciphers.
17Then the first 'expantion of the scope', RSA public key
18encryption. Since I did not knowing a thing about public key encryption
19or number theory, this appeared quite a daunting task. Just writing a
20big number library would be problomatic in itself, let alone making it fast.
21At this point the scope of 'implementing SSL' expands eponentialy.
22First of all, the RSA private keys were being kept in ASN.1 format.
23Thankfully the RSA PKCS series of documents explains this format. So I now
24needed to be able to encode and decode arbitary ASN.1 objects. The Public
25keys were embeded in X509 certificates. Hmm... these are not only
26ASN.1 objects but they make up a heirachy of authentication. To
27authenticate a X509 certificate one needs to retrieve it's issuers
28certificate etc etc. Hmm..., so I also need to implement some kind
29of certificate management software. I would also have to implement
30software to authenticate certificates. At this point the support code made
31the SSL part of my library look quite small.
32Around this time, the first version of SSLeay was released.
33
34Ah, but here was the problem, I was not happy with the code so far. As may
35have become obvious, I had been treating all of this as a learning
36exersize, so I have completely written the library myself. As such, due
37to the way it had grown like a fungus, much of the library was not
38'elagent' or neat. There were global and static variables all over the
39place, the SSL part did not even handle non-blocking IO.
40The Great rewrite began.
41
42As of this point in time, the 'Great rewrite' has almost finished. So what
43follows is an approximate list of what is actually SSLeay 0.5.0
44
45/********* This needs to be updated for 0.6.0+ *************/
46
47---
48The library contains the following routines. Please note that most of these
49functions are not specfic for SSL or any other particular cipher
50implementation. I have tried to make all the routines as general purpose
51as possible. So you should not think of this library as an SSL
52implemtation, but rather as a library of cryptographic functions
53that also contains SSL. I refer to each of these function groupings as
54libraries since they are often capable of functioning as independant
55libraries
56
57First up, the general ciphers and message digests supported by the library.
58
59MD2 rfc???, a standard 'by parts' interface to this algorithm.
60MD5 rfc???, the same type of interface as for the MD2 library except a
61 different algorithm.
62SHA THe Secure Hash Algorithm. Again the same type of interface as
63 MD2/MD5 except the digest is 20 bytes.
64SHA1 The 'revised' version of SHA. Just about identical to SHA except
65 for one tweak of an inner loop.
66DES This is my libdes library that has been floating around for the last
67 few years. It has been enhanced for no other reason than completeness.
68 It now supports ecb, cbc, cfb, ofb, cfb64, ofb64 in normal mode and
69 triple DES modes of ecb, cbc, cfb64 and ofb64. cfb64 and ofb64 are
70 functional interfaces to the 64 bit modes of cfb and ofb used in
71 such a way thay they function as single character interfaces.
72RC4 The RSA Inc. stream cipher.
73RC2 The RSA Inc. block cipher.
74IDEA An implmentation of the IDEA cipher, the library supports ecb, cbc,
75 cfb64 and ofb64 modes of operation.
76
77Now all the above mentioned ciphers and digests libraries support high
78speed, minimal 'crap in the way' type interfaces. For fastest and
79lowest level access, these routines should be used directly.
80
81Now there was also the matter of public key crypto systems. These are
82based on large integer arithmatic.
83
84BN This is my large integer library. It supports all the normal
85 arithmentic operations. It uses malloc extensivly and as such has
86 no limits of the size of the numbers being manipulated. If you
87 wish to use 4000 bit RSA moduli, these routines will handle it.
88 This library also contains routines to 'generate' prime numbers and
89 to test for primality. The RSA and DH libraries sit on top of this
90 library. As of this point in time, I don't support SHA, but
91 when I do add it, it will just sit on top of the routines contained
92 in this library.
93RSA This implements the RSA public key algorithm. It also contains
94 routines that will generate a new private/public key pair.
95 All the RSA functions conform to the PKCS#1 standard.
96DH This is an implementation of the
97 Diffie-Hellman protocol. There are all the require routines for
98 the protocol, plus extra routines that can be used to generate a
99 strong prime for use with a specified generator. While this last
100 routine is not generally required by applications implementing DH,
101 It is present for completeness and because I thing it is much
102 better to be able to 'generate' your own 'magic' numbers as oposed
103 to using numbers suplied by others. I conform to the PKCS#3
104 standard where required.
105
106You may have noticed the preceeding section mentions the 'generation' of
107prime numbers. Now this requries the use of 'random numbers'.
108
109RAND This psuedo-random number library is based on MD5 at it's core
110 and a large internal state (2k bytes). Once you have entered enough
111 seed data into this random number algorithm I don't feel
112 you will ever need to worry about it generating predictable output.
113 Due to the way I am writing a portable library, I have left the
114 issue of how to get good initial random seed data upto the
115 application but I do have support routines for saving and loading a
116 persistant random number state for use between program runs.
117
118Now to make all these ciphers easier to use, a higher level
119interface was required. In this form, the same function would be used to
120encrypt 'by parts', via any one of the above mentioned ciphers.
121
122EVP The Digital EnVeloPe library is quite large. At it's core are
123 function to perform encryption and decryption by parts while using
124 an initial parameter to specify which of the 17 different ciphers
125 or 4 different message digests to use. On top of these are implmented
126 the digital signature functions, sign, verify, seal and open.
127 Base64 encoding of binary data is also done in this library.
128
129PEM rfc???? describe the format for Privacy Enhanced eMail.
130 As part of this standard, methods of encoding digital enveloped
131 data is an ascii format are defined. As such, I use a form of these
132 to encode enveloped data. While at this point in time full support
133 for PEM has not been built into the library, a minimal subset of
134 the secret key and Base64 encoding is present. These reoutines are
135 mostly used to Ascii encode binary data with a 'type' associated
136 with it and perhaps details of private key encryption used to
137 encrypt the data.
138
139PKCS7 This is another Digital Envelope encoding standard which uses ASN.1
140 to encode the data. At this point in time, while there are some
141 routines to encode and decode this binary format, full support is
142 not present.
143
144As Mentioned, above, there are several different ways to encode
145data structures.
146
147ASN1 This library is more a set of primatives used to encode the packing
148 and unpacking of data structures. It is used by the X509
149 certificate standard and by the PKCS standards which are used by
150 this library. It also contains routines for duplicating and signing
151 the structures asocisated with X509.
152
153X509 The X509 library contains routines for packing and unpacking,
154 verifying and just about every thing else you would want to do with
155 X509 certificates.
156
157PKCS7 PKCS-7 is a standard for encoding digital envelope data
158 structures. At this point in time the routines will load and save
159 DER forms of these structees. They need to be re-worked to support
160 the BER form which is the normal way PKCS-7 is encoded. If the
161 previous 2 sentances don't make much sense, don't worry, this
162 library is not used by this version of SSLeay anyway.
163
164OBJ ASN.1 uses 'object identifiers' to identify objects. A set of
165 functions were requred to translate from ASN.1 to an intenger, to a
166 character string. This library provieds these translations
167
168Now I mentioned an X509 library. X509 specified a hieachy of certificates
169which needs to be traversed to authenticate particular certificates.
170
171METH This library is used to push 'methods' of retrieving certificates
172 into the library. There are some supplied 'methods' with SSLeay
173 but applications can add new methods if they so desire.
174 This library has not been finished and is not being used in this
175 version.
176
177Now all the above are required for use in the initial point of this project.
178
179SSL The SSL protocol. This is a full implmentation of SSL v 2. It
180 support both server and client authentication. SSL v 3 support
181 will be added when the SSL v 3 specification is released in it's
182 final form.
183
184Now quite a few of the above mentioned libraries rely on a few 'complex'
185data structures. For each of these I have a library.
186
187Lhash This is a hash table library which is used extensivly.
188
189STACK An implemetation of a Stack data structure.
190
191BUF A simple character array structure that also support a function to
192 check that the array is greater that a certain size, if it is not,
193 it is realloced so that is it.
194
195TXT_DB A simple memory based text file data base. The application can specify
196 unique indexes that will be enforced at update time.
197
198CONF Most of the programs written for this library require a configuration
199 file. Instead of letting programs constantly re-implment this
200 subsystem, the CONF library provides a consistant and flexable
201 interface to not only configuration files but also environment
202 variables.
203
204But what about when something goes wrong?
205The one advantage (and perhaps disadvantage) of all of these
206functions being in one library was the ability to implement a
207single error reporting system.
208
209ERR This library is used to report errors. The error system records
210 library number, function number (in the library) and reason
211 number. Multiple errors can be reported so that an 'error' trace
212 is created. The errors can be printed in numeric or textual form.
213