MD5.3ossl 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168
  1. .\" -*- mode: troff; coding: utf-8 -*-
  2. .\" Automatically generated by Pod::Man 5.01 (Pod::Simple 3.43)
  3. .\"
  4. .\" Standard preamble:
  5. .\" ========================================================================
  6. .de Sp \" Vertical space (when we can't use .PP)
  7. .if t .sp .5v
  8. .if n .sp
  9. ..
  10. .de Vb \" Begin verbatim text
  11. .ft CW
  12. .nf
  13. .ne \\$1
  14. ..
  15. .de Ve \" End verbatim text
  16. .ft R
  17. .fi
  18. ..
  19. .\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>.
  20. .ie n \{\
  21. . ds C` ""
  22. . ds C' ""
  23. 'br\}
  24. .el\{\
  25. . ds C`
  26. . ds C'
  27. 'br\}
  28. .\"
  29. .\" Escape single quotes in literal strings from groff's Unicode transform.
  30. .ie \n(.g .ds Aq \(aq
  31. .el .ds Aq '
  32. .\"
  33. .\" If the F register is >0, we'll generate index entries on stderr for
  34. .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index
  35. .\" entries marked with X<> in POD. Of course, you'll have to process the
  36. .\" output yourself in some meaningful fashion.
  37. .\"
  38. .\" Avoid warning from groff about undefined register 'F'.
  39. .de IX
  40. ..
  41. .nr rF 0
  42. .if \n(.g .if rF .nr rF 1
  43. .if (\n(rF:(\n(.g==0)) \{\
  44. . if \nF \{\
  45. . de IX
  46. . tm Index:\\$1\t\\n%\t"\\$2"
  47. ..
  48. . if !\nF==2 \{\
  49. . nr % 0
  50. . nr F 2
  51. . \}
  52. . \}
  53. .\}
  54. .rr rF
  55. .\" ========================================================================
  56. .\"
  57. .IX Title "MD5 3ossl"
  58. .TH MD5 3ossl 2025-01-17 3.4.0 OpenSSL
  59. .\" For nroff, turn off justification. Always turn off hyphenation; it makes
  60. .\" way too many mistakes in technical documents.
  61. .if n .ad l
  62. .nh
  63. .SH NAME
  64. MD2, MD4, MD5, MD2_Init, MD2_Update, MD2_Final, MD4_Init, MD4_Update,
  65. MD4_Final, MD5_Init, MD5_Update, MD5_Final \- MD2, MD4, and MD5 hash functions
  66. .SH SYNOPSIS
  67. .IX Header "SYNOPSIS"
  68. The following functions have been deprecated since OpenSSL 3.0, and can be
  69. hidden entirely by defining \fBOPENSSL_API_COMPAT\fR with a suitable version value,
  70. see \fBopenssl_user_macros\fR\|(7):
  71. .PP
  72. .Vb 1
  73. \& #include <openssl/md2.h>
  74. \&
  75. \& unsigned char *MD2(const unsigned char *d, unsigned long n, unsigned char *md);
  76. \&
  77. \& int MD2_Init(MD2_CTX *c);
  78. \& int MD2_Update(MD2_CTX *c, const unsigned char *data, unsigned long len);
  79. \& int MD2_Final(unsigned char *md, MD2_CTX *c);
  80. .Ve
  81. .PP
  82. The following functions have been deprecated since OpenSSL 3.0, and can be
  83. hidden entirely by defining \fBOPENSSL_API_COMPAT\fR with a suitable version value,
  84. see \fBopenssl_user_macros\fR\|(7):
  85. .PP
  86. .Vb 1
  87. \& #include <openssl/md4.h>
  88. \&
  89. \& unsigned char *MD4(const unsigned char *d, unsigned long n, unsigned char *md);
  90. \&
  91. \& int MD4_Init(MD4_CTX *c);
  92. \& int MD4_Update(MD4_CTX *c, const void *data, unsigned long len);
  93. \& int MD4_Final(unsigned char *md, MD4_CTX *c);
  94. .Ve
  95. .PP
  96. The following functions have been deprecated since OpenSSL 3.0, and can be
  97. hidden entirely by defining \fBOPENSSL_API_COMPAT\fR with a suitable version value,
  98. see \fBopenssl_user_macros\fR\|(7):
  99. .PP
  100. .Vb 1
  101. \& #include <openssl/md5.h>
  102. \&
  103. \& unsigned char *MD5(const unsigned char *d, unsigned long n, unsigned char *md);
  104. \&
  105. \& int MD5_Init(MD5_CTX *c);
  106. \& int MD5_Update(MD5_CTX *c, const void *data, unsigned long len);
  107. \& int MD5_Final(unsigned char *md, MD5_CTX *c);
  108. .Ve
  109. .SH DESCRIPTION
  110. .IX Header "DESCRIPTION"
  111. All of the functions described on this page are deprecated.
  112. Applications should instead use \fBEVP_DigestInit_ex\fR\|(3), \fBEVP_DigestUpdate\fR\|(3)
  113. and \fBEVP_DigestFinal_ex\fR\|(3).
  114. .PP
  115. MD2, MD4, and MD5 are cryptographic hash functions with a 128 bit output.
  116. .PP
  117. \&\fBMD2()\fR, \fBMD4()\fR, and \fBMD5()\fR compute the MD2, MD4, and MD5 message digest
  118. of the \fBn\fR bytes at \fBd\fR and place it in \fBmd\fR (which must have space
  119. for MD2_DIGEST_LENGTH == MD4_DIGEST_LENGTH == MD5_DIGEST_LENGTH == 16
  120. bytes of output). If \fBmd\fR is NULL, the digest is placed in a static
  121. array.
  122. .PP
  123. The following functions may be used if the message is not completely
  124. stored in memory:
  125. .PP
  126. \&\fBMD2_Init()\fR initializes a \fBMD2_CTX\fR structure.
  127. .PP
  128. \&\fBMD2_Update()\fR can be called repeatedly with chunks of the message to
  129. be hashed (\fBlen\fR bytes at \fBdata\fR).
  130. .PP
  131. \&\fBMD2_Final()\fR places the message digest in \fBmd\fR, which must have space
  132. for MD2_DIGEST_LENGTH == 16 bytes of output, and erases the \fBMD2_CTX\fR.
  133. .PP
  134. \&\fBMD4_Init()\fR, \fBMD4_Update()\fR, \fBMD4_Final()\fR, \fBMD5_Init()\fR, \fBMD5_Update()\fR, and
  135. \&\fBMD5_Final()\fR are analogous using an \fBMD4_CTX\fR and \fBMD5_CTX\fR structure.
  136. .PP
  137. Applications should use the higher level functions
  138. \&\fBEVP_DigestInit\fR\|(3)
  139. etc. instead of calling the hash functions directly.
  140. .SH NOTE
  141. .IX Header "NOTE"
  142. MD2, MD4, and MD5 are recommended only for compatibility with existing
  143. applications. In new applications, hashes from the SHA\-2 or SHA\-3 family
  144. should be preferred.
  145. .SH "RETURN VALUES"
  146. .IX Header "RETURN VALUES"
  147. \&\fBMD2()\fR, \fBMD4()\fR, and \fBMD5()\fR return pointers to the hash value.
  148. .PP
  149. \&\fBMD2_Init()\fR, \fBMD2_Update()\fR, \fBMD2_Final()\fR, \fBMD4_Init()\fR, \fBMD4_Update()\fR,
  150. \&\fBMD4_Final()\fR, \fBMD5_Init()\fR, \fBMD5_Update()\fR, and \fBMD5_Final()\fR return 1 for
  151. success, 0 otherwise.
  152. .SH "CONFORMING TO"
  153. .IX Header "CONFORMING TO"
  154. RFC 1319, RFC 1320, RFC 1321
  155. .SH "SEE ALSO"
  156. .IX Header "SEE ALSO"
  157. \&\fBEVP_DigestInit\fR\|(3), \fBEVP_MD\-SHA2\fR\|(7), \fBEVP_MD\-SHA3\fR\|(7)
  158. .SH HISTORY
  159. .IX Header "HISTORY"
  160. All of these functions were deprecated in OpenSSL 3.0.
  161. .SH COPYRIGHT
  162. .IX Header "COPYRIGHT"
  163. Copyright 2000\-2024 The OpenSSL Project Authors. All Rights Reserved.
  164. .PP
  165. Licensed under the Apache License 2.0 (the "License"). You may not use
  166. this file except in compliance with the License. You can obtain a copy
  167. in the file LICENSE in the source distribution or at
  168. <https://www.openssl.org/source/license.html>.