1 .\" FreeSec: libcrypt for NetBSD
3 .\" Copyright (c) 1994 David Burren
4 .\" All rights reserved.
6 .\" Redistribution and use in source and binary forms, with or without
7 .\" modification, are permitted provided that the following conditions
9 .\" 1. Redistributions of source code must retain the above copyright
10 .\" notice, this list of conditions and the following disclaimer.
11 .\" 2. Redistributions in binary form must reproduce the above copyright
12 .\" notice, this list of conditions and the following disclaimer in the
13 .\" documentation and/or other materials provided with the distribution.
14 .\" 4. Neither the name of the author nor the names of other contributors
15 .\" may be used to endorse or promote products derived from this software
16 .\" without specific prior written permission.
18 .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
19 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21 .\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
22 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
24 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
25 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
26 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
27 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30 .\" $FreeBSD: src/secure/lib/libcipher/cipher.3,v 1.6.2.3 2001/12/14 15:21:13 ru Exp $
31 .\" $DragonFly: src/secure/lib/libcipher/cipher.3,v 1.2 2003/06/17 04:27:48 dillon Exp $
33 .\" Manual page, using -mandoc macros
49 .Fn setkey "const char *key"
51 .Fn encrypt "char *block" "int flag"
53 .Fn des_setkey "const char *key"
55 .Fn des_cipher "const char *in" "char *out" "long salt" "int count"
67 is passed a 64-byte array of binary values (numeric 0 or 1).
68 A 56-bit key is extracted from this array by dividing the
69 array into groups of 8, and ignoring the last bit in each group.
70 That bit is reserved for a byte parity check by DES, but is ignored
77 is also a 64-byte array of binary values.
82 is encrypted otherwise it is decrypted.
83 The result is returned in the original array
85 after using the key specified by
91 is a character array of length 8.
92 The least significant bit (the parity bit) in each character is ignored,
93 and the remaining bits are concatenated to form a 56-bit key.
96 encrypts (or decrypts if
98 is negative) the 64-bits stored in the 8 characters at
106 and stores the 64-bit result in the 8 characters at
108 (which may be the same as
112 introduces disorder in the
114 algorithm in one of 16777216 or 4096 possible ways
115 (ie. with 24 or 12 bits: if bit
133 return 0 on success and 1 on failure.
139 functions manipulate the same key space.
147 This library (FreeSec 1.0) was developed outside the United States of America
148 as an unencumbered replacement for the U.S.-only
152 Users should be aware that this code (and programs statically linked with it)
153 may not be exported from the U.S., although it apparently can be imported.
155 .An David Burren Aq davidb@werj.com.au