xref: /freebsd/crypto/heimdal/lib/krb5/krb5_create_checksum.3 (revision 5521ff5a4d1929056e7ffc982fac3341ca54df7c)
1.\" Copyright (c) 1999 Kungliga Tekniska H�gskolan
2.\" $Id: krb5_create_checksum.3,v 1.2 2001/01/26 22:43:21 assar Exp $
3.Dd April  7, 1999
4.Dt NAME 3
5.Os HEIMDAL
6.Sh NAME
7.Nm krb5_checksum_is_collision_proof ,
8.Nm krb5_checksum_is_keyed ,
9.Nm krb5_checksumsize ,
10.Nm krb5_create_checksum ,
11.Nm krb5_verify_checksum
12.Nd creates and verifies checksums
13.Sh SYNOPSIS
14.Fd #include <krb5.h>
15.Ft krb5_error_code
16.Fn krb5_create_checksum "krb5_context context" "krb5_crypto crypto" "unsigned usage_or_type" "void *data" "size_t len" "Checksum *result"
17.Ft krb5_error_code
18.Fn krb5_verify_checksum "krb5_context context" "krb5_crypto crypto" "krb5_key_usage usage" "void *data" "size_t len" "Checksum *cksum"
19.Ft krb5_boolean
20.Fn krb5_checksum_is_collision_proof "krb5_context context" "krb5_cksumtype type"
21.Ft krb5_boolean
22.Fn krb5_checksum_is_keyed "krb5_context context" "krb5_cksumtype type"
23.Sh DESCRIPTION
24These functions are used to create and verify checksums.
25.Fn krb5_create_checksum
26creates a checksum of the specified data, and puts it in
27.Fa result .
28If
29.Fa crypto
30is
31.Dv NULL ,
32.Fa usage_or_type
33specifies the checksum type to use; it must not be keyed. Otherwise
34.Fa crypto
35is an encryption context created by
36.Fn krb5_crypto_init ,
37and
38.Fa usage_or_type
39specifies a key-usage.
40.Pp
41.Fn krb5_verify_checksum
42verifies the
43.Fa checksum ,
44against the provided data.
45.Pp
46.Fn krb5_checksum_is_collision_proof
47returns true is the specified checksum is collision proof (that it's
48very unlikely that two strings has the same hash value, and that it's
49hard to find two strings that has the same hash). Examples of
50collision proof checksums are MD5, and SHA1, while CRC32 is not.
51.Pp
52.Fn krb5_checksum_is_keyed
53returns true if the specified checksum type is keyed (that the hash
54value is a function of both the data, and a separate key). Examples of
55keyed hash algorithms are HMAC-SHA1-DES3, and RSA-MD5-DES. The
56.Dq plain
57hash functions MD5, and SHA1 are not keyed.
58.\" .Sh EXAMPLE
59.\" .Sh BUGS
60.Sh SEE ALSO
61.Xr krb5_crypto_init 3 ,
62.Xr krb5_encrypt 3
63