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
38 .Nm krb5_crypto_getblocksize ,
39 .Nm krb5_crypto_getconfoundersize
40 .Nm krb5_crypto_getenctype ,
41 .Nm krb5_crypto_getpadsize ,
42 .Nm krb5_crypto_overhead ,
44 .Nm krb5_decrypt_EncryptedData ,
45 .Nm krb5_decrypt_ivec ,
46 .Nm krb5_decrypt_ticket ,
48 .Nm krb5_encrypt_EncryptedData ,
49 .Nm krb5_encrypt_ivec ,
50 .Nm krb5_enctype_disable ,
51 .Nm krb5_enctype_keysize ,
52 .Nm krb5_enctype_to_string ,
53 .Nm krb5_enctype_valid ,
54 .Nm krb5_get_wrapped_length ,
55 .Nm krb5_string_to_enctype
56 .Nd "encrypt and decrypt data, set and get encryption type parameters"
58 Kerberos 5 Library (libkrb5, -lkrb5)
63 .Fa "krb5_context context"
64 .Fa "krb5_crypto crypto"
68 .Fa "krb5_data *result"
71 .Fo krb5_encrypt_EncryptedData
72 .Fa "krb5_context context"
73 .Fa "krb5_crypto crypto"
78 .Fa "EncryptedData *result"
82 .Fa "krb5_context context"
83 .Fa "krb5_crypto crypto"
87 .Fa "krb5_data *result"
92 .Fa "krb5_context context"
93 .Fa "krb5_crypto crypto"
97 .Fa "krb5_data *result"
100 .Fo krb5_decrypt_EncryptedData
101 .Fa "krb5_context context"
102 .Fa "krb5_crypto crypto"
104 .Fa "EncryptedData *e"
105 .Fa "krb5_data *result"
108 .Fo krb5_decrypt_ivec
109 .Fa "krb5_context context"
110 .Fa "krb5_crypto crypto"
114 .Fa "krb5_data *result"
118 .Fo krb5_decrypt_ticket
119 .Fa "krb5_context context"
121 .Fa "krb5_keyblock *key"
122 .Fa "EncTicketPart *out"
123 .Fa "krb5_flags flags"
126 .Fo krb5_crypto_getblocksize
127 .Fa "krb5_context context"
128 .Fa "size_t *blocksize"
131 .Fo krb5_crypto_getenctype
132 .Fa "krb5_context context"
133 .Fa "krb5_crypto crypto"
134 .Fa "krb5_enctype *enctype"
137 .Fo krb5_crypto_getpadsize
138 .Fa "krb5_context context"
142 .Fo krb5_crypto_getconfoundersize
143 .Fa "krb5_context context"
144 .Fa "krb5_crypto crypto"
145 .Fa size_t *confoundersize"
148 .Fo krb5_enctype_keysize
149 .Fa "krb5_context context"
150 .Fa "krb5_enctype type"
151 .Fa "size_t *keysize"
154 .Fo krb5_crypto_overhead
155 .Fa "krb5_context context"
159 .Fo krb5_string_to_enctype
160 .Fa "krb5_context context"
161 .Fa "const char *string"
162 .Fa "krb5_enctype *etype"
165 .Fo krb5_enctype_to_string
166 .Fa "krb5_context context"
167 .Fa "krb5_enctype etype"
171 .Fo krb5_enctype_valid
172 .Fa "krb5_context context"
173 .Fa "krb5_enctype etype"
176 .Fo krb5_enctype_disable
177 .Fa "krb5_context context"
178 .Fa "krb5_enctype etype"
181 .Fo krb5_get_wrapped_length
182 .Fa "krb5_context context"
183 .Fa "krb5_crypto crypto"
184 .Fa "size_t data_len"
187 These functions are used to encrypt and decrypt data.
189 .Fn krb5_encrypt_ivec
190 puts the encrypted version of
196 If the encryption type supports using derived keys,
198 should be the appropriate key-usage.
200 is a pointer to a initial IV, it is modified to the end IV at the end of
202 Ivec should be the size of
205 is passed in, the default IV is used.
208 .Fn krb5_encrypt_ivec
213 .Fn krb5_encrypt_EncryptedData
216 but it puts the encrypted data in a
218 structure instead. If
220 is not zero, it will be put in the (optional)
225 .Fn krb5_decrypt_ivec ,
228 .Fn krb5_decrypt_EncryptedData
231 .Fn krb5_decrypt_ticket
232 decrypts the encrypted part of
236 .Fn krb5_decrypt_ticket
237 also verifies the timestamp in the ticket, invalid flag and if the KDC
238 haven't verified the transited path, the transit path.
240 .Fn krb5_enctype_keysize ,
241 .Fn krb5_crypto_getconfoundersize ,
242 .Fn krb5_crypto_getblocksize ,
243 .Fn krb5_crypto_getenctype ,
244 .Fn krb5_crypto_getpadsize ,
245 .Fn krb5_crypto_overhead
246 all returns various (sometimes) useful information from a crypto context.
247 .Fn krb5_crypto_overhead
248 is the combination of krb5_crypto_getconfoundersize,
249 krb5_crypto_getblocksize and krb5_crypto_getpadsize and return the
250 maximum overhead size.
252 .Fn krb5_enctype_to_string
253 converts a encryption type number to a string that can be printable
254 and stored. The strings returned should be freed with
257 .Fn krb5_string_to_enctype
258 converts a encryption type strings to a encryption type number that
259 can use used for other Kerberos crypto functions.
261 .Fn krb5_enctype_valid
262 returns 0 if the encrypt is supported and not disabled, otherwise and
263 error code is returned.
265 .Fn krb5_enctype_disable
266 (globally, for all contextes) disables the
269 .Fn krb5_get_wrapped_length
270 returns the size of an encrypted packet by
277 .Xr krb5_create_checksum 3 ,
278 .Xr krb5_crypto_init 3