Orta Doğu Teknik Üniversitesi, Enformatik Enstitüsü Siber Güvenlik Bölümü, CyDeS Laboratuvarı 9. Savunma Teknolojileri Kongresi Ankara 28 Haziran 2018
Outline 1 Hafif Kriptografi 2 Ekran Kartları 3 Mifare Classic Akıllı Kartları 4 A5/1 (GSM Standardı) 5 PRESENT (ISO Standardı)
Hafif Kriptografi Hafif Kriptografi İhtiyacı Bilgi teknolojilerindeki evrimsel değişim 1 bir bilgisayar - çok kullanıcı 2 bir bilgisayar - bir kullanıcı 3 çok bilgisayar - bir kullanıcı (IoT)
Hafif Kriptografi Hafif Kriptografi İhtiyacı Bilgi teknolojilerindeki evrimsel değişim 1 bir bilgisayar - çok kullanıcı 2 bir bilgisayar - bir kullanıcı 3 çok bilgisayar - bir kullanıcı (IoT) Çoğu IoT sistemi kısıtlı kaynağa sahip platformlarda çalışmaktadır (örn. pilsiz çalışan mobil token lar, RFID ler ya da pil değişimine izin vermeyen tıbbi implant ler) Çoğu IoT aygıtı büyük sayılarda üretildiği için aşırı hassas fiyata sahiptir
Hafif Kriptografi Hafif Kriptografi İhtiyacı Bilgi teknolojilerindeki evrimsel değişim 1 bir bilgisayar - çok kullanıcı 2 bir bilgisayar - bir kullanıcı 3 çok bilgisayar - bir kullanıcı (IoT) Çoğu IoT sistemi kısıtlı kaynağa sahip platformlarda çalışmaktadır (örn. pilsiz çalışan mobil token lar, RFID ler ya da pil değişimine izin vermeyen tıbbi implant ler) Çoğu IoT aygıtı büyük sayılarda üretildiği için aşırı hassas fiyata sahiptir Endüstri en az 20 yıldır hafif kriptografiye ihtiyaç duymaktadır Akademik dünyada aktif bir araştırma alanı olması 10 yıl civarındadır Dolayısıyla endüstri kendi tasarladığı algoritmalarla sahaya inmiş ve birçok facia yaşanmıştır 1 KeeLoq (anahtarsız uzaktan giriş için) 2 Mifare Classic (temassız akıllı kartlar) 3...
Hafif Kriptografi Hafif Kriptografi İlk tasarımlar genellikle donanım boyutuna odaklandı ama her ihtiyacı sağlayacak tek bir şifre tasarlamak gerçekçi bir yaklaşım değil Kısıtlı ortamlara sığabilmek için hafif şifreler basit döngü fonksiyonlarına ya da minimal anahtar düzenleme algoritmalarına dayanmaktadırlar Bu basit yapılar yeni saldırıların keşfedilmesine neden olmaktadır
Hafif Kriptografi Hafif Kriptografi Düşük donanım boyutu 1 PRESENT 2 HIGHT 3 CLEFIA Küçük gömülü işlemcilerde düşük hafıza tüketimi 1 ITUBee 2 PRIDE 3 SPECK Düşük latency 1 PRINCE Yan kanal saldırılarına karşı güvenlik 1 Zorro 2 LS-Designs
GPU vs. CPU Figure: GPU vs. CPU (GFLOPS per second)
GPU vs. CPU Figure: GPU vs. CPU (GFLOPS per second)
GPU Process Flow Figure: GPU Process Flow
GPU Performance: GTX 1080
Güncel Durum
CUDA Compute Capability Figure: CUDA Compute Capability
GPU Programlamada Dikkat Edilmesi Gerekenler Dikkat Edilmesi Gerekenler Branching Occupancy Soft and Hard Errors Shared Memory Bank Collisions
A5/1 Stream Cipher 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 Output 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 Figure: GSM Görüşmeleri için A5/1 Akan Şifresi (64-bit anahtar) Device Intel i7-4702qm (CPU) Geforce GTX 860M (GPU) Geforce GTX 970 (GPU) Performance 2 22 enc/s 2 28 enc/s 2 32 enc/s
A5/1 Time Memory Trade-off Attacks on A5/1 We cannot store keystream for 2 61.16 inital states We can reduce the memory cost by using rainbow tables In 2010, 1896 gigabytes of rainbow tables were constructed using GPUs for a M.Sc. Thesis at NTNU Given 114-bits of known plaintext, these tables can decrypt a GSM conversation with probability > 19%
A5/1 (GSM 2G Standardı) Data taken from GSM Map Project, June 2017 (Security Research Labs, Berlin).
Number of million encryptions per second PRESENT Kaba Kuvvet Saldırısı Performansı 450,00 400,00 350,00 300,00 250,00 200,00 150,00 100,00 50,00 0,00 PRESENT-80 395,84 340,90 15,43 27,92 31,41 i7-2630qm GT 540M i7-4770 Tesla k20 GTX 970 Figure: PRESENT Kaba Kuvvet Saldırısı Performansı
Million encryptions per second PRESENT Distinguisher Verification Performance 1000,00 900,00 800,00 700,00 600,00 500,00 400,00 300,00 200,00 100,00 0,00 Speed comparison for 8-round pair encryptions 48,00 63,16 102,17 764,77 930,02 i7-2630qm GT 540M i7-4770 Tesla k20 (*) Tesla k20 (**) * Shared memory bank size configured to 32 bits ** Shared memory bank size configured to 64 bits Figure: PRESENT Distinguisher Verification Performance
Mifare Classic Mifare Classic 1k NXP Semiconductors tarafından üretilmiş temassız akıllı kartlar 10 milyardan fazla akıllı kart çipi ve 150 milyondan fazla kart okuyucu üretilmiştir crypto1 akan şifresini kullanmaktadır
Mifare Classic Mifare Classic 1k NXP Semiconductors tarafından üretilmiş temassız akıllı kartlar 10 milyardan fazla akıllı kart çipi ve 150 milyondan fazla kart okuyucu üretilmiştir crypto1 akan şifresini kullanmaktadır Hedef Uygulamalar Toplu taşıma Elektronik yol/köprü ücret toplama Mağaza müşteri kartları Etkinlik biletleme Otopark...
Mifare Classic
CRYPTO1 in 0 1 2 3 4 5 6 7 8 9 1011121314151617181920212223242526272829303132333435363738394041424344454647 f a f b f b f a f b f c out Figure: Structure of crypto1 stream cipher
CRYPTO1 in 0 1 2 3 4 5 6 7 8 9 1011121314151617181920212223242526272829303132333435363738394041424344454647 f a f b f b f a f b f c out Figure: Structure of crypto1 stream cipher L := x 0 x 5 x 9 x 10 x 12 x 14 x 15 x 17 x 19 x 24 x 25 x 27 x 29 x 35 x 39 x 41 x 42 x 43 f a (y 0, y 1, y 2, y 3 ): = ((y 0 y 1 ) (y 0 y 3 )) (y 2 ((y 0 y 1 ) y 3 )) f b (y 0, y 1, y 2, y 3 ): = ((y 0 y 1 ) y 2 ) ((y 0 y 1 ) (y 2 y 3 )) f c (y 0, y 1, y 2, y 3, y 4 ): = (y 0 ((y 1 y 4 ) (y 3 y 4 ))) ((y 0 (y 1 y 3 )) ((y 2 y 3 ) (y 1 y 4 ))) suc(x 0 x 1... x 31 ) := x 1 x 2... x 31 (x 16 x 18 x 19 x 21 )
Authentication Protocol Tag u n T {n R }{a R } {a T } Reader
Known Vulnerabilities (Some) Known Vulnerabilities 1 Weak PRNG: Corrected in the hardened Mifare classic cards 2 Short key length: 48-bit key is too short!!! (Delay introduced by the communication and authentication procedure prevents online brute force attacks) 3 Keystream leakage through error: 4-bit leaks (Corrected in the hardened Mifare classic cards) 4 Parity bits: Parity of plaintext bytes are transmitted during communication 5 Nested authentication: When authentication for a sector for which the key is known is completed, the reader can request for authentication of another sector. This time tag sends encrypted n T
Online Attacks Table: Comparison of card only attacks. Attack Traces Gather Compute a b (Garcia et al., 2009) 2 <1 sec <1 sec (Courtois, 2009) 300 3 min <1 sec (Chiu et al., 2013) 100, 000 10-20 hours 2-15 min (Meijer and Verdult, 2015) 10, 000 6-12 min 5-10 min a Does not require a weak PRNG b Does not require the error code after a failed authentication
Offline Attacks (Garcia et al., 2009) The attacker plays the role of a reader and tries to authenticate for a sector of her choice She answers the challenge of the tag with eight random bytes (and eight random parity bits) for n R and a R With probability 1/256, the parity bits are correct and the tag responds with the encrypted 4-bit error code A success leaks 12 bits of entropy (out of 48) In practice, 5 successful repetition of this attack is enough So we need 5 256 authentication attempts (takes less than a sec)
Offline Attacks (Garcia et al., 2009) The attacker plays the role of a reader and tries to authenticate for a sector of her choice She answers the challenge of the tag with eight random bytes (and eight random parity bits) for n R and a R With probability 1/256, the parity bits are correct and the tag responds with the encrypted 4-bit error code A success leaks 12 bits of entropy (out of 48) In practice, 5 successful repetition of this attack is enough So we need 5 256 authentication attempts (takes less than a sec) Table: Brute Force using Encrypted Error Code Reference GPU Cores Speed Time (Chih et al., 2010) GTX 280 240 1296 MHz 9 days 8 hours 16 GTX280 GPUs can perform this attack in 14 hours
Our Bitsliced Brute Force using Encrypted Error Code Table: Brute Force Attack on Mifare Classic 1k GTX 860M GTX 970 Cores 640 1664 Clock 1020 MHz 1253 MHz Keys per second 6,673 M 15,575 M 48-bit search 11.7 hours 5 hours
Offline Attacks on Hardened Mifare Classic (Meijer and Verdult, 2015) Given an encrypted nonce obtained through a nested authentication, the adversary can attempt to decrypt it using the candidate key If the candidate is the correct key, the parity bits will be correct For a wrong key, a parity bit will be correct with probability 1/2 An encrypted nonce holds 4 bytes, thus 4 encrypted parity bits Therefore, on average, 48/4 = 12 encrypted nonces are enough to get the key
Offline Attacks on Hardened Mifare Classic (Meijer and Verdult, 2015) Given an encrypted nonce obtained through a nested authentication, the adversary can attempt to decrypt it using the candidate key If the candidate is the correct key, the parity bits will be correct For a wrong key, a parity bit will be correct with probability 1/2 An encrypted nonce holds 4 bytes, thus 4 encrypted parity bits Therefore, on average, 48/4 = 12 encrypted nonces are enough to get the key Table: Brute Force on Hardened Mifare Classic Reference GPU Cores Speed Time (Meijer and Verdult, 2015) GTX 460 336 1350 MHz 1 month 180 GTX460 GPUs can perform this attack in an hour and the system should cost around $12,600.
Our Bitsliced Brute Force on Hardened Mifare Classic Table: Brute Force Attack on Hardened Mifare Classic GTX 860M GTX 970 Cores 640 1664 Clock 1020 MHz 1253 MHz Keys per second 3,635 M 11,105 M 48-bit search 21 hours 7 hours
Mifare Ultralight
Sonuç Sonuç Farklı ihtiyaçlar için farklı hafif şifrelere ihtiyaç vardır Basit yapılarından dolayı hafif tasarımlar henüz keşfedilmemiş atak türlerine karşı dayanıksız olabilirler Hafif tasarım daha kısa anahtar demek değildir. Kısa anahtar kullanmak neredeyse hiçbir güvenlik sağlamamaktadır. 128 bit ten daha kısa anahtar kullanmak için HİÇBİR neden yoktur.
Teşekkürler Teşekkürler