SlideShare a Scribd company logo
1 of 16
Part 1  Cryptography
2
Chapter 3:
Symmetric Key Crypto
The chief forms of beauty are order and symmetry…
 Aristotle
“You boil it in sawdust: you salt it in glue:
You condense it with locusts and tape:
Still keeping one principal object in view 
To preserve its symmetrical shape.”
 Lewis Carroll, The Hunting of the Snark
Stream and Block Ciphers
• Stream Ciphers and block ciphers are two categories of
ciphers used in classical cryptography.
• Stream and Block Ciphers differ in how large a piece of
the message is processed in each encryption operation.
• Stream ciphers encrypt plaintext one byte or one bit at
a time.
• Block ciphers encrypt plaintext in chunks. Common
block sizes are 64 and 128 bits.
3
Stream Cipher
• Stream Cipher – encryption of bits
– Often pseudorandom generators
– Simple and fast
– Not very secure
– RC4, A5/1
– Inspired by the one time pad (OTP)
– A one-time pad uses a keystream of
completely random digits. The keystream is
combined with the plaintext digits one at a time to
form the cipher text.
– http://en.wikipedia.org/wiki/Stream_cipher
4
Block Ciphers
• Block Cipher is a symmetric key cipher operating on
fixed-length groups of bits, called blocks, with an
unvarying transformation. A block cipher encryption
algorithm might take (for example) a 128-bit block
of plaintext as input, and output a corresponding 128-
bit block of cipher text. The exact transformation is
controlled using a second input — the secret key.
• Short explanation
– DES, 3DES, AES, IDEA,TEA,XTEA
5
Part 1  Cryptography
6
Symmetric Key Crypto
• Stream cipher  based on one-time pad
– Except that key is relatively short
– Key is stretched into a long keystream
– Keystream is used just like a one-time pad
• Block cipher  based on codebook concept
– Block cipher key determines a codebook
– Each key yields a different codebook
– Employs both “confusion” and “diffusion”
Part 1  Cryptography
7
Stream Ciphers
A stream cipher takes a key K of n bits in length and stretches it into a long keystream.
This keystream is then XORed with the plaintext P to produce ciphertext C. The use of the
keystream is identical to the use of the key in a one-time pad cipher. To decrypt with a
stream cipher, the same keystream is generated and XORed with the ciphertext.
The function of a stream cipher can be viewed simply as
StreamCipher(K) = S
where K is the key and S is the keystream that we’ll use like a one-time pad. The
encryption formula is
c0 = p0 ⊕ s0, c1 = p1 ⊕ s1, c2 = p2 ⊕ s2, . . .
where P = p0p1p2 . . . is the plaintext, S = s0s1s2 . . . is the keystream and
C = c0c1c2 . . . is the ciphertext.
To decrypt ciphertext C, the keystream S is again used
p0 = c0 ⊕ s0, p1 = c1 ⊕ s1, p2 = c2 ⊕ s2, . . . .
Provided that both the sender and receiver have the same stream cipher algorithm and
that both know the key K, this system is a practical generalization of the one-time pad—
although not provably secure in the sense of the one-time pad.
Part 1  Cryptography
8
Stream Ciphers
• Once upon a time, not so very long ago, stream
ciphers were the king of crypto
• Today, not as popular as block ciphers
• We’ll discuss two stream ciphers…
• A5/1
– Based on shift registers
– Used in GSM mobile phone system
• RC4
– Based on a changing lookup table
– Used many places
Part 1  Cryptography
9
A5/1: Shift Registers
• A5/1 uses 3 shift registers
– X: 19 bits (x0,x1,x2, …,x18)
– Y: 22 bits (y0,y1,y2, …,y21)
– Z: 23 bits (z0,z1,z2, …,z22)
Part 1  Cryptography
10
A5/1: Keystream
• At each step: m = maj(x8, y10, z10)
– Examples: maj(0,1,0) = 0 and maj(1,1,0) = 1
• If x8 = m then X steps
– t = x13  x16  x17  x18
– xi = xi1 for i = 18,17,…,1 and x0 = t
• If y10 = m then Y steps
– t = y20  y21
– yi = yi1 for i = 21,20,…,1 and y0 = t
• If z10 = m then Z steps
– t = z7  z20  z21  z22
– zi = zi1 for i = 22,21,…,1 and z0 = t
• Keystream bit is x18  y21  z22
Part 1  Cryptography
11
A5/1
• Each variable here is a single bit
• Key is used as initial fill of registers
• Each register steps (or not) based on maj(x8, y10, z10)
• Keystream bit is XOR of rightmost bits of registers
y0 y1 y2 y3 y4 y5 y6 y7 y8 y9 y10 y11 y12 y13 y14 y15 y16 y17 y18 y19 y20 y21
z0 z1 z2 z3 z4 z5 z6 z7 z8 z9 z10 z11 z12 z13 z14 z15 z16 z17 z18 z19 z20 z21 z22
X
Y
Z




