1 .\" $NetBSD: krb5_encrypt.3,v 1.1.1.3 2014/04/24 12:45:50 pettai Exp $
3 .\" Copyright (c) 1999 - 2004 Kungliga Tekniska Högskolan
4 .\" (Royal Institute of Technology, Stockholm, Sweden).
5 .\" All rights reserved.
7 .\" Redistribution and use in source and binary forms, with or without
8 .\" modification, are permitted provided that the following conditions
11 .\" 1. Redistributions of source code must retain the above copyright
12 .\" notice, this list of conditions and the following disclaimer.
14 .\" 2. Redistributions in binary form must reproduce the above copyright
15 .\" notice, this list of conditions and the following disclaimer in the
16 .\" documentation and/or other materials provided with the distribution.
18 .\" 3. Neither the name of the Institute nor the names of its contributors
19 .\" may be used to endorse or promote products derived from this software
20 .\" without specific prior written permission.
22 .\" THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
23 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
24 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
25 .\" ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
26 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
27 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
28 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
29 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
31 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
40 .Nm krb5_crypto_getblocksize ,
41 .Nm krb5_crypto_getconfoundersize
42 .Nm krb5_crypto_getenctype ,
43 .Nm krb5_crypto_getpadsize ,
44 .Nm krb5_crypto_overhead ,
46 .Nm krb5_decrypt_EncryptedData ,
47 .Nm krb5_decrypt_ivec ,
48 .Nm krb5_decrypt_ticket ,
50 .Nm krb5_encrypt_EncryptedData ,
51 .Nm krb5_encrypt_ivec ,
52 .Nm krb5_enctype_disable ,
53 .Nm krb5_enctype_keysize ,
54 .Nm krb5_enctype_to_string ,
55 .Nm krb5_enctype_valid ,
56 .Nm krb5_get_wrapped_length ,
57 .Nm krb5_string_to_enctype
58 .Nd "encrypt and decrypt data, set and get encryption type parameters"
60 Kerberos 5 Library (libkrb5, -lkrb5)
65 .Fa "krb5_context context"
66 .Fa "krb5_crypto crypto"
70 .Fa "krb5_data *result"
73 .Fo krb5_encrypt_EncryptedData
74 .Fa "krb5_context context"
75 .Fa "krb5_crypto crypto"
80 .Fa "EncryptedData *result"
84 .Fa "krb5_context context"
85 .Fa "krb5_crypto crypto"
89 .Fa "krb5_data *result"
94 .Fa "krb5_context context"
95 .Fa "krb5_crypto crypto"
99 .Fa "krb5_data *result"
102 .Fo krb5_decrypt_EncryptedData
103 .Fa "krb5_context context"
104 .Fa "krb5_crypto crypto"
106 .Fa "EncryptedData *e"
107 .Fa "krb5_data *result"
110 .Fo krb5_decrypt_ivec
111 .Fa "krb5_context context"
112 .Fa "krb5_crypto crypto"
116 .Fa "krb5_data *result"
120 .Fo krb5_decrypt_ticket
121 .Fa "krb5_context context"
123 .Fa "krb5_keyblock *key"
124 .Fa "EncTicketPart *out"
125 .Fa "krb5_flags flags"
128 .Fo krb5_crypto_getblocksize
129 .Fa "krb5_context context"
130 .Fa "size_t *blocksize"
133 .Fo krb5_crypto_getenctype
134 .Fa "krb5_context context"
135 .Fa "krb5_crypto crypto"
136 .Fa "krb5_enctype *enctype"
139 .Fo krb5_crypto_getpadsize
140 .Fa "krb5_context context"
144 .Fo krb5_crypto_getconfoundersize
145 .Fa "krb5_context context"
146 .Fa "krb5_crypto crypto"
147 .Fa size_t *confoundersize"
150 .Fo krb5_enctype_keysize
151 .Fa "krb5_context context"
152 .Fa "krb5_enctype type"
153 .Fa "size_t *keysize"
156 .Fo krb5_crypto_overhead
157 .Fa "krb5_context context"
161 .Fo krb5_string_to_enctype
162 .Fa "krb5_context context"
163 .Fa "const char *string"
164 .Fa "krb5_enctype *etype"
167 .Fo krb5_enctype_to_string
168 .Fa "krb5_context context"
169 .Fa "krb5_enctype etype"
173 .Fo krb5_enctype_valid
174 .Fa "krb5_context context"
175 .Fa "krb5_enctype etype"
178 .Fo krb5_enctype_disable
179 .Fa "krb5_context context"
180 .Fa "krb5_enctype etype"
183 .Fo krb5_get_wrapped_length
184 .Fa "krb5_context context"
185 .Fa "krb5_crypto crypto"
186 .Fa "size_t data_len"
189 These functions are used to encrypt and decrypt data.
191 .Fn krb5_encrypt_ivec
192 puts the encrypted version of
198 If the encryption type supports using derived keys,
200 should be the appropriate key-usage.
202 is a pointer to a initial IV, it is modified to the end IV at the end of
204 Ivec should be the size of
207 is passed in, the default IV is used.
210 .Fn krb5_encrypt_ivec
215 .Fn krb5_encrypt_EncryptedData
218 but it puts the encrypted data in a
220 structure instead. If
222 is not zero, it will be put in the (optional)
227 .Fn krb5_decrypt_ivec ,
230 .Fn krb5_decrypt_EncryptedData
233 .Fn krb5_decrypt_ticket
234 decrypts the encrypted part of
238 .Fn krb5_decrypt_ticket
239 also verifies the timestamp in the ticket, invalid flag and if the KDC
240 haven't verified the transited path, the transit path.
242 .Fn krb5_enctype_keysize ,
243 .Fn krb5_crypto_getconfoundersize ,
244 .Fn krb5_crypto_getblocksize ,
245 .Fn krb5_crypto_getenctype ,
246 .Fn krb5_crypto_getpadsize ,
247 .Fn krb5_crypto_overhead
248 all returns various (sometimes) useful information from a crypto context.
249 .Fn krb5_crypto_overhead
250 is the combination of krb5_crypto_getconfoundersize,
251 krb5_crypto_getblocksize and krb5_crypto_getpadsize and return the
252 maximum overhead size.
254 .Fn krb5_enctype_to_string
255 converts a encryption type number to a string that can be printable
256 and stored. The strings returned should be freed with
259 .Fn krb5_string_to_enctype
260 converts a encryption type strings to a encryption type number that
261 can use used for other Kerberos crypto functions.
263 .Fn krb5_enctype_valid
264 returns 0 if the encrypt is supported and not disabled, otherwise and
265 error code is returned.
267 .Fn krb5_enctype_disable
268 (globally, for all contextes) disables the
271 .Fn krb5_get_wrapped_length
272 returns the size of an encrypted packet by
279 .Xr krb5_create_checksum 3 ,
280 .Xr krb5_crypto_init 3