17 Haziran 2017 Cumartesi

SHA-1 - Kullanmayın

Giriş
SHA-1 160 bit (20 byte) hash çıktısı verirSHA-1'in kırılması yakındırBirthday attack ile ortalamada 2^80 denemede kırılıyor. SHA-1 halen sertifikalarda kullanılıyor ancak günleri sayılı.

2017 yılında SHA-1 için ilk collision bulundu. Açıklaması şöyle
Actually SHA-1 has been "officially insecure" for a longer time, since an attack method was published in 2011. The 2017 collisions was just the first known case of actually running the attack. But everybody was already quite convinced that the attack worked, and, indeed, the 2017 collision was produced with the expected computational cost.
Buna rağmen bu algoritmayı veritabanında birincil anahtar (primary key) üretmek için kullananlar var.

SHA-1 Düzeltilebilir mi?
Açıklaması şöyle
SHA-1 is broken. We cannot fix it without modifying result (so compability won't be preserved).
Aslında hardened SHA diye bir şey geliştirilmiş. Açıklaması şöyle
That said, we already fixed it. It's called hardened SHA-1; it is immune to the known and similar collision attacks and it is even backwards compatible with SHA-1, sort of. It detects patterns which will occur in a collision attack and are very rare in random data. Hardened SHA-1 is identical to SHA-1 on almost any input, yet won't be the same and an infinitesimally small portion of inputs we see in collision attacks of the class published.

However though there are no currently known attacks on hardened SHA-1 and it isn't much slower. Nobody has the illusion SHA-1 has competitive security with SHA-2 or SHA-3. Even if you need to truncate to 160 bits, these are probably safer options. If you must have backwards compatibility as a quick fix, Hardened SHA-1 is a great trick but you should make plans to switch to SHA-3
SHA-1 GPU Kullanılarak Kırılabilir
Açıklaması şöyle
By default, Microsoft Office 2016* uses AES-256-CBC with 100000 rounds of SHA1 for password verification using a 16 byte salt. AES256 is currently considered the industry standard by many for symmetric encryption. SHA-1 isn't considered a very secure algorithm for password storage since it's a fast algorithm and can be accelerated massively using GPUs. However, since a 100000 iterations are used, this weakness is significantly mitigated (although it still isn'tanywhere near as good as a dedicated password hashing function like bcrypt/argon2), and if you use a strong password, it shouldn't matter either ways
Expansion and Shrinking
SHA-1 expansion ve shrinking denilen bir işlem yapıyor. Expansion ile 512 bit önce 2560 bit'e genişletiliyor. Shrinking ile bir sonraki işlem için 160 bit muhafaza ediliyor.

Java
MessageDigest yazısına taşıdım.

Apache Commons
DigetUtils.sha1() metodu kullanılabilir.

Linux
Komut satırından şöyle yapılabilir.
sha1sum firefox.tar.gz > sha.txt

Hiç yorum yok:

Yorum Gönder