x0 x1 x2 x3 x4 x5 x6 x7 x8 x9 x10 x11 x12 x13 x14 x15 x16 x17 x18
Part 1  Cryptography
12
A5/1
• In this example, m = maj(x8, y10, z10) = maj(1,0,1) = 1
• Register X steps, Y does not step, and Z steps
• Keystream bit is XOR of right bits of registers
• Here, keystream bit will be 0  1  0 = 1
1 1 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1 0 0 0 1
1 1 1 0 0 0 0 1 1 1 1 0 0 0 0 1 1 1 1 0 0 0 1
X
Y
Z




1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1
A5/1 exercise (8)
• Implement the A5/1 algorithm. Suppose that, after a particular step, the
values in the registers are
• X = (x0, x1, . . . , x18) = (1010101010101010101)
• Y = (y0, y1, . . . , y21) = (1100110011001100110011)
• Z = (z0, z1, . . . , z22) = (11100001111000011110000)
• Generate and print the next 32 keystream bits. Print the contents of X, Y
and Z after the 32 keystream bits have been generated
Part 1  Cryptography
13
• sol
• X = (x0, x1, . . . , x18) = (10 10 10 10 10 10 10 10 10 1)
• Y = (y0, y1, . . . , y21) = (11 00 11 00 11 00 11 00 11 00 11)
• Z = (z0, z1, . . . , z22) = (11 10 00 01 11 10 00 01 11 10 00 0)
• M= major vote (maj(x8,y10,z10))
• M=maj(1,0,1)=1
• For register x
• Compare x8=1 with m =1 they are equal then do step
• Tx=x13 ⊕ x16 ⊕ x17 ⊕ x18
• Tx=0 ⊕ 1⊕ 0⊕ 1, Tx=0
• X = (tx,,x0, x1, . . . , x17) = (0 10 10 10 10 10 10 10 10 10)
• For register y
• Compare y10=0 with m =1 they are not equal then do not do step
• Y = (y0, y1, . . . , y21) = (11 00 11 00 11 00 11 00 11 00 11)
• For register z
• Compare z10=1 with m =1 they are equal then do step
 Tz= z7  z20  z21  z22
 Tz= 1 0  0  0 = 1
 Z = (Tz, z0, z1, . . . , z21) = (1 11 10 00 01 11 10 00 01 11 10 00)
 Keystream bit is x18  y21  z22 = 0 1  0 =1
Part 1  Cryptography
15
Shift Register Crypto
• Shift register crypto efficient in hardware
• Often, slow if implement in software
• In the past, very popular
• Today, more is done in software due to fast
processors
• Shift register crypto still used some
– Resource-constrained devices
Part 1  Cryptography
16
Stream Ciphers
• Stream ciphers were popular in the past
– Efficient in hardware
– Speed was needed to keep up with voice, etc.
– Today, processors are fast, so software-based crypto is
usually more than fast enough
• Future of stream ciphers?
– Shamir declared “the death of stream ciphers”
– May be greatly exaggerated…

More Related Content

What's hot

NGHIÊN CỨU PHƯƠNG PHÁP QUAY LUI VÀ ỨNG DỤNG GIẢI BÀI TOÁN SUDOKU
NGHIÊN CỨU PHƯƠNG PHÁP QUAY LUI VÀ ỨNG DỤNG GIẢI BÀI TOÁN SUDOKU NGHIÊN CỨU PHƯƠNG PHÁP QUAY LUI VÀ ỨNG DỤNG GIẢI BÀI TOÁN SUDOKU
NGHIÊN CỨU PHƯƠNG PHÁP QUAY LUI VÀ ỨNG DỤNG GIẢI BÀI TOÁN SUDOKU nataliej4
 
Giáo trình bảo mật thông tin
Giáo trình bảo mật thông tinGiáo trình bảo mật thông tin
Giáo trình bảo mật thông tinjackjohn45
 
Bài giảng mật mã học cơ sở PTIT
Bài giảng mật mã học cơ sở PTITBài giảng mật mã học cơ sở PTIT
Bài giảng mật mã học cơ sở PTITNguynMinh294
 
