1 .\" Copyright (c) 1999 - 2004 Kungliga Tekniska Högskolan
2 .\" (Royal Institute of Technology, Stockholm, Sweden).
3 .\" All rights reserved.
5 .\" Redistribution and use in source and binary forms, with or without
6 .\" 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.
12 .\" 2. Redistributions in binary form must reproduce the above copyright
13 .\" notice, this list of conditions and the following disclaimer in the
14 .\" documentation and/or other materials provided with the distribution.
16 .\" 3. Neither the name of the Institute nor the names of its contributors
17 .\" may be used to endorse or promote products derived from this software
18 .\" without specific prior written permission.
20 .\" THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
21 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23 .\" ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
24 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
32 .\" $Heimdal: krb5_encrypt.3 22071 2007-11-14 20:04:50Z lha $
39 .Nm krb5_crypto_getblocksize ,
40 .Nm krb5_crypto_getconfoundersize
41 .Nm krb5_crypto_getenctype ,
42 .Nm krb5_crypto_getpadsize ,
43 .Nm krb5_crypto_overhead ,
45 .Nm krb5_decrypt_EncryptedData ,
46 .Nm krb5_decrypt_ivec ,
47 .Nm krb5_decrypt_ticket ,
49 .Nm krb5_encrypt_EncryptedData ,
50 .Nm krb5_encrypt_ivec ,
51 .Nm krb5_enctype_disable ,
52 .Nm krb5_enctype_keysize ,
53 .Nm krb5_enctype_to_string ,
54 .Nm krb5_enctype_valid ,
55 .Nm krb5_get_wrapped_length ,
56 .Nm krb5_string_to_enctype
57 .Nd "encrypt and decrypt data, set and get encryption type parameters"
59 Kerberos 5 Library (libkrb5, -lkrb5)
64 .Fa "krb5_context context"
65 .Fa "krb5_crypto crypto"
69 .Fa "krb5_data *result"
72 .Fo krb5_encrypt_EncryptedData
73 .Fa "krb5_context context"
74 .Fa "krb5_crypto crypto"
79 .Fa "EncryptedData *result"
83 .Fa "krb5_context context"
84 .Fa "krb5_crypto crypto"
88 .Fa "krb5_data *result"
93 .Fa "krb5_context context"
94 .Fa "krb5_crypto crypto"
98 .Fa "krb5_data *result"
101 .Fo krb5_decrypt_EncryptedData
102 .Fa "krb5_context context"
103 .Fa "krb5_crypto crypto"
105 .Fa "EncryptedData *e"
106 .Fa "krb5_data *result"
109 .Fo krb5_decrypt_ivec
110 .Fa "krb5_context context"
111 .Fa "krb5_crypto crypto"
115 .Fa "krb5_data *result"
119 .Fo krb5_decrypt_ticket
120 .Fa "krb5_context context"
122 .Fa "krb5_keyblock *key"
123 .Fa "EncTicketPart *out"
124 .Fa "krb5_flags flags"
127 .Fo krb5_crypto_getblocksize
128 .Fa "krb5_context context"
129 .Fa "size_t *blocksize"
132 .Fo krb5_crypto_getenctype
133 .Fa "krb5_context context"
134 .Fa "krb5_crypto crypto"
135 .Fa "krb5_enctype *enctype"
138 .Fo krb5_crypto_getpadsize
139 .Fa "krb5_context context"
143 .Fo krb5_crypto_getconfoundersize
144 .Fa "krb5_context context"
145 .Fa "krb5_crypto crypto
146 .Fa size_t *confoundersize"
149 .Fo krb5_enctype_keysize
150 .Fa "krb5_context context"
151 .Fa "krb5_enctype type"
152 .Fa "size_t *keysize"
155 .Fo krb5_crypto_overhead
156 .Fa "krb5_context context"
160 .Fo krb5_string_to_enctype
161 .Fa "krb5_context context"
162 .Fa "const char *string"
163 .Fa "krb5_enctype *etype"
166 .Fo krb5_enctype_to_string
167 .Fa "krb5_context context"
168 .Fa "krb5_enctype etype"
172 .Fo krb5_enctype_valid
173 .Fa "krb5_context context"
174 .Fa "krb5_enctype etype"
177 .Fo krb5_enctype_disable
178 .Fa "krb5_context context"
179 .Fa "krb5_enctype etype"
182 .Fo krb5_get_wrapped_length
183 .Fa "krb5_context context"
184 .Fa "krb5_crypto crypto"
185 .Fa "size_t data_len"
188 These functions are used to encrypt and decrypt data.
190 .Fn krb5_encrypt_ivec
191 puts the encrypted version of
197 If the encryption type supports using derived keys,
199 should be the appropriate key-usage.
201 is a pointer to a initial IV, it is modified to the end IV at the end of
203 Ivec should be the size of
206 is passed in, the default IV is used.
209 .Fn krb5_encrypt_ivec
214 .Fn krb5_encrypt_EncryptedData
217 but it puts the encrypted data in a
219 structure instead. If
221 is not zero, it will be put in the (optional)
226 .Fn krb5_decrypt_ivec ,
229 .Fn krb5_decrypt_EncryptedData
232 .Fn krb5_decrypt_ticket
233 decrypts the encrypted part of
237 .Fn krb5_decrypt_ticket
238 also verifies the timestamp in the ticket, invalid flag and if the KDC
239 haven't verified the transited path, the transit path.
241 .Fn krb5_enctype_keysize ,
242 .Fn krb5_crypto_getconfoundersize ,
243 .Fn krb5_crypto_getblocksize ,
244 .Fn krb5_crypto_getenctype ,
245 .Fn krb5_crypto_getpadsize ,
246 .Fn krb5_crypto_overhead
247 all returns various (sometimes) useful information from a crypto context.
248 .Fn krb5_crypto_overhead
249 is the combination of krb5_crypto_getconfoundersize,
250 krb5_crypto_getblocksize and krb5_crypto_getpadsize and return the
251 maximum overhead size.
253 .Fn krb5_enctype_to_string
254 converts a encryption type number to a string that can be printable
255 and stored. The strings returned should be freed with
258 .Fn krb5_string_to_enctype
259 converts a encryption type strings to a encryption type number that
260 can use used for other Kerberos crypto functions.
262 .Fn krb5_enctype_valid
263 returns 0 if the encrypt is supported and not disabled, otherwise and
264 error code is returned.
266 .Fn krb5_enctype_disable
267 (globally, for all contextes) disables the
270 .Fn krb5_get_wrapped_length
271 returns the size of an encrypted packet by
278 .Xr krb5_create_checksum 3 ,
279 .Xr krb5_crypto_init 3