diff options
Diffstat (limited to 'src/lib/libc/crypt/blowfish.3')
-rw-r--r-- | src/lib/libc/crypt/blowfish.3 | 84 |
1 files changed, 84 insertions, 0 deletions
diff --git a/src/lib/libc/crypt/blowfish.3 b/src/lib/libc/crypt/blowfish.3 new file mode 100644 index 0000000000..0b45790658 --- /dev/null +++ b/src/lib/libc/crypt/blowfish.3 | |||
@@ -0,0 +1,84 @@ | |||
1 | .\" $OpenBSD: blowfish.3,v 1.1 1997/02/16 20:58:16 provos Exp $ | ||
2 | .\" Copyright 1997 Niels Provos <provos@physnet.uni-hamburg.de> | ||
3 | .\" All rights reserved. | ||
4 | .\" | ||
5 | .\" Redistribution and use in source and binary forms, with or without | ||
6 | .\" modification, are permitted provided that the following conditions | ||
7 | .\" are met: | ||
8 | .\" 1. Redistributions of source code must retain the above copyright | ||
9 | .\" notice, this list of conditions and the following disclaimer. | ||
10 | .\" 2. Redistributions in binary form must reproduce the above copyright | ||
11 | .\" notice, this list of conditions and the following disclaimer in the | ||
12 | .\" documentation and/or other materials provided with the distribution. | ||
13 | .\" 3. All advertising materials mentioning features or use of this software | ||
14 | .\" must display the following acknowledgement: | ||
15 | .\" This product includes software developed by Niels Provos. | ||
16 | .\" 4. The name of the author may not be used to endorse or promote products | ||
17 | .\" derived from this software without specific prior written permission. | ||
18 | .\" | ||
19 | .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR | ||
20 | .\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES | ||
21 | .\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. | ||
22 | .\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, | ||
23 | .\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT | ||
24 | .\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | ||
25 | .\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | ||
26 | .\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
27 | .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF | ||
28 | .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
29 | .\" | ||
30 | .\" Manual page, using -mandoc macros | ||
31 | .\" | ||
32 | .Dd February 13, 1997 | ||
33 | .Dt BLOWFISH 3 | ||
34 | .Os "OpenBSD 2.0" | ||
35 | .Sh NAME | ||
36 | .Nm blf_key, | ||
37 | .Nm blf_enc, | ||
38 | .Nm blf_dec | ||
39 | .Nd Blowfish encryption | ||
40 | .Sh SYNOPSIS | ||
41 | .Fd #include <blf.h> | ||
42 | .Ft void | ||
43 | .Fn blf_key "blf_ctx *state" "const u_int8_t *key" "u_int16_t keylen" | ||
44 | .Ft void | ||
45 | .Fn blf_enc "blf_ctx *state" "u_int32_t *data" "u_int16_t datalen" | ||
46 | .Ft void | ||
47 | .Fn blf_dec "blf_ctx *state" "u_int32_t *data" "u_int16_t datalen" | ||
48 | .Sh DESCRIPTION | ||
49 | .Pa Blowfish | ||
50 | is a fast unpatented block cipher designed by Bruce Schneier. | ||
51 | It basically consists of a 16 times iterated Feistel network. | ||
52 | The block size is 64 bit and the key size is maximal 448 bit. | ||
53 | .Pp | ||
54 | The | ||
55 | .Fn blf_key | ||
56 | function initializes the 4 8bit S-boxes and the 18 Subkeys with | ||
57 | the hexadecimal digits of Pi. The key is used for further randomization. | ||
58 | The first argument to | ||
59 | .Fn blf_enc | ||
60 | is the initalized state derived from | ||
61 | .Fn blf_key . | ||
62 | The stream of data is encrypted in Electronic Cookbook Mode (ECB) and | ||
63 | .Pa datalen | ||
64 | must be even. | ||
65 | .Fn blf_dec | ||
66 | is used for decrypting Blowfish encrypted blocks. | ||
67 | .Pp | ||
68 | The functions | ||
69 | .Fn Blowfish_initstate , | ||
70 | .Fn Blowfish_expand0state , | ||
71 | .Fn Blowfish_expandstate , | ||
72 | .Fn Blowfish_encipher | ||
73 | and | ||
74 | .Fn Blowfish_decipher | ||
75 | are used for customization of the | ||
76 | .Pa Blowfish | ||
77 | cipher, i.e. for the blowfish password hashing function or for | ||
78 | implementation of Cipher Block Chaining Mode (CBC). | ||
79 | .Sh SEE ALSO | ||
80 | .Xr crypt 3 , | ||
81 | .Xr passwd 1 , | ||
82 | .Xr passwd 5 | ||
83 | .Sh AUTHOR | ||
84 | Niels Provos <provos@physnet.uni-hamburg.de> | ||