XXE injection - Nguyễn Tăng Hưng
XXE injection - Nguyễn Tăng HưngXXE injection - Nguyễn Tăng Hưng
XXE injection - Nguyễn Tăng HưngVõ Thái Lâm
 
Bài giảng mật mã học cơ sở PTIT
Bài giảng mật mã học cơ sở PTITBài giảng mật mã học cơ sở PTIT
Bài giảng mật mã học cơ sở PTITNguynMinh294
 
Báo cáo tốt nghiệp Android RSA mã hóa
Báo cáo tốt nghiệp Android RSA mã hóaBáo cáo tốt nghiệp Android RSA mã hóa
Báo cáo tốt nghiệp Android RSA mã hóaPhạm Trung Đức
 
Kĩ thuật lọc ảnh và ứng dụng trong lọc nhiễu làm trơn
Kĩ thuật lọc ảnh và ứng dụng trong lọc nhiễu làm trơnKĩ thuật lọc ảnh và ứng dụng trong lọc nhiễu làm trơn
Kĩ thuật lọc ảnh và ứng dụng trong lọc nhiễu làm trơnNguyen Thieu
 
Báo cáo môn mô hình hóa
Báo cáo môn mô hình hóaBáo cáo môn mô hình hóa
Báo cáo môn mô hình hóaThuyet Nguyen
 
Kiến trúc máy tính và hợp ngữ bài 02
Kiến trúc máy tính và hợp ngữ bài 02Kiến trúc máy tính và hợp ngữ bài 02
Kiến trúc máy tính và hợp ngữ bài 02Nhóc Nhóc
 
Bai giang atbmtt
Bai giang atbmtt Bai giang atbmtt
Bai giang atbmtt Hà Vũ
 
7. tìm hiểu hàm băm md5 và ứng dụng
7. tìm hiểu hàm băm md5 và ứng dụng7. tìm hiểu hàm băm md5 và ứng dụng
7. tìm hiểu hàm băm md5 và ứng dụngSai Lemovom
 
Tim hieu thanh ghi in asm
Tim hieu thanh ghi in asmTim hieu thanh ghi in asm
Tim hieu thanh ghi in asmMy Đá
 
Đề tài: Nghiên cứu Hệ thống Honeypots và Honeynet nhằm nghiên cứu một số kỹ t...
Đề tài: Nghiên cứu Hệ thống Honeypots và Honeynet nhằm nghiên cứu một số kỹ t...Đề tài: Nghiên cứu Hệ thống Honeypots và Honeynet nhằm nghiên cứu một số kỹ t...
Đề tài: Nghiên cứu Hệ thống Honeypots và Honeynet nhằm nghiên cứu một số kỹ t...Viết thuê trọn gói ZALO 0934573149
 
Mạng neural nhân tạo và ứng dụng trong xử lý ngôn ngữ tự nhiên
Mạng neural nhân tạo và ứng dụng trong xử lý ngôn ngữ tự nhiênMạng neural nhân tạo và ứng dụng trong xử lý ngôn ngữ tự nhiên
Mạng neural nhân tạo và ứng dụng trong xử lý ngôn ngữ tự nhiênMinh Pham
 

What's hot (20)

Hệ mật mã Elgamal
Hệ mật mã ElgamalHệ mật mã Elgamal
Hệ mật mã Elgamal
 
NGHIÊN CỨU PHƯƠNG PHÁP QUAY LUI VÀ ỨNG DỤNG GIẢI BÀI TOÁN SUDOKU
NGHIÊN CỨU PHƯƠNG PHÁP QUAY LUI VÀ ỨNG DỤNG GIẢI BÀI TOÁN SUDOKU NGHIÊN CỨU PHƯƠNG PHÁP QUAY LUI VÀ ỨNG DỤNG GIẢI BÀI TOÁN SUDOKU
NGHIÊN CỨU PHƯƠNG PHÁP QUAY LUI VÀ ỨNG DỤNG GIẢI BÀI TOÁN SUDOKU
 
Giáo trình bảo mật thông tin
Giáo trình bảo mật thông tinGiáo trình bảo mật thông tin
Giáo trình bảo mật thông tin
 
Bài giảng mật mã học cơ sở PTIT
Bài giảng mật mã học cơ sở PTITBài giảng mật mã học cơ sở PTIT
Bài giảng mật mã học cơ sở PTIT
 
XXE injection - Nguyễn Tăng Hưng
XXE injection - Nguyễn Tăng HưngXXE injection - Nguyễn Tăng Hưng
XXE injection - Nguyễn Tăng Hưng
 
