1KRB5_ENCRYPT(3)          BSD Library Functions Manual          KRB5_ENCRYPT(3)
2

NAME

4     krb5_crypto_getblocksize, krb5_crypto_getconfoundersize
5     krb5_crypto_getenctype, krb5_crypto_getpadsize, krb5_crypto_overhead,
6     krb5_decrypt, krb5_decrypt_EncryptedData, krb5_decrypt_ivec,
7     krb5_decrypt_ticket, krb5_encrypt, krb5_encrypt_EncryptedData,
8     krb5_encrypt_ivec, krb5_enctype_disable, krb5_enctype_keysize,
9     krb5_enctype_to_string, krb5_enctype_valid, krb5_get_wrapped_length,
10     krb5_string_to_enctype — encrypt and decrypt data, set and get encryption
11     type parameters
12

LIBRARY

14     Kerberos 5 Library (libkrb5, -lkrb5)
15

SYNOPSIS

17     #include <krb5.h>
18
19     krb5_error_code
20     krb5_encrypt(krb5_context context, krb5_crypto crypto, unsigned usage,
21         void *data, size_t len, krb5_data *result);
22
23     krb5_error_code
24     krb5_encrypt_EncryptedData(krb5_context context, krb5_crypto crypto,
25         unsigned usage, void *data, size_t len, int kvno,
26         EncryptedData *result);
27
28     krb5_error_code
29     krb5_encrypt_ivec(krb5_context context, krb5_crypto crypto,
30         unsigned usage, void *data, size_t len, krb5_data *result,
31         void *ivec);
32
33     krb5_error_code
34     krb5_decrypt(krb5_context context, krb5_crypto crypto, unsigned usage,
35         void *data, size_t len, krb5_data *result);
36
37     krb5_error_code
38     krb5_decrypt_EncryptedData(krb5_context context, krb5_crypto crypto,
39         unsigned usage, EncryptedData *e, krb5_data *result);
40
41     krb5_error_code
42     krb5_decrypt_ivec(krb5_context context, krb5_crypto crypto,
43         unsigned usage, void *data, size_t len, krb5_data *result,
44         void *ivec);
45
46     krb5_error_code
47     krb5_decrypt_ticket(krb5_context context, Ticket *ticket,
48         krb5_keyblock *key, EncTicketPart *out, krb5_flags flags);
49
50     krb5_error_code
51     krb5_crypto_getblocksize(krb5_context context, size_t *blocksize);
52
53     krb5_error_code
54     krb5_crypto_getenctype(krb5_context context, krb5_crypto crypto,
55         krb5_enctype *enctype);
56
57     krb5_error_code
58     krb5_crypto_getpadsize(krb5_context context, size_t, *padsize");
59
60     krb5_error_code
61     krb5_crypto_getconfoundersize(krb5_context context, krb5_crypto crypto,
62         size_t, *confoundersize");
63
64     krb5_error_code
65     krb5_enctype_keysize(krb5_context context, krb5_enctype type,
66         size_t *keysize);
67
68     krb5_error_code
69     krb5_crypto_overhead(krb5_context context, size_t, *padsize");
70
71     krb5_error_code
72     krb5_string_to_enctype(krb5_context context, const char *string,
73         krb5_enctype *etype);
74
75     krb5_error_code
76     krb5_enctype_to_string(krb5_context context, krb5_enctype etype,
77         char **string);
78
79     krb5_error_code
80     krb5_enctype_valid(krb5_context context, krb5_enctype etype);
81
82     void
83     krb5_enctype_disable(krb5_context context, krb5_enctype etype);
84
85     size_t
86     krb5_get_wrapped_length(krb5_context context, krb5_crypto crypto,
87         size_t data_len);
88

DESCRIPTION

90     These functions are used to encrypt and decrypt data.
91
92     krb5_encrypt_ivec() puts the encrypted version of data (of size len) in
93     result.  If the encryption type supports using derived keys, usage should
94     be the appropriate key-usage.  ivec is a pointer to a initial IV, it is
95     modified to the end IV at the end of the round.  Ivec should be the size
96     of If NULL is passed in, the default IV is used.  krb5_encrypt() does the
97     same as krb5_encrypt_ivec() but with ivec being NULL.
98     krb5_encrypt_EncryptedData() does the same as krb5_encrypt(), but it puts
99     the encrypted data in a EncryptedData structure instead. If kvno is not
100     zero, it will be put in the (optional) kvno field in the EncryptedData.
101
102     krb5_decrypt_ivec(), krb5_decrypt(), and krb5_decrypt_EncryptedData()
103     works similarly.
104
105     krb5_decrypt_ticket() decrypts the encrypted part of ticket with key.
106     krb5_decrypt_ticket() also verifies the timestamp in the ticket, invalid
107     flag and if the KDC haven't verified the transited path, the transit
108     path.
109
110     krb5_enctype_keysize(), krb5_crypto_getconfoundersize(),
111     krb5_crypto_getblocksize(), krb5_crypto_getenctype(),
112     krb5_crypto_getpadsize(), krb5_crypto_overhead() all returns various
113     (sometimes) useful information from a crypto context.
114     krb5_crypto_overhead() is the combination of krb5_crypto_getconfounder‐
115     size, krb5_crypto_getblocksize and krb5_crypto_getpadsize and return the
116     maximum overhead size.
117
118     krb5_enctype_to_string() converts a encryption type number to a string
119     that can be printable and stored. The strings returned should be freed
120     with free(3).
121
122     krb5_string_to_enctype() converts a encryption type strings to a encryp‐
123     tion type number that can use used for other Kerberos crypto functions.
124
125     krb5_enctype_valid() returns 0 if the encrypt is supported and not dis‐
126     abled, otherwise and error code is returned.
127
128     krb5_enctype_disable() (globally, for all contextes) disables the
129     enctype.
130
131     krb5_get_wrapped_length() returns the size of an encrypted packet by
132     crypto of length data_len.
133

SEE ALSO

135     krb5_create_checksum(3), krb5_crypto_init(3)
136
137HEIMDAL                         March 20, 2004                         HEIMDAL
Impressum