Aptitude Engineering Mathematics Discrete Mathematics Operating System DBMS Computer
Stream Ciphers
Last Updated : 29 Mar, 2024
In stream cipher, one byte is encrypted at a time while in block cipher
~128 bits are encrypted at a time. Initially, a key(k) will be supplied as
input to pseudorandom bit generator and then it produces a random 8-bit
output which is treated as keystream. The resulted keystream will be of
size 1 byte, i.e., 8 bits. Stream ciphers are fast because they encrypt data
bit by bit or byte by byte, which makes them efficient for encrypting large
amounts of data quickly.Stream ciphers work well for real-time
communication, such as video streaming or online gaming, because they
can encrypt and decrypt data as it’s being transmitted.
Key Points of Stream Cipher
1. Stream Cipher follows the sequence of pseudorandom number stream.
2. One of the benefits of following stream cipher is to make cryptanalysis
more difficult, so the number of bits chosen in the Keystream must be
long in order to make cryptanalysis more difficult.
3. By making the key more longer it is also safe against brute force
attacks.
4. The longer the key the stronger security is achieved, preventing any
attack.
5. Keystream can be designed more efficiently by including more number
of 1s and 0s, for making cryptanalysis more difficult.
6. Considerable benefit of a stream cipher is, it requires few lines of code
compared to block cipher.
Encryption
For Encryption, Open In App
Plain Text and Keystream produces Cipher Text (Same keystream will
be used for decryption.).
The Plaintext will undergo XOR operation with keystream bit-by-bit and
produces the Cipher Text.
Example:
Plain Text : 10011001
Keystream : 11000011
““““““““““`
Cipher Text : 01011010
Decryption
For Decryption,
Cipher Text and Keystream gives the original Plain Text (Same
keystream will be used for encryption.).
The Ciphertext will undergo XOR operation with keystream bit-by-bit
and produces the actual Plain Text.
Example:
Cipher Text : 01011010
Keystream : 11000011
“““““““““““
Plain Text : 10011001
Decryption is just the reverse process of Encryption i.e. performing XOR
with Cipher Text. Open In App
Diagram of Stream Cipher
Common Stream Ciphers
When someone analyzes stream ciphers in general, they frequently bring
up RC4. Thoroughly used, this is the most extensively used stream cipher.
The RC4 cipher operates as follows:
There are many of alternative choices. Wikipedia provides a list of 25
distinct kinds of stream ciphers with a range of costs, speeds, and
complexity.
Creating a strong security system involves more than just selecting the
appropriate encryption technique. In addition, firewalls, appropriate
keyword storage, and staff training are necessary for data protection.
Advantages of Stream Ciphers
Stream ciphers have many advantages, such as:
Speed: Generally, this type of encryption is quicker than others, such as
block ciphers.
Low complexity: Stream ciphers are simple to implement into
contemporary software, and developers don’t require sophisticated
hardware to do so.
Sequential in nature: Certain companies handle communications
written in a continuous manner. Stream ciphers enable them to
Open In App
transmit data when it’s ready instead of waiting for everything to be
finished because of their bit-by-bit processing.
Accessibility: Using symmetrical encryption methods like stream
ciphers saves businesses from having to deal with public and private
keys. Additionally, computers are able to select the appropriate
decryption key to utilize thanks to mathematical concepts behind
current stream ciphers.
Disadvantages of Stream Ciphers
If an error occurs during transmission, it can affect subsequent bits,
potentially corrupting the entire message because stream ciphers rely
on previously stored cipher bits for decryption
Maintaining and properly distributing keys to stream ciphers can be
difficult, especially in large systems or networks.
Some stream ciphers may be predictable or vulnerable to attack if their
key stream is not properly designed, potentially compromising the
security of the encrypted data.
Difference between Stream Cipher and Block Cipher
The symmetric key cipher family includes block ciphers and stream
ciphers. The techniques used to transform plaintext in ciphertext are both
of these block ciphers and stream cipher. A Block Cipher and a Stream
Cipher vary primarily in that a Block Cipher takes one block of plain text at
a time and transforms it into ciphertext. While the stream cipher takes one
byte of normal text at a time and converts it into cipher text.
Stream Cipher Block Cipher
By taking one bit of ordinary text at a time, the
Block Ciphers Encrypts
stream cipher transforms plain text into cipher
data in fixed-size blocks.
text.
Open In App
Stream Cipher Block Cipher
It is basically used for
Used for data-in-transit encryption.
data-at-rest encryption.
It needs high processing
It requires low processing power.
power.
It requires high
It has low computational load.
computational load.
Stream Cipher cannot operate as a block Block ciphers can operate
cipher. as a stream cipher.
In short, stream ciphers encrypt data bit by byte as it is transmitted, while
block ciphers encrypt data of a fixed size at a time.
"GeeksforGeeks helped me ace the GATE exam! Whenever I had any doubt
regarding any topic, GFG always helped me and made my concepts quiet
clear." - Anshika Modi | AIR 21
Choose GeeksforGeeks as your perfect GATE 2025 Preparation partner
with these newly launched programs
GATE CS & IT- Online
GATE DS & AI- Online
Over 150,000+ students already trust us to be their GATE Exam guide.
Join them & let us help you in opening the GATE to top-tech IITs & NITs!
C Chakr… Follow 20
Open In App
Next Article
Feistel Cipher
Similar Reads
Traditional Symmetric Ciphers
The two types of traditional symmetric ciphers are Substitution Cipher and
Transposition Cipher. The following flowchart categories the traditional…
3 min read
Autokey Cipher | Symmetric Ciphers
Autokey Cipher is a polyalphabetic substitution cipher. It is closely related to
the Vigenere cipher but uses a different method of generating the key. It w…
4 min read
Difference between AES and DES ciphers
Advanced Encryption Standard (AES) is a highly trusted encryption
algorithm used to secure data by converting it into an unreadable format…
5 min read
Stream Control Transmission Protocol (SCTP)
Stream Control Transmission Protocol (SCTP) is a network protocol that is
connection-oriented and used for transmitting multiple streams of data…
8 min read
Difference between Block Cipher and Stream Cipher
Prerequisite - Block cipher modes of operation Block Cipher and Stream
Cipher belongs to the symmetric key cipher. These two block ciphers and…
2 min read
Computer Network Tutorial
Open In App
A computer network is a collection of computers or devices connected to
share resources. Any device which can share or receive the data is called a…
8 min read
Difference Between OSI Model and TCP/IP Model
Data communication is a process or act in which we can send or receive
data. Understanding the fundamental structures of networking is crucial fo…
5 min read
Data Link Layer
The data link layer is the second layer from the bottom in the OSI (Open
System Interconnection) network architecture model. It is responsible for…
4 min read
Advanced Encryption Standard (AES)
Advanced Encryption Standard (AES) is a specification for the encryption of
electronic data established by the U.S. National Institute of Standards and…
8 min read
Top 50 Plus Networking Interview Questions and Answers for 2024
Networking is defined as connected devices that may exchange data or
information and share resources. A computer network connects computer…
15+ min read
How to Check and Delete Incognito History in Google Chrome?
Incognito mode in Google Chrome is designed to keep your browsing history
private, but it's important to understand how to check and delete any trace…
11 min read
Types of Computer Networks
A computer network is a cluster of computers over a shared communication
path that works to share resources from one computer to another, provide…
11 min read
Open In App
World Wide Web (WWW)
The World Wide Web (WWW), often called the Web, is a system of
interconnected webpages and information that you can access using the…
6 min read
Cryptography and its Types
Cryptography is a technique of securing communication by converting plain
text into ciphertext. It involves various algorithms and protocols to ensure…
7 min read
Difference Between IPv4 and IPv6
The address through which any computer communicates with our computer
is simply called an Internet Protocol Address or IP address. For example, if…
7 min read
Differences between TCP and UDP
Transmission Control Protocol (TCP) and User Datagram Protocol (UDP)
both are protocols of the Transport Layer Protocols. TCP is a connection-…
8 min read
Types of Transmission Media
Transmission media refer to the physical pathways through which data is
transmitted from one device to another within a network. These pathways…
8 min read
Hamming Code in Computer Network
Hamming code is an error-correcting code used to ensure data accuracy
during transmission or storage. Hamming code detects and corrects the…
11 min read
TCP 3-Way Handshake Process
Open In App
The TCP 3-Way Handshake is a fundamental process that establishes a
reliable connection between two devices over a TCP/IP network. It involves…
6 min read
TCP/IP Model
The TCP/IP model is a fundamental framework for computer networking. It
stands for Transmission Control Protocol/Internet Protocol, which are the…
13 min read
What is OSI Model? - Layers of OSI Model
OSI stands for Open Systems Interconnection, where open stands to say
non-proprietary. It is a 7-layer architecture with each layer having specific…
15+ min read
Basics of Computer Networking
Computer networking is a cornerstone of modern technology, enabling the
interconnected systems that power the Internet, business communications…
12 min read
Transmission Modes in Computer Networks (Simplex, Half-Duplex…
Transmission modes also known as communication modes, are methods of
transferring data between devices on buses and networks designed to…
6 min read
RSA Algorithm in Cryptography
RSA algorithm is an asymmetric cryptography algorithm. Asymmetric
actually means that it works on two different keys i.e. Public Key and Privat…
15+ min read
Types of Network Topology
Network topology refers to the arrangement of different elements like
nodes, links, and devices in a computer network. It defines how these…
11 min read
Open In App
Domain Name System (DNS) in Application Layer
The Domain Name System (DNS) is like the internet's phone book. It helps
you find websites by translating easy-to-remember names (like…
9 min read
Caesar Cipher in Cryptography
The Caesar Cipher is one of the simplest and oldest methods of encrypting
messages, named after Julius Caesar, who reportedly used it to protect his…
12 min read
Error Detection in Computer Networks
Error is a condition when the receiver's information does not match the
sender's. Digital signals suffer from noise during transmission that can…
7 min read
Network Devices (Hub, Repeater, Bridge, Switch, Router, Gateways…
Network Devices: Network devices, also known as networking hardware, are
physical devices that allow hardware on a computer network to…
6 min read
Introduction of Classful IP Addressing
An IP address is an address that has information about how to reach a
specific host, especially outside the LAN. An IP address is a 32-bit unique…
10 min read
Article Tags : Computer Networks cryptography Network-security
Corporate & Communications Address:-
A-143, 9th Floor, Sovereign Corporate
Open In App
Tower, Sector- 136, Noida, Uttar
Pradesh (201305) | Registered
Address:- K 061, Tower K, Gulshan
Vivante Apartment, Sector 137, Noida,
Gautam Buddh Nagar, Uttar Pradesh,
201305
Company Explore
About Us Job-A-Thon Hiring Challenge
Legal Hack-A-Thon
Careers GfG Weekly Contest
In Media Offline Classes (Delhi/NCR)
Contact Us DSA in JAVA/C++
Advertise with us Master System Design
GFG Corporate Solution Master CP
Placement Training Program GeeksforGeeks Videos
Geeks Community
Languages DSA
Python Data Structures
Java Algorithms
C++ DSA for Beginners
PHP Basic DSA Problems
GoLang DSA Roadmap
SQL DSA Interview Questions
R Language Competitive Programming
Android Tutorial
Data Science & ML Web Technologies
Data Science With Python HTML
Data Science For Beginner CSS
Machine Learning Tutorial JavaScript
ML Maths TypeScript
Data Visualisation Tutorial ReactJS
Pandas Tutorial NextJS
NumPy Tutorial NodeJs
NLP Tutorial Bootstrap
Deep Learning Tutorial Tailwind CSS
Python Tutorial Open In App Computer Science
Python Programming Examples GATE CS Notes
Django Tutorial Operating Systems
Python Projects Computer Network
Python Tkinter Database Management System
Web Scraping Software Engineering
OpenCV Tutorial Digital Logic Design
Python Interview Question Engineering Maths
DevOps System Design
Git High Level Design
AWS Low Level Design
Docker UML Diagrams
Kubernetes Interview Guide
Azure Design Patterns
GCP OOAD
DevOps Roadmap System Design Bootcamp
Interview Questions
School Subjects Commerce
Mathematics Accountancy
Physics Business Studies
Chemistry Economics
Biology Management
Social Science HR Management
English Grammar Finance
Income Tax
Databases Preparation Corner
SQL Company-Wise Recruitment Process
MYSQL Resume Templates
PostgreSQL Aptitude Preparation
PL/SQL Puzzles
MongoDB Company-Wise Preparation
Companies
Colleges
Competitive Exams More Tutorials
JEE Advanced Software Development
UGC NET Software Testing
UPSC Product Management
SSC CGL Project Management
SBI PO Linux
SBI Clerk Excel
IBPS PO All Cheat Sheets
IBPS Clerk Recent Articles
Open In App
Free Online Tools Write & Earn
Typing Test Write an Article
Image Editor Improve an Article
Code Formatters Pick Topics to Write
Code Converters Share your Experiences
Currency Converter Internships
Random Number Generator
Random Password Generator
@GeeksforGeeks, Sanchhaya Education Private Limited, All rights reserved
Open In App