Bài giảng mật mã học cơ sở PTIT
Bài giảng mật mã học cơ sở PTITBài giảng mật mã học cơ sở PTIT
Bài giảng mật mã học cơ sở PTIT
 
Báo cáo tốt nghiệp Android RSA mã hóa
Báo cáo tốt nghiệp Android RSA mã hóaBáo cáo tốt nghiệp Android RSA mã hóa
Báo cáo tốt nghiệp Android RSA mã hóa
 
Đề tài: Tìm hiểu mạng riêng ảo và ứng dụng, HOT
Đề tài: Tìm hiểu mạng riêng ảo và ứng dụng, HOTĐề tài: Tìm hiểu mạng riêng ảo và ứng dụng, HOT
Đề tài: Tìm hiểu mạng riêng ảo và ứng dụng, HOT
 
Đề tài: Thiết kế hệ thống mạng máy tính, HAY, 9đ - tải qua zalo=> 0909232620
Đề tài: Thiết kế hệ thống mạng máy tính, HAY, 9đ - tải qua zalo=> 0909232620Đề tài: Thiết kế hệ thống mạng máy tính, HAY, 9đ - tải qua zalo=> 0909232620
Đề tài: Thiết kế hệ thống mạng máy tính, HAY, 9đ - tải qua zalo=> 0909232620
 
Kĩ thuật lọc ảnh và ứng dụng trong lọc nhiễu làm trơn
Kĩ thuật lọc ảnh và ứng dụng trong lọc nhiễu làm trơnKĩ thuật lọc ảnh và ứng dụng trong lọc nhiễu làm trơn
Kĩ thuật lọc ảnh và ứng dụng trong lọc nhiễu làm trơn
 
Đề tài: Tìm hiểu hệ thống phát hiện xâm nhập IDS-SNORT, 9đ
Đề tài: Tìm hiểu hệ thống phát hiện xâm nhập IDS-SNORT, 9đĐề tài: Tìm hiểu hệ thống phát hiện xâm nhập IDS-SNORT, 9đ
Đề tài: Tìm hiểu hệ thống phát hiện xâm nhập IDS-SNORT, 9đ
 
Mau bao cao project 1
Mau bao cao project 1Mau bao cao project 1
Mau bao cao project 1
 
Báo cáo môn mô hình hóa
Báo cáo môn mô hình hóaBáo cáo môn mô hình hóa
Báo cáo môn mô hình hóa
 
Kiến trúc máy tính và hợp ngữ bài 02
Kiến trúc máy tính và hợp ngữ bài 02Kiến trúc máy tính và hợp ngữ bài 02
Kiến trúc máy tính và hợp ngữ bài 02
 
Network attacks
Network attacksNetwork attacks
Network attacks
 
Bai giang atbmtt
Bai giang atbmtt Bai giang atbmtt
Bai giang atbmtt
 
7. tìm hiểu hàm băm md5 và ứng dụng
7. tìm hiểu hàm băm md5 và ứng dụng7. tìm hiểu hàm băm md5 và ứng dụng
7. tìm hiểu hàm băm md5 và ứng dụng
 
Tim hieu thanh ghi in asm
Tim hieu thanh ghi in asmTim hieu thanh ghi in asm
Tim hieu thanh ghi in asm
 
Đề tài: Nghiên cứu Hệ thống Honeypots và Honeynet nhằm nghiên cứu một số kỹ t...
Đề tài: Nghiên cứu Hệ thống Honeypots và Honeynet nhằm nghiên cứu một số kỹ t...Đề tài: Nghiên cứu Hệ thống Honeypots và Honeynet nhằm nghiên cứu một số kỹ t...
Đề tài: Nghiên cứu Hệ thống Honeypots và Honeynet nhằm nghiên cứu một số kỹ t...
 
Mạng neural nhân tạo và ứng dụng trong xử lý ngôn ngữ tự nhiên
Mạng neural nhân tạo và ứng dụng trong xử lý ngôn ngữ tự nhiênMạng neural nhân tạo và ứng dụng trong xử lý ngôn ngữ tự nhiên
Mạng neural nhân tạo và ứng dụng trong xử lý ngôn ngữ tự nhiên
 

Similar to Stream Cipher.pptx

1 Cryptography Introduction_shared.ppt
1 Cryptography Introduction_shared.ppt1 Cryptography Introduction_shared.ppt
1 Cryptography Introduction_shared.pptssuser0cd7c9
 
Computer security
Computer securityComputer security
Computer securityJames Wong
 
Computer security
Computer securityComputer security
Computer securityFraboni Ec
 
Computer security
Computer security Computer security
Computer security Harry Potter
 
