문제

2009 년 평균 새로운 앱을 작성할 때 보안 및 성능 측면에서 사용하기 가장 합리적인 다이제스트 기능은 무엇입니까? (조건이 바뀌면서 미래에 이것을 어떻게 결정할 수 있습니까?)

언제 비슷한 질문 ~이었다 물었다 이전에는 SHA1, SHA2, SHA-256, SHA-512, MD5, Bcrypt 및 Blowfish가 포함되었습니다.

나는 많은 정도로, 이것들 중 하나가 지능적으로 사용된다면 효과가있을 수 있지만, 주사위를 굴려서 무작위로 선택하지는 않겠다는 것을 알고 있습니다. 감사.

도움이 되었습니까?

해결책

나는 따라갈 것이다 NIST/FIPS 지침:

2006 년 3 월 15 일 : SHA-2 해시 기능 (IE, SHA-224, SHA-256, SHA-384 및 SHA-512)은 보안 해시 알고리즘을 사용한 모든 응용 프로그램에 사용될 수 있습니다. 연방 기관은 디지털 서명, 디지털 타임 스탬핑 및 실용적으로 충돌 저항이 필요한 기타 응용 프로그램에 SHA-1 사용을 중단해야하며 2010 년 이후에 이러한 응용 프로그램에 SHA-2 해시 기능을 사용해야합니다. 다음 애플리케이션에 대해서만 SHA-1을 사용하십시오. 해시 기반 메시지 인증 코드 (HMAC); 주요 파생 함수 (KDFS); 및 임의의 숫자 생성기 (RNG). 사용에 관계없이 NIST는 애플리케이션 및 프로토콜 설계자가 모든 새로운 응용 프로그램 및 프로토콜에 SHA-2 해시 기능을 사용하도록 권장합니다.

다른 팁

You say "digest function"; presumably that means you want to use it to compute digests of "long" messages (not just hashing "short" "messages" like passwords). That means bCrypt and similar choices are out; they're designed to be slow to inhibit brute-force attacks on password databases. MD5 is completely broken, and SHA-0 and SHA-1 are too weakened to be good choices. Blowfish is a stream cipher (though you can run it in a mode that produces digests), so it's not such a good choice either.

That leaves several families of hash functions, including SHA-2, HAVAL, RIPEMD, WHIRLPOOL, and others. Of these, the SHA-2 family is the most thoroughly cryptanalyzed, and so it would be my recommendation for general use. I would recommend either SHA2-256 or SHA2-512 for typical applications, since those two sizes are the most common and likely to be supported in the future by SHA-3.

It really depends on what you need it for.

If you are in need of actual security, where the ability to find a collision easily would compromise your system, I would use something like SHA-256 or SHA-512 as they come heavily recommended by various agencies.

If you are in need of something that is fast, and can be used to uniquely identify something, but there are no actual security requirements (ie, an attacker wouldn't be able to do anything nasty if they found a collision) then I would use something like MD5.

MD4, MD5, and SHA-1 have been shown to be more easily breakable, in the sense of finding a collision via a birthday attack method, than expected. RIPEMD-160 is well regarded, but at only 160 bits a birthday attack needs only 2^80 operations, so it won't last forever. Whirlpool has excellent characteristics and appears the strongest of the lot, though it doesn't have the same backing as SHA-256 or SHA-512 does - in the sense that if there was a problem with SHA-256 or SHA-512 you'd be more likely to find out about it via proper channels.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top