Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id DEFDF200C02 for ; Fri, 20 Jan 2017 16:02:09 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id DDA64160B48; Fri, 20 Jan 2017 15:02:09 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 09125160B39 for ; Fri, 20 Jan 2017 16:02:08 +0100 (CET) Received: (qmail 5364 invoked by uid 500); 20 Jan 2017 15:02:08 -0000 Mailing-List: contact dev-help@apr.apache.org; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Id: Delivered-To: mailing list dev@apr.apache.org Received: (qmail 5354 invoked by uid 99); 20 Jan 2017 15:02:08 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 20 Jan 2017 15:02:08 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id B9A811A043E for ; Fri, 20 Jan 2017 15:02:07 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 1.18 X-Spam-Level: * X-Spam-Status: No, score=1.18 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, HEADER_FROM_DIFFERENT_DOMAINS=0.001, KAM_LINEPADDING=1.2, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_PASS=-0.001] autolearn=disabled Authentication-Results: spamd2-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id mk-WBVtV3ipp for ; Fri, 20 Jan 2017 15:02:03 +0000 (UTC) Received: from mail-wm0-f46.google.com (mail-wm0-f46.google.com [74.125.82.46]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTPS id 8CE875FAF3 for ; Fri, 20 Jan 2017 15:02:03 +0000 (UTC) Received: by mail-wm0-f46.google.com with SMTP id c85so40669544wmi.1 for ; Fri, 20 Jan 2017 07:02:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc:content-transfer-encoding; bh=68TGDnLd1PXuEYyuwXTY0LzgMhIYXJjGvypEjKOroM8=; b=Bf1+FcMf9AGjn0EsJeaM8FnU7S9tRMZ/Z67dMlNLtNLUaqSLqkf5+7ZNQSLjUaMHlr mODmAj9PD70OHAmxpAPcc6Wh6YmtAssHZGp0jNBtTN3rU5Gd3BMYSYObOuMYgrPYiDKV V+/anJ1OR4KdKaGSLgJpZbUYREYJ0JoRp9vGRabI/bqqgBDA1Twt1weXH0tjDz+LogRQ NbXh0LOkCRUyKfsReg3UzQaTARjEH0AfDEOe7LkN03ir//tDYwme7t4MfcNm784wn8Ax Rn6WJDnrJ5JieqgOSHmWFZoYqzIWPeMmaWyPlZLtX4HjBRIplHqHRAIXcbvaD+49Er8d wEbw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc:content-transfer-encoding; bh=68TGDnLd1PXuEYyuwXTY0LzgMhIYXJjGvypEjKOroM8=; b=oqCM7qx6zR48352gIoryKSBvlnkVDQjQpGQwWQeSrJJG54zND2E+pnnffPZm4/Pc8M oXhGJ2hycnv9XDVxC1lHl7Q0aihzql1GSXmPYD1pr2xAL9t1NLJs1o+vF0gOifp0V2Jb rjn150SdnV1pswTwiGBN0Rnz8fSDUZ6mwBvoQkfHJXugte9bEB+jRT/OHDX7ThPFB7uv Knf2raBGcNSprzcGxlDOHMkwICOa30Z2xde+2f+sU2wRZ/LvfCTbm0gtcF9muV7jGKBY Ul3HKyb8JFMmgPQ+FnxYT7a35BTt6I62t1UD/aHVqNtRgql38WZR1Vw7aq9W6su9ejkg 6/2w== X-Gm-Message-State: AIkVDXJxnfxOqX2VcEgDDG1dSGTMDixYVxyzoOyODopXMxn2e69jSubbGd/t3JtYROCaKXk4BnwGffNlN8tXxQ== X-Received: by 10.28.225.215 with SMTP id y206mr3553881wmg.138.1484924523174; Fri, 20 Jan 2017 07:02:03 -0800 (PST) MIME-Version: 1.0 Sender: benlaurie@gmail.com Received: by 10.28.180.7 with HTTP; Fri, 20 Jan 2017 07:02:02 -0800 (PST) In-Reply-To: References: <493F36A5-3620-4603-BFB2-6C16E77D243B@webweaving.org> <4DC52F49-6198-46DC-AB86-9E6FDEAF1F4E@webweaving.org> From: Ben Laurie Date: Fri, 20 Jan 2017 15:02:02 +0000 X-Google-Sender-Auth: YZYx2ZGKovi4Jeii0h4R8jeaeEE Message-ID: Subject: Re: SHA256 and friends. To: Dirk-Willem van Gulik Cc: Graham Leggett , APR Developer List Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable archived-at: Fri, 20 Jan 2017 15:02:10 -0000 On 20 January 2017 at 14:52, Dirk-Willem van Gulik w= rote: > >> On 20 Jan 2017, at 15:46, Ben Laurie wrote: >> >> On 20 January 2017 at 14:36, Dirk-Willem van Gulik wrote: >>> On 20 Jan 2017, at 13:00, Ben Laurie wrote: >>> >>>> Why do you need the obsolete hash functions? >>> >>> I am still in the middle of some inventory work with the help of a few = friendly enterprise & cloud folks. >>> >>> But it is nog looking good -- so far its seems that: >>> >>> - md4 is rarely used (i,e.a actually called). >>> >>> - md5 is very often used for >>> - salted password >>> - creating all sorts of unguessable IDs. >>> - generation of a randomish token/digest >>> - creating/protecting session cookies >>> - creating 12/23/34/1221231.txt file trees or similar equal wear= file / tmp file fanout. >>> - checksumming a file along the lines of taking an fstat() snaps= hot. >>> - commonly used UUID gen. >>> - content-digest generation for things like cache headers, imap/= sieve breakout. >>> - file integrity. >>> >>> - sha1 is used a factor 10x less. Mostly: >>> - salted password >>> - creating/protecting session cookies >>> >>> - sha256 && 512 seems to be used about as often md4. >>> >>> Though nothing stopping us from having a snotty warning/#define to disc= ourage use - and wack the 60 or so distinct places/ where MD5 is currentl= y used in subversion/httpd and friends and upping this to at least sha256. >>> >>> I guess cryptographically there is little point between an MD5 and the = last 16 bytes of a SHA256 ? Correct ? >> >> Not sure what question you're asking? > > So MD5 seems by far the dominant digest method. MOST is actually just to = get a nice hash/randmomish thing. Or just simple integrety. > > Only in a few cases does it actually need to be an MD5 for interoperabili= ty (E.g. the Content-MD5 header of htttp, the salted-MD5 against an existin= g htpassword file). > > In most other cases it could silently be replaced by the last 16 bytes of= a SHA256 (and in quite a few cases; buffer issues permitting; in a full SH= A256). > > So is, from a security perspective, the last 16 bytes of a SHA256 over a = given datablock equivalent to a MD5 over the same datablock. In terms of be= ing able to determine the outcome; i.e. produce clashing hashes/synthesise = data with the same (partial) hash ? > > Or are the last* 16 bytes of a SHA256 'harder' to control ? Last 16 of SHA-256 is stronger than MD5 because, unlike MD5, it hasn't been broken. > Because in that case we get some nice middle ground, > > Dw. > > Or an XOR fold of all its byte into 16. > > > > > > > >