Computer security
Computer security Computer security
Computer security Tony Nguyen
 
Computer security
Computer securityComputer security
Computer securityDavid Hoen
 
Block Encryption Algorithm Project.docx
Block Encryption Algorithm Project.docxBlock Encryption Algorithm Project.docx
Block Encryption Algorithm Project.docxUsamaAliLone3
 
Digital communication
Digital communicationDigital communication
Digital communicationmeashi
 
Line drawing algorithm and antialiasing techniques
Line drawing algorithm and antialiasing techniquesLine drawing algorithm and antialiasing techniques
Line drawing algorithm and antialiasing techniquesAnkit Garg
 
Block Cipher vs. Stream Cipher
Block Cipher vs. Stream CipherBlock Cipher vs. Stream Cipher
Block Cipher vs. Stream CipherAmirul Wiramuda
 
Module v sp
Module v spModule v sp
Module v spVijaya79
 

Similar to Stream Cipher.pptx (20)

1 Cryptography Introduction_shared.ppt
1 Cryptography Introduction_shared.ppt1 Cryptography Introduction_shared.ppt
1 Cryptography Introduction_shared.ppt
 
Computer security
Computer securityComputer security
Computer security
 
Computer security
Computer securityComputer security
Computer security
 
Computer security
Computer securityComputer security
Computer security
 
Computer security
Computer security Computer security
Computer security
 
Computer security
Computer securityComputer security
Computer security
 
Computer security
Computer security Computer security
Computer security
 
Computer security
Computer securityComputer security
Computer security
 
Block Encryption Algorithm Project.docx
Block Encryption Algorithm Project.docxBlock Encryption Algorithm Project.docx
Block Encryption Algorithm Project.docx
 
Digital communication
Digital communicationDigital communication
Digital communication
 
Line drawing algorithm and antialiasing techniques
Line drawing algorithm and antialiasing techniquesLine drawing algorithm and antialiasing techniques
Line drawing algorithm and antialiasing techniques
 
Block Cipher vs. Stream Cipher
Block Cipher vs. Stream CipherBlock Cipher vs. Stream Cipher
Block Cipher vs. Stream Cipher
 
Module v sp
Module v spModule v sp
Module v sp
 
Cryptography
CryptographyCryptography
Cryptography
 
Cryptography
CryptographyCryptography
Cryptography
 
Cryptography
CryptographyCryptography
Cryptography
 
Cryptography
CryptographyCryptography
Cryptography
 
Cryptography
CryptographyCryptography
Cryptography
 
Cryptography
CryptographyCryptography
Cryptography
 
Cryptography
CryptographyCryptography
Cryptography
 

Recently uploaded

Introduction to Robotics in Mechanical Engineering.pptx
Introduction to Robotics in Mechanical Engineering.pptxIntroduction to Robotics in Mechanical Engineering.pptx
Introduction to Robotics in Mechanical Engineering.pptxhublikarsn
 
Standard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power PlayStandard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power PlayEpec Engineered Technologies
 
Danikor Product Catalog- Screw Feeder.pdf
Danikor Product Catalog- Screw Feeder.pdfDanikor Product Catalog- Screw Feeder.pdf
Danikor Product Catalog- Screw Feeder.pdfthietkevietthinh
 
Passive Air Cooling System and Solar Water Heater.ppt
Passive Air Cooling System and Solar Water Heater.pptPassive Air Cooling System and Solar Water Heater.ppt
Passive Air Cooling System and Solar Water Heater.pptamrabdallah9
 
Post office management system project ..pdf
Post office management system project ..pdfPost office management system project ..pdf
Post office management system project ..pdfKamal Acharya
 
Worksharing and 3D Modeling with Revit.pptx
Worksharing and 3D Modeling with Revit.pptxWorksharing and 3D Modeling with Revit.pptx
Worksharing and 3D Modeling with Revit.pptxMustafa Ahmed
 
Theory of Time 2024 (Universal Theory for Everything)
Theory of Time 2024 (Universal Theory for Everything)Theory of Time 2024 (Universal Theory for Everything)
Theory of Time 2024 (Universal Theory for Everything)Ramkumar k
 
Computer Graphics Introduction To Curves
Computer Graphics Introduction To CurvesComputer Graphics Introduction To Curves
Computer Graphics Introduction To CurvesChandrakantDivate1
 
