xref: /freebsd/crypto/openssl/doc/man3/MD5.pod (revision a03411e84728e9b267056fd31c7d1d9d1dc1b01e)
1=pod
2
3=head1 NAME
4
5MD2, MD4, MD5, MD2_Init, MD2_Update, MD2_Final, MD4_Init, MD4_Update,
6MD4_Final, MD5_Init, MD5_Update, MD5_Final - MD2, MD4, and MD5 hash functions
7
8=head1 SYNOPSIS
9
10 #include <openssl/md2.h>
11
12The following functions have been deprecated since OpenSSL 3.0, and can be
13hidden entirely by defining B<OPENSSL_API_COMPAT> with a suitable version value,
14see L<openssl_user_macros(7)>:
15
16 unsigned char *MD2(const unsigned char *d, unsigned long n, unsigned char *md);
17
18 int MD2_Init(MD2_CTX *c);
19 int MD2_Update(MD2_CTX *c, const unsigned char *data, unsigned long len);
20 int MD2_Final(unsigned char *md, MD2_CTX *c);
21
22
23 #include <openssl/md4.h>
24
25The following functions have been deprecated since OpenSSL 3.0, and can be
26hidden entirely by defining B<OPENSSL_API_COMPAT> with a suitable version value,
27see L<openssl_user_macros(7)>:
28
29 unsigned char *MD4(const unsigned char *d, unsigned long n, unsigned char *md);
30
31 int MD4_Init(MD4_CTX *c);
32 int MD4_Update(MD4_CTX *c, const void *data, unsigned long len);
33 int MD4_Final(unsigned char *md, MD4_CTX *c);
34
35
36 #include <openssl/md5.h>
37
38The following functions have been deprecated since OpenSSL 3.0, and can be
39hidden entirely by defining B<OPENSSL_API_COMPAT> with a suitable version value,
40see L<openssl_user_macros(7)>:
41
42 unsigned char *MD5(const unsigned char *d, unsigned long n, unsigned char *md);
43
44 int MD5_Init(MD5_CTX *c);
45 int MD5_Update(MD5_CTX *c, const void *data, unsigned long len);
46 int MD5_Final(unsigned char *md, MD5_CTX *c);
47
48=head1 DESCRIPTION
49
50All of the functions described on this page are deprecated.
51Applications should instead use L<EVP_DigestInit_ex(3)>, L<EVP_DigestUpdate(3)>
52and L<EVP_DigestFinal_ex(3)>.
53
54MD2, MD4, and MD5 are cryptographic hash functions with a 128 bit output.
55
56MD2(), MD4(), and MD5() compute the MD2, MD4, and MD5 message digest
57of the B<n> bytes at B<d> and place it in B<md> (which must have space
58for MD2_DIGEST_LENGTH == MD4_DIGEST_LENGTH == MD5_DIGEST_LENGTH == 16
59bytes of output). If B<md> is NULL, the digest is placed in a static
60array.
61
62The following functions may be used if the message is not completely
63stored in memory:
64
65MD2_Init() initializes a B<MD2_CTX> structure.
66
67MD2_Update() can be called repeatedly with chunks of the message to
68be hashed (B<len> bytes at B<data>).
69
70MD2_Final() places the message digest in B<md>, which must have space
71for MD2_DIGEST_LENGTH == 16 bytes of output, and erases the B<MD2_CTX>.
72
73MD4_Init(), MD4_Update(), MD4_Final(), MD5_Init(), MD5_Update(), and
74MD5_Final() are analogous using an B<MD4_CTX> and B<MD5_CTX> structure.
75
76Applications should use the higher level functions
77L<EVP_DigestInit(3)>
78etc. instead of calling the hash functions directly.
79
80=head1 NOTE
81
82MD2, MD4, and MD5 are recommended only for compatibility with existing
83applications. In new applications, hashes from the SHA-2 or SHA-3 family
84should be preferred.
85
86=head1 RETURN VALUES
87
88MD2(), MD4(), and MD5() return pointers to the hash value.
89
90MD2_Init(), MD2_Update(), MD2_Final(), MD4_Init(), MD4_Update(),
91MD4_Final(), MD5_Init(), MD5_Update(), and MD5_Final() return 1 for
92success, 0 otherwise.
93
94=head1 CONFORMING TO
95
96RFC 1319, RFC 1320, RFC 1321
97
98=head1 SEE ALSO
99
100L<EVP_DigestInit(3)>, L<EVP_MD-SHA2(7)>, L<EVP_MD-SHA3(7)>
101
102=head1 HISTORY
103
104All of these functions were deprecated in OpenSSL 3.0.
105
106=head1 COPYRIGHT
107
108Copyright 2000-2023 The OpenSSL Project Authors. All Rights Reserved.
109
110Licensed under the Apache License 2.0 (the "License").  You may not use
111this file except in compliance with the License.  You can obtain a copy
112in the file LICENSE in the source distribution or at
113L<https://www.openssl.org/source/license.html>.
114
115=cut
116