From 6d50010b34dbbcb90a7b4512f97e07fd8beceea5 Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Mon, 16 Sep 2019 10:45:14 +0200 Subject: Recommend against SHA-1 and MD5 for security * doc/lispref/text.texi (Checksum/Hash): * src/fns.c (Fmd5, Fsecure_hash): * lisp/subr.el (sha1): Doc fix to recommend against SHA-1 and MD5 for security-related applications, since they are not collision resistant. (Bug#37420) --- src/fns.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'src/fns.c') diff --git a/src/fns.c b/src/fns.c index f45c729cfaf..2314b4699e7 100644 --- a/src/fns.c +++ b/src/fns.c @@ -5376,7 +5376,10 @@ If OBJECT is a string, the most preferred coding system (see the command `prefer-coding-system') is used. If NOERROR is non-nil, silently assume the `raw-text' coding if the -guesswork fails. Normally, an error is signaled in such case. */) +guesswork fails. Normally, an error is signaled in such case. + +Note that MD5 is not collision resistant and should not be used for +anything security-related. See `secure-hash' for alternatives. */) (Lisp_Object object, Lisp_Object start, Lisp_Object end, Lisp_Object coding_system, Lisp_Object noerror) { return secure_hash (Qmd5, object, start, end, coding_system, noerror, Qnil); @@ -5393,7 +5396,11 @@ whole OBJECT. The full list of algorithms can be obtained with `secure-hash-algorithms'. -If BINARY is non-nil, returns a string in binary form. */) +If BINARY is non-nil, returns a string in binary form. + +Note that MD5 and SHA-1 are not collision resistant and should not be +used for anything security-related. For these applications, use one +of the other hash types instead, e.g. sha256 or sha512. */) (Lisp_Object algorithm, Lisp_Object object, Lisp_Object start, Lisp_Object end, Lisp_Object binary) { return secure_hash (algorithm, object, start, end, Qnil, Qnil, binary); -- cgit v1.2.1