2 Aralık 2019 Pazartesi

SHA-2

Giriş
Kriptografik hash fonksiyonları hayatın bir çok alanında kullanılıyor. Bazı örnekler şöyle.
-Data integrity
-Digital signing
-Keyed-Hash Message Authentication Code (HMAC)
-Key Derivation Functions
-Key Stretching
-Ratcheting
-Merkle-Tree
-Blockchains
-Proof-of-work systems
-Constructing Stream Ciphers
-Commitment schemes
-Trapdoor one-way functions
SHA-2 algoritması National Security Agency (NSA) tarafından geliştirilmiş.

Çıktının Bit Uzunlukları
SHA-2'nin bir çok çeşidi var. 224 bit (28 byte), 256 bit (32 byte), 384 bit , 512 bit (64 byte) uzunluğunda hash çıktısı verir. SHA-256 şu anda de facto kriptografik hash fonksiyonudur. SHA-2 epeyce büyük mesajları girdi olarak alabilir. Açıklaması şöyle
SHA-256 may be used to hash a message, M, having a length of l bits, where 0l<264.
Girdi
Aynı girdi için aynı SHA çıktısını alırız.

Entropy
Açıklaması şöyle
Q : Is a sha256 hash of a unix timestamp a strong password
A : The question is not how strong a password looks like but how strong it actually is. 
SHA-256 does not add any entropy at all, so it all depends on what the input to SHA-256 was. 
And the entropy of the chosen input is pretty low: Assuming that the attacker knows how 
the password was created, they can test all possible inputs around the time the password might have been created.

Girdi Büyüklüğü
Girdinin büyüklüğünün bir üst sınır var. Açıklaması şöyle
Technically, the input space for the SHA-1 and SHA-2 hash functions is not "infinite"; SHA-1 and SHA-256 inputs are limited to 2^64−1 bits; SHA-512 is limited to 2^128−1 bits
Açıklaması şöyle.
Both SHA-384 and SHA-512 are limited to an input size of less than 2^128 bits.
Bu üst sınırın sebebinin açıklaması şöyle. Yani üst sınırı NIST koymuş.
Although one can design a hash function that can hash arbitrary size there is no need since one can not easily pass the 
- 2^64−1 limit for SHA-1, SHA-224, and SHA-256 series, and 
- 2^128−1 limit for the SHA-384, SHA-512, SHA-512/224 and SHA-512/256 series. 

During the standardization, NIST put the limits NIST FIPS 180 due to the below MOV attack (Handbook of Applied Cryptography; Chapter 9, Example 9.23);
GPU
SHA-2 GPU'da çalıştırılabilir. Açıklaması şöyle
Graphics cards are faster at solving algorithms like SHA-256 because of the many built-in processors
Kuantum Bilgisayar
SHA-2'nin kırılması öngörülmüyor. Açıklaması şöyle.
The quasi consensus is that 256-bit symmetric crypto (AES-256, SHA-512, SHA3-512 and the like) will remain safe in the foreseeable future.
Kriptografik Hash Fonksiyonlarının Özellikleri
Kriptografik hash fonksiyonları ile beraber salt eklenmesi de yaygın bir yöntem. Kriptografik hash fonksiyonlarından şu özellikler beklenir.

SHA-2 özünde bir block cipher kullanır. Açıklaması şöyle
It's worth pointing out that in the case of SHA2 and most other hashes the compression function has a block cipher (keyed permutation) as its core.

1. Geri dönülemez olması
Açıklaması şöyle
One-way function: Easy to compute hard to invert.
Burada Collision Resistant özelliği de devreye girer. Yani aynı sonucu veren iki veriyi bulması zor olmalı anlamına gelir. Açıklaması şöyle
Collision resistance means that collisions are hard to find, in a computational sense. To put it simply, "collision resistant" means there's no way of finding collisions that is faster than simply guessing at random.
SHA-2 için şu anda bilinen bir collision yok. Tek yönlü fonksiyonlardan collision resistant hash yapmak aslında mümkün değil. Açıklaması şöyle
Simon [Sim98] showed that is not possible to build a collision-resistant hash function from a one-way permutation (which is a stronger statement) in a black-box manner .
2. İyi dağılım yapması
Açıklaması şöyle
Cryptographic hash functions expected to have a well-distributed output. If you find any bias, you can convert this into an attack. Even there is a tiny bias then that can be used to attack for the hash function.
3. Avalanche Effect Sağlaması
Avalanche effect girdideki küçük bir değişikliğin çıktıda çok büyük farklılık yaratması anlamına gelir.

Diğer
SHA-0 ve SHA-1 ve SHA-3 yazılarına bakabilirsiniz.


Hiç yorum yok:

Yorum Gönder