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