8th International Conference on Soft Computing, Mathematics and Control (SMC ...
8th International Conference on Soft Computing, Mathematics and Control (SMC ...8th International Conference on Soft Computing, Mathematics and Control (SMC ...
8th International Conference on Soft Computing, Mathematics and Control (SMC ...josephjonse
 
School management system project Report.pdf
School management system project Report.pdfSchool management system project Report.pdf
School management system project Report.pdfKamal Acharya
 
Augmented Reality (AR) with Augin Software.pptx
Augmented Reality (AR) with Augin Software.pptxAugmented Reality (AR) with Augin Software.pptx
Augmented Reality (AR) with Augin Software.pptxMustafa Ahmed
 
Path loss model, OKUMURA Model, Hata Model
Path loss model, OKUMURA Model, Hata ModelPath loss model, OKUMURA Model, Hata Model
Path loss model, OKUMURA Model, Hata ModelDrAjayKumarYadav4
 
Hospital management system project report.pdf
Hospital management system project report.pdfHospital management system project report.pdf
Hospital management system project report.pdfKamal Acharya
 
Ground Improvement Technique: Earth Reinforcement
Ground Improvement Technique: Earth ReinforcementGround Improvement Technique: Earth Reinforcement
Ground Improvement Technique: Earth ReinforcementDr. Deepak Mudgal
 
Fundamentals of Internet of Things (IoT) Part-2
Fundamentals of Internet of Things (IoT) Part-2Fundamentals of Internet of Things (IoT) Part-2
Fundamentals of Internet of Things (IoT) Part-2ChandrakantDivate1
 
Databricks Generative AI Fundamentals .pdf
Databricks Generative AI Fundamentals  .pdfDatabricks Generative AI Fundamentals  .pdf
Databricks Generative AI Fundamentals .pdfVinayVadlagattu
 
Adsorption (mass transfer operations 2) ppt
Adsorption (mass transfer operations 2) pptAdsorption (mass transfer operations 2) ppt
Adsorption (mass transfer operations 2) pptjigup7320
 
Hostel management system project report..pdf
Hostel management system project report..pdfHostel management system project report..pdf
Hostel management system project report..pdfKamal Acharya
 

Recently uploaded (20)

Introduction to Robotics in Mechanical Engineering.pptx
Introduction to Robotics in Mechanical Engineering.pptxIntroduction to Robotics in Mechanical Engineering.pptx
Introduction to Robotics in Mechanical Engineering.pptx
 
Standard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power PlayStandard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power Play
 
Danikor Product Catalog- Screw Feeder.pdf
Danikor Product Catalog- Screw Feeder.pdfDanikor Product Catalog- Screw Feeder.pdf
Danikor Product Catalog- Screw Feeder.pdf
 
Passive Air Cooling System and Solar Water Heater.ppt
Passive Air Cooling System and Solar Water Heater.pptPassive Air Cooling System and Solar Water Heater.ppt
Passive Air Cooling System and Solar Water Heater.ppt
 
Post office management system project ..pdf
Post office management system project ..pdfPost office management system project ..pdf
Post office management system project ..pdf
 
Worksharing and 3D Modeling with Revit.pptx
Worksharing and 3D Modeling with Revit.pptxWorksharing and 3D Modeling with Revit.pptx
Worksharing and 3D Modeling with Revit.pptx
 
Theory of Time 2024 (Universal Theory for Everything)
Theory of Time 2024 (Universal Theory for Everything)Theory of Time 2024 (Universal Theory for Everything)
Theory of Time 2024 (Universal Theory for Everything)
 
Computer Graphics Introduction To Curves
Computer Graphics Introduction To CurvesComputer Graphics Introduction To Curves
Computer Graphics Introduction To Curves
 
8th International Conference on Soft Computing, Mathematics and Control (SMC ...
8th International Conference on Soft Computing, Mathematics and Control (SMC ...8th International Conference on Soft Computing, Mathematics and Control (SMC ...
8th International Conference on Soft Computing, Mathematics and Control (SMC ...
 
School management system project Report.pdf
School management system project Report.pdfSchool management system project Report.pdf
School management system project Report.pdf
 
Integrated Test Rig For HTFE-25 - Neometrix
Integrated Test Rig For HTFE-25 - NeometrixIntegrated Test Rig For HTFE-25 - Neometrix
Integrated Test Rig For HTFE-25 - Neometrix
 
Augmented Reality (AR) with Augin Software.pptx
Augmented Reality (AR) with Augin Software.pptxAugmented Reality (AR) with Augin Software.pptx
Augmented Reality (AR) with Augin Software.pptx
 
Path loss model, OKUMURA Model, Hata Model
Path loss model, OKUMURA Model, Hata ModelPath loss model, OKUMURA Model, Hata Model
Path loss model, OKUMURA Model, Hata Model
 
Hospital management system project report.pdf
Hospital management system project report.pdfHospital management system project report.pdf
Hospital management system project report.pdf
 
Signal Processing and Linear System Analysis
Signal Processing and Linear System AnalysisSignal Processing and Linear System Analysis
Signal Processing and Linear System Analysis
 
Ground Improvement Technique: Earth Reinforcement
Ground Improvement Technique: Earth ReinforcementGround Improvement Technique: Earth Reinforcement
Ground Improvement Technique: Earth Reinforcement
 
Fundamentals of Internet of Things (IoT) Part-2
Fundamentals of Internet of Things (IoT) Part-2Fundamentals of Internet of Things (IoT) Part-2
Fundamentals of Internet of Things (IoT) Part-2
 
Databricks Generative AI Fundamentals .pdf
Databricks Generative AI Fundamentals  .pdfDatabricks Generative AI Fundamentals  .pdf
Databricks Generative AI Fundamentals .pdf
 
Adsorption (mass transfer operations 2) ppt
Adsorption (mass transfer operations 2) pptAdsorption (mass transfer operations 2) ppt
Adsorption (mass transfer operations 2) ppt
 
Hostel management system project report..pdf
Hostel management system project report..pdfHostel management system project report..pdf
Hostel management system project report..pdf
 

Stream Cipher.pptx

  • 1.
  • 2. Part 1  Cryptography 2 Chapter 3: Symmetric Key Crypto The chief forms of beauty are order and symmetry…  Aristotle “You boil it in sawdust: you salt it in glue: You condense it with locusts and tape: Still keeping one principal object in view  To preserve its symmetrical shape.”  Lewis Carroll, The Hunting of the Snark
  • 3. Stream and Block Ciphers • Stream Ciphers and block ciphers are two categories of ciphers used in classical cryptography. • Stream and Block Ciphers differ in how large a piece of the message is processed in each encryption operation. • Stream ciphers encrypt plaintext one byte or one bit at a time. • Block ciphers encrypt plaintext in chunks. Common block sizes are 64 and 128 bits. 3
  • 4. Stream Cipher • Stream Cipher – encryption of bits – Often pseudorandom generators – Simple and fast – Not very secure – RC4, A5/1 – Inspired by the one time pad (OTP) – A one-time pad uses a keystream of completely random digits. The keystream is combined with the plaintext digits one at a time to form the cipher text. – http://en.wikipedia.org/wiki/Stream_cipher 4
  • 5. Block Ciphers • Block Cipher is a symmetric key cipher operating on fixed-length groups of bits, called blocks, with an unvarying transformation. A block cipher encryption algorithm might take (for example) a 128-bit block of plaintext as input, and output a corresponding 128- bit block of cipher text. The exact transformation is controlled using a second input — the secret key. • Short explanation – DES, 3DES, AES, IDEA,TEA,XTEA 5
  • 6. Part 1  Cryptography 6 Symmetric Key Crypto • Stream cipher  based on one-time pad – Except that key is relatively short – Key is stretched into a long keystream – Keystream is used just like a one-time pad • Block cipher  based on codebook concept – Block cipher key determines a codebook – Each key yields a different codebook – Employs both “confusion” and “diffusion”
  • 7. Part 1  Cryptography 7 Stream Ciphers A stream cipher takes a key K of n bits in length and stretches it into a long keystream. This keystream is then XORed with the plaintext P to produce ciphertext C. The use of the keystream is identical to the use of the key in a one-time pad cipher. To decrypt with a stream cipher, the same keystream is generated and XORed with the ciphertext. The function of a stream cipher can be viewed simply as StreamCipher(K) = S where K is the key and S is the keystream that we’ll use like a one-time pad. The encryption formula is c0 = p0 ⊕ s0, c1 = p1 ⊕ s1, c2 = p2 ⊕ s2, . . . where P = p0p1p2 . . . is the plaintext, S = s0s1s2 . . . is the keystream and C = c0c1c2 . . . is the ciphertext. To decrypt ciphertext C, the keystream S is again used p0 = c0 ⊕ s0, p1 = c1 ⊕ s1, p2 = c2 ⊕ s2, . . . . Provided that both the sender and receiver have the same stream cipher algorithm and that both know the key K, this system is a practical generalization of the one-time pad— although not provably secure in the sense of the one-time pad.
  • 8. Part 1  Cryptography 8 Stream Ciphers • Once upon a time, not so very long ago, stream ciphers were the king of crypto • Today, not as popular as block ciphers • We’ll discuss two stream ciphers… • A5/1 – Based on shift registers – Used in GSM mobile phone system • RC4 – Based on a changing lookup table – Used many places
  • 9. Part 1  Cryptography 9 A5/1: Shift Registers • A5/1 uses 3 shift registers – X: 19 bits (x0,x1,x2, …,x18) – Y: 22 bits (y0,y1,y2, …,y21) – Z: 23 bits (z0,z1,z2, …,z22)
  • 10. Part 1  Cryptography 10 A5/1: Keystream • At each step: m = maj(x8, y10, z10) – Examples: maj(0,1,0) = 0 and maj(1,1,0) = 1 • If x8 = m then X steps – t = x13  x16  x17  x18 – xi = xi1 for i = 18,17,…,1 and x0 = t • If y10 = m then Y steps – t = y20  y21 – yi = yi1 for i = 21,20,…,1 and y0 = t • If z10 = m then Z steps – t = z7  z20  z21  z22 – zi = zi1 for i = 22,21,…,1 and z0 = t • Keystream bit is x18  y21  z22
  • 11. Part 1  Cryptography 11 A5/1 • Each variable here is a single bit • Key is used as initial fill of registers • Each register steps (or not) based on maj(x8, y10, z10) • Keystream bit is XOR of rightmost bits of registers y0 y1 y2 y3 y4 y5 y6 y7 y8 y9 y10 y11 y12 y13 y14 y15 y16 y17 y18 y19 y20 y21 z0 z1 z2 z3 z4 z5 z6 z7 z8 z9 z10 z11 z12 z13 z14 z15 z16 z17 z18 z19 z20 z21 z22 X Y Z     x0 x1 x2 x3 x4 x5 x6 x7 x8 x9 x10 x11 x12 x13 x14 x15 x16 x17 x18
  • 12. Part 1  Cryptography 12 A5/1 • In this example, m = maj(x8, y10, z10) = maj(1,0,1) = 1 • Register X steps, Y does not step, and Z steps • Keystream bit is XOR of right bits of registers • Here, keystream bit will be 0  1  0 = 1 1 1 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1 0 0 0 1 1 1 1 0 0 0 0 1 1 1 1 0 0 0 0 1 1 1 1 0 0 0 1 X Y Z     1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1
  • 13. A5/1 exercise (8) • Implement the A5/1 algorithm. Suppose that, after a particular step, the values in the registers are • X = (x0, x1, . . . , x18) = (1010101010101010101) • Y = (y0, y1, . . . , y21) = (1100110011001100110011) • Z = (z0, z1, . . . , z22) = (11100001111000011110000) • Generate and print the next 32 keystream bits. Print the contents of X, Y and Z after the 32 keystream bits have been generated Part 1  Cryptography 13
  • 14. • sol • X = (x0, x1, . . . , x18) = (10 10 10 10 10 10 10 10 10 1) • Y = (y0, y1, . . . , y21) = (11 00 11 00 11 00 11 00 11 00 11) • Z = (z0, z1, . . . , z22) = (11 10 00 01 11 10 00 01 11 10 00 0) • M= major vote (maj(x8,y10,z10)) • M=maj(1,0,1)=1 • For register x • Compare x8=1 with m =1 they are equal then do step • Tx=x13 ⊕ x16 ⊕ x17 ⊕ x18 • Tx=0 ⊕ 1⊕ 0⊕ 1, Tx=0 • X = (tx,,x0, x1, . . . , x17) = (0 10 10 10 10 10 10 10 10 10) • For register y • Compare y10=0 with m =1 they are not equal then do not do step • Y = (y0, y1, . . . , y21) = (11 00 11 00 11 00 11 00 11 00 11) • For register z • Compare z10=1 with m =1 they are equal then do step  Tz= z7  z20  z21  z22  Tz= 1 0  0  0 = 1  Z = (Tz, z0, z1, . . . , z21) = (1 11 10 00 01 11 10 00 01 11 10 00)  Keystream bit is x18  y21  z22 = 0 1  0 =1
  • 15. Part 1  Cryptography 15 Shift Register Crypto • Shift register crypto efficient in hardware • Often, slow if implement in software • In the past, very popular • Today, more is done in software due to fast processors • Shift register crypto still used some – Resource-constrained devices
  • 16. Part 1  Cryptography 16 Stream Ciphers • Stream ciphers were popular in the past – Efficient in hardware – Speed was needed to keep up with voice, etc. – Today, processors are fast, so software-based crypto is usually more than fast enough • Future of stream ciphers? – Shamir declared “the death of stream ciphers” – May be greatly exaggerated…