0% found this document useful (0 votes)
19 views21 pages

cn-Syllabus_Unit_1-_FOC

The syllabus covers the fundamentals of cryptography, including symmetric and asymmetric key encryption, historical ciphers, and various cryptographic techniques and algorithms. It discusses the importance of confidentiality, integrity, and authentication in securing information, as well as applications in digital currencies, secure web browsing, and electronic signatures. The document also highlights the differences between symmetric and asymmetric cryptography, along with their respective advantages and disadvantages.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
19 views21 pages

cn-Syllabus_Unit_1-_FOC

The syllabus covers the fundamentals of cryptography, including symmetric and asymmetric key encryption, historical ciphers, and various cryptographic techniques and algorithms. It discusses the importance of confidentiality, integrity, and authentication in securing information, as well as applications in digital currencies, secure web browsing, and electronic signatures. The document also highlights the differences between symmetric and asymmetric cryptography, along with their respective advantages and disadvantages.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 21

Syllabus: Fundamentals of Cryptography

Unit 01
Introduction of cryptography, Symmetric-key Encryption, Historical Ciphers, Computational
Security, Semantic Security and Pseudorandom Generators (PRGs), Perfect secrecy. One-time-
pad encryption. Characterizations of perfect secrecy, Limitations of perfect secrecy.

Unit 02
CPA-Secure Ciphers from PRF, Modes of Operations of Block Ciphers, DES, AES and Message
Authentication Codes (MAC), Information-theoretic Secure MAC, Cryptographic Hash
Functions.

Unit 03
Ideal-Cipher Model, Davies-Meyer construction and Merkle - Damgård Paradigm, Birthday
Attacks on Cryptographic Hash Functions, Applications of Hash Functions, Random Oracle
Model and Authenticated Encryption. Generic Constructions of Authenticated Encryption
Schemes, Key-exchange Problem, One-way Trapdoor Functions and Cyclic Groups.

Unit 04
Discrete-Logarithm Problem, Computational Diffie-Hellman Problem, Decisional, Diffie-
Hellman Problem, Elliptic-Curve Based Cryptography and Public-Key Encryption.

Unit 05
CCA -secure Public-key Hybrid Ciphers Based on Diffie-Hellman Problems and RSA-
assumption, Digital Signatures, Overview of TLS/SSL, Number Theory, Interactive Protocols.

Downloaded from www.notesmates.in Uploaded on: 3/2/2025, 3:44:39 pm

ANKUR CHOUDHARY - ankurchoudhary230663@acropolis.in


UNIT-I
Cryptography is technique of securing information and communications through use of codes
so that only those person for whom the information is intended can understand it and process
it. Thus preventing unauthorized access to information. The prefix “crypt” means “hidden” and
suffix “graphy” means “writing”. In Cryptography the techniques which are use to protect
information are obtained from mathematical concepts and a set of rule based calculations
known as algorithms to convert messages in ways that make it hard to decode it. These
algorithms are used for cryptographic key generation, digital signing, verification to protect
data privacy, web browsing on internet and to protect confidential transactions such as credit
card and debit card transactions.

Techniques used For Cryptography: In today’s age of computers cryptography is often


associated with the process where an ordinary plain text is converted to cipher text which is the
text made such that intended receiver of the text can only decode it and hence this process is
known as encryption. The process of conversion of cipher text to plain text this is known as
decryption.

Features Of Cryptography are as follows:

1. Confidentiality: Information can only be accessed by the person for whom it is


intended and no other person except him can access it.
2. Integrity: Information cannot be modified in storage or transition between sender
and intended receiver without any addition to information being detected.
3. Non-repudiation: The creator/sender of information cannot deny his intention to
send information at later stage.
4. Authentication: The identities of sender and receiver are confirmed. As well as
destination/origin of information is confirmed.

Types of Cryptography: In general there are three types of cryptography:

1. Symmetric Key Cryptography: It is an encryption system where the sender and


receiver of message use a single common key to encrypt and decrypt messages.
Symmetric Key Systems are faster and simpler but the problem is that sender and
receiver have to somehow exchange key in a secure manner. The most popular
symmetric key cryptography system are Data Encryption System(DES) and
Advanced Encryption System(AES).

Downloaded from www.notesmates.in Uploaded on: 3/2/2025, 3:44:39 pm

ANKUR CHOUDHARY - ankurchoudhary230663@acropolis.in


2. Hash Functions: There is no usage of any key in this algorithm. A hash value with
fixed length is calculated as per the plain text which makes it impossible for
contents of plain text to be recovered. Many operating systems use hash functions to
encrypt passwords.
3. Asymmetric Key Cryptography: Under this system a pair of keys is used to
encrypt and decrypt information. A receiver’s public key is used for encryption and
a receiver’s private key is used for decryption. Public key and Private Key are
different. Even if the public key is known by everyone the intended receiver can
only decode it because he alone know his private key. The most popular asymmetric
key cryptography algorithm is RSA algorithm.

Applications of Cryptography:

1. Computer passwords: Cryptography is widely utilized in computer security,


particularly when creating and maintaining passwords. When a user logs in, their
password is hashed and compared to the hash that was previously stored. Passwords
are hashed and encrypted before being stored. In this technique, the passwords are
encrypted so that even if a hacker gains access to the password database, they
cannot read the passwords.
2. Digital Currencies: To safeguard transactions and prevent fraud, digital currencies
like Bitcoin also use cryptography. Complex algorithms and cryptographic keys are
used to safeguard transactions, making it nearly hard to tamper with or forge the
transactions.
3. Secure web browsing: Online browsing security is provided by the use of
cryptography, which shields users from eavesdropping and man-in-the-middle
assaults. Public key cryptography is used by the Secure Sockets Layer (SSL) and
Transport Layer Security (TLS) protocols to encrypt data sent between the web
server and the client, establishing a secure channel for communication.
4. Electronic signatures: Electronic signatures serve as the digital equivalent of a
handwritten signature and are used to sign documents. Digital signatures are created
using cryptography and can be validated using public key cryptography. In many
nations, electronic signatures are enforceable by law, and their use is expanding
quickly.
5. Authentication: Cryptography is used for authentication in many different
situations, such as when accessing a bank account, logging into a computer, or
using a secure network. Cryptographic methods are employed by authentication
protocols to confirm the user’s identity and confirm that they have the required
access rights to the resource.
6. Cryptocurrencies: Cryptography is heavily used by cryptocurrencies like Bitcoin
and Ethereum to safeguard transactions, thwart fraud, and maintain the network’s
integrity. Complex algorithms and cryptographic keys are used to safeguard
transactions, making it nearly hard to tamper with or forge the transactions.
7. End-to-End Encryption: End-to-end encryption is used to protect two-way
communications like video conversations, instant messages, and email. Even if the
message is encrypted, it assures that only the intended receivers can read the

Downloaded from www.notesmates.in Uploaded on: 3/2/2025, 3:44:39 pm

ANKUR CHOUDHARY - ankurchoudhary230663@acropolis.in


message. End-to-end encryption is widely used in communication apps like
WhatsApp and Signal, and it provides a high level of security and privacy for users.

Advantages

1. Access Control: Cryptography can be used for access control to ensure that only
parties with the proper permissions have access to a resource. Only those with the
correct decryption key can access the resource thanks to encryption.
2. Secure Communication: For secure online communication, cryptography is
crucial. It offers secure mechanisms for transmitting private information like
passwords, bank account numbers, and other sensitive data over the internet.
3. Protection against attacks: Cryptography aids in the defence against various types
of assaults, including replay and man-in-the-middle attacks. It offers strategies for
spotting and stopping these assaults.
4. Compliance with legal requirements: Cryptography can assist firms in meeting a
variety of legal requirements, including data protection and privacy legislation.

Symmetric Key Encryption: Encryption is a process to change the form of any message in
order to protect it from reading by anyone. In Symmetric-key encryption the message is
encrypted by using a key and the same key is used to decrypt the message which makes it easy
to use but less secure. It also requires a safe method to transfer the key from one party to
another.

Asymmetric Key Encryption: Asymmetric Key Encryption is based on public and private key
encryption techniques. It uses two different key to encrypt and decrypt the message. It is more
secure than the symmetric key encryption technique but is much slower.

Symmetric Key Encryption Asymmetric Key Encryption

It requires two keys, a public key and a


It only requires a single key for both
private key, one to encrypt and the other one
encryption and decryption.
to decrypt.

The size of cipher text is the same or smaller The size of cipher text is the same or larger
than the original plain text. than the original plain text.

The encryption process is very fast. The encryption process is slow.

It is used when a large amount of data is


It is used to transfer small amounts of data.
required to transfer.

Downloaded from www.notesmates.in Uploaded on: 3/2/2025, 3:44:39 pm

ANKUR CHOUDHARY - ankurchoudhary230663@acropolis.in


Symmetric Key Encryption Asymmetric Key Encryption

It provides confidentiality, authenticity, and


It only provides confidentiality.
non-repudiation.

The length of key used is 128 or 256 bits The length of key used is 2048 or higher

In symmetric key encryption, resource


In asymmetric key encryption, resource
utilization is low as compared to asymmetric
utilization is high.
key encryption.

It is efficient as it is used for handling large It is comparatively less efficient as it can


amount of data. handle a small amount of data.

It is more secure as two keys are used here-


Security is less as only one key is used for both
one for encryption and the other for
encryption and decryption purpose.
decryption.

The Mathematical Representation is as


The Mathematical Representation is as
follows-
follows-
P = D(Kd, E (Ke,P))
P = D (K, E(K, P))
where Ke –> encryption key
where K –> encryption and decryption key
Kd –> decryption key
P –> plain text
D –> Decryption
D –> Decryption
E(Ke, P) –> Encryption of plain text using
E(K, P) –> Encryption of plain text using K
encryption key Ke. P –> plain text

Examples: Diffie-Hellman, ECC, El Gamal,


Examples: 3DES, AES, DES and RC4
DSA and RSA

Difference between Private key and Public key


Cryptography is the science of secret writing with the intention of keeping the data secret.
Cryptography is classified into symmetric cryptography, asymmetric cryptography, and hashing.
Private Key:
In the Private key, the same key (secret key) is used for encryption and decryption. In this key is
symmetric because the only key is copied or shared by another party to decrypt the cipher text. It
is faster than public-key cryptography.
Public Key:

Downloaded from www.notesmates.in Uploaded on: 3/2/2025, 3:44:39 pm

ANKUR CHOUDHARY - ankurchoudhary230663@acropolis.in


In a Public key, two keys are used one key is used for encryption and another key is used for
decryption. One key (public key) is used to encrypt the plain text to convert it into cipher text
and another key (private key) is used by the receiver to decrypt the cipher text to read the
message. Now, we see the difference between them:
Difference between Private Key and Public Key:
S.NO Private Key Public Key

The private key is faster than the public


It is slower than a private key.
1. key.

In this, the same key (secret key) and In public-key cryptography, two keys are
algorithm are used to encrypt and decrypt used, one key is used for encryption, and
2. the message. the other is used for decryption.

In private key cryptography, the key is In public-key cryptography, one of the two
3. kept a secret. keys is kept a secret.

The private key is Symmetrical because The public key is Asymmetrical because
there is only one key that is called a secret there are two types of keys: private and
4. key. public keys.

In this cryptography, the sender and In this cryptography, the sender and
5. receiver need to share the same key. receiver do not need to share the same key.

In this cryptography, the public key can be


In this cryptography, the key is private.
6. public and a private key is private.

7. It is an efficient technology. It is an inefficient technology.

8. It is used for large amounts of text. It is used for only short messages.

There is the possibility of losing the key There is less possibility of key loss, as the
9. that renders the systems void. key is held publicly.

Downloaded from www.notesmates.in Uploaded on: 3/2/2025, 3:44:39 pm

ANKUR CHOUDHARY - ankurchoudhary230663@acropolis.in


S.NO Private Key Public Key

The private key is to be shared between


The public key can be used by anyone.
10. two parties.

The Performance testing checks the


The Load testing checks the sustainability
reliability, scalability, and speed of the
of the system.
11. system.

The private key is used in algorithms such The public key is used in algorithms such
12. as AES 128, AES 192 and AES 256. as RSA, DSA, etc.

13. The private key is kept secret. The public key is widely distributed.

It is used to protect disk drives and other It is used to secure web sessions and
14. data storage devices. emails.

The recipient’s private key decrypts the The recipient’s public key encrypts the
15. message. message.

If the private key is the locking key, then


If the public key is the locking key, then it
the system can be used to verify
can be used to send private
documents sent by the holder of the private
communication.
16. key.

Historical Cryptography Ciphers

Like most technologies, encryption has evolved throughout the years from simple origins. While
modern encryption relies on complex computational operations, older encryption ciphers were
rudimentary and easy to break. Regardless of each cipher’s strength, all encryption methods
share a common goal, to encode a readable “plaintext” message in a way that prevents
unauthorized individuals from reading it. Let’s explore the history of encryption and some
historical ciphers that were used to hide messages from prying eyes.

Substitution Ciphers

Downloaded from www.notesmates.in Uploaded on: 3/2/2025, 3:44:39 pm

ANKUR CHOUDHARY - ankurchoudhary230663@acropolis.in


Caesar Cipher

The Caesar cipher, also called a Caesar shift, gets its name from Julius Caesar, who occasionally
used this encoding method in his own private messages. As one of the most basic encryption
techniques, the Caesar cipher works by replacing each letter in the original plaintext message
with a different letter based off a fixed shift of the alphabet.

For example, let’s say we want to encode a secret message using a Caesar shift of 7 to the right.
First, we create our substitution table by printing the alphabet followed by the alphabet shifted 7
places to the right.

Original: ABCDEFGHIJKLMNOPQRSTUVWXYZ
Shifted: TUVWXYZABCDEFGHIJKLMNOPQRS
Next, we take each letter of our plaintext message and replace it with its corresponding letter in
the shifted alphabet.

Plaintext: THISISASECRETMESSAGEBURNAFTERREADING
Ciphertext: MABLBLTLXVKXMFXLLTZXUNKGTYMXKKXTWBGZ
To revert the encoded message back into its readable plaintext form, the recipient must re-create
the substitution table using the appropriate shift and then substitute each encoded character with
its original character, according to the shift.

One take on the Caesar cipher that has reached internet stardom is ROT13, which equates to a
rotation (or shift) of 13 places. Because the basic English alphabet is 26 characters long, ROT13
is its own inverse, allowing the same algorithm to both encode and decode messages.

Downloaded from www.notesmates.in Uploaded on: 3/2/2025, 3:44:39 pm

ANKUR CHOUDHARY - ankurchoudhary230663@acropolis.in


Vigenère Cipher

A Vigenère cipher uses a table consisting of different Caesar shifts in sequence and a key to
encode a message across several rows of the table. By using different Caesar shifts for different
characters in the message, the Vigenère cipher makes decoding the ciphertext using frequency
analysis much more difficult.

Downloaded from www.notesmates.in Uploaded on: 3/2/2025, 3:44:39 pm

ANKUR CHOUDHARY - ankurchoudhary230663@acropolis.in


For example, to encode a message, we must first choose a word or phrase to use as a key, and
then repeat it until it matches the length of the plaintext message. In this example, our key is
“FIREWALL”.

Plaintext: THISISASECRETMESSAGEBURNAFTERREADING
KEY: FIREWALLFIREWALLFIREWALLFIREWALLFIRE
To generate the encoded ciphertext, we match the plaintext character to a column and the
corresponding key letter to a row in the Vigenère table. For example, the first letter in our
plaintext is “T” and its corresponding key is “F”. Row “F”, column “T” would give us the
ciphertext character “Y”. This process is repeated sequentially for the entirety of the plaintext.

Plaintext: THISISASECRETMESSAGEBURNAFTERREADING
KEY: FIREWALLFIREWALLFIREWALLFIREWALLFIRE
Ciphertext: YPZWESLDJKIIPMPDXIXIXUCYFNKINRPLIQEK
To decode each character in the message, the recipient again selects the row indicated by the key
character, locates the ciphertext character within the row, and notes the column. For example, to
decode the last character in the message above, you would go to row “E” of the table and locate
character “K” which maps to column “G”, the plaintext character.

Playfair Cipher

The Playfair cipher is a diagraph substitution cipher. Instead of encoding a message by replacing
individual characters, it replaces them in pairs. To encode a message, the Playfair cipher uses a
keyword to generate a 5 by 5 encoding table and then follows 4 rules to encode diagrams (pairs
of characters) using the table.

To create a Playfair cipher table, you use a keyword to fill spaces in a 5 by 5 table top to bottom,
left to right. Any duplicate letters from the keyword are omitted when filling out the table.
Furthermore, the letters I and J are placed in the same space to shrink the 26-character alphabet
into a 25-character table. The remaining spaces in the table are filled with the rest of the letters of
the alphabet in order.

For example, let’s assume our keyword is “Picture Frame”. To create a Playfair cipher table, we
would begin by writing “Picture Frame” in a 5 by 5 table, omitting repeated characters. Note in
the example table below, the “R” and “E” from “Frame” are skipped because they were already
placed in the table. After writing out the keyword, the rest of the spaces in the table are filled out
with the remaining letters of the alphabet. In our example, “J” is skipped when filling in the rest
of the table because it shares a space with “I” from the keyword.

Downloaded from www.notesmates.in Uploaded on: 3/2/2025, 3:44:39 pm

ANKUR CHOUDHARY - ankurchoudhary230663@acropolis.in


After generating the table, we then prepare our plaintext message for encoding by splitting it into
diagrams (groups of 2 letters). For example, the secret message “Kill the spy” becomes “KI LL
TH ES PY”. Next, we encode the message by mapping the diagrams to the table and following 4
simple rules.

1. If both letters in the diagram are the same, add an X after the first letter to split
them into a new diagram and continue encoding the message.
2. If they appear in the same row of the table, shift the characters one position to the
right, wrapping around the table if needed.
3. If they appear in the same column, shift the characters down one position,
wrapping around the table if needed.
4. If they form the corners of a rectangle, replace them with the characters forming
the opposing corners of the rectangle, left to right.

These rules are much easier to understand with an example. To encode the message “KI LL TH
ES PY” using the table we created earlier, we begin by look at the first diagram, “KI”, and map it
to the table.

The letters “K” and “I” form opposing corners of a rectangle, which means rule 4 applies. We
replace “K” with the opposite corner in its same row, in this case “D”. “I” meanwhile is replaced
with “U”.

Downloaded from www.notesmates.in Uploaded on: 3/2/2025, 3:44:39 pm

ANKUR CHOUDHARY - ankurchoudhary230663@acropolis.in


The next diagram contains repeated letters, “LL”. We use rule 1 to split this diagram by adding
“X” to the first letter, giving us a new diagram to encode, “LX”.

The letters “L” and “X” also form the corners of a rectangle, which means we replace them with
the opposing corners to form the encoded diagram “OV.”

Because we split the previous diagram, our third diagram is now “LT.” “L” and “T” form
opposing corners of another rectangle, which means our encoded diagram is “QP.”

Continuing through the message, “HE” forms yet another rectangle in our table and gives us
“DA” for the encoded diagram. The next diagram “SP” forms a rectangle giving us “LU” as the
encoded diagram.

Finally, because our secret message only has one character left, “Y”, we add “X” to form the
diagram “YX”. The characters “Y” and “X” appear in the same row of our table which means
rule 2 applies.

Downloaded from www.notesmates.in Uploaded on: 3/2/2025, 3:44:39 pm

ANKUR CHOUDHARY - ankurchoudhary230663@acropolis.in


To form our final encoded diagram, we shift “Y” and “X” each one character to the right, giving
us “ZY”. Completed, our encoded message should look like this.

Plaintext: KILL THE SPY


Diagrams: KI LX LT HE SP YX
Ciphertext: DU OV QP DA LU ZY
To decrypt the message, the recipient would build out the same table using the given keyword
and then use the inverse of the last 3 rules (shift left instead of right, up instead of down, etc.) to
decode the ciphertext. They would then remove any “X”s that don’t make sense once all
diagrams are decoded.

Transposition Ciphers
Rail Fence Cipher

The rail fence cipher is a simple transposition cipher where plaintext characters are re-arranged
instead of replaced to encode a message. The rail fence cipher encodes a message by writing it
down and up diagonally over successive “rails”, or rows, in an imaginary fence. For example, the
secret message “THIS IS A SECRET MESSAGE” encoded over 4 rails would look like this.

T.....A.....T.....G.
.H...S.S...E.M...A.E
..I.I...E.R...E.S...
...S.....C.....S....
We then create the ciphertext by reading off characters left to right, top to bottom. For our
example message, the cipher text becomes:

TATGHSSEMAEIIERESSCS
Decoding a message only requires knowing the number of “rails” used to encode the message
and solving a simple math equation to determine the spacing between letters. To decode the
ciphertext, you first determine the size of the “cycle”, that is the number of characters in one full
movement down and up the “fence”. For a ciphertext created using 4 “rails”, the cycle is 6

Downloaded from www.notesmates.in Uploaded on: 3/2/2025, 3:44:39 pm

ANKUR CHOUDHARY - ankurchoudhary230663@acropolis.in


characters long. The size of the cycle for any other number of rails can be calculated using the
equations [Size] = ([rails] x 2) – 2.

After calculating the size of the cycle, divide the number of characters in the ciphertext by the
size of the cycle to find the number of cycles used to encode the message. Our ciphertext for
example is 20 characters long, which gives us 3 full cycles and a partial cycle of 2 characters
when divided by a cycle size of 6. Finally, we use this information to write the ciphertext back
out on the “fence” for decoding.

In our example, we calculated 3 full cycles and one partial cycle of 2 characters, which means
the top row of the fence should consist of the first 4 characters of our ciphertext (3 cycles + the
start of the partial cycle.)

T.....A.....T.....G.
The second row uses the next 7 characters of our ciphertext (2x the number of cycles + the
second extra character from the partial cycle.)\

T.....A.....T.....G.
.H...S.S...E.M...A.E
The third row uses the next 6 characters, that is 2x the number of cycles.

T.....A.....T.....G.
.H...S.S...E.M...A.E
. . I . I. . . . E R . . . E . S . . .
And the final row uses the last three characters, one for each full cycle.

T.....A.....T.....G.
.H...S.S...E.M...A.E
..I.I...E.R...E.S...
...S.....C.....S....
Finally you can read the decoded message by following the text pattern down and up the “fence”.

Route Cipher

The route cipher is another very simple transposition cipher. To use the route cipher, you write
out your plaintext message into a grid of arbitrary dimensions. For example, “THIS IS A
SECRET MESSAGE BURN AFTER READING” might be written out:

TIETSBARD
HSCMAUFRI
IAREGRTEN
SSESENEAG

Downloaded from www.notesmates.in Uploaded on: 3/2/2025, 3:44:39 pm

ANKUR CHOUDHARY - ankurchoudhary230663@acropolis.in


You then encode the message by following a specific pattern as the key. For example, the key
may be “spiral clockwise, starting in the bottom-right”, which would give us the ciphertext:

GAENESESSIHTIETSBARDINETRGERASCMAUFR
To decode the ciphertext, the recipient must know the pattern used and the size of the grid. They
would then simply follow the pattern in reverse to form a grid of the given size.

Book Cipher

The book cipher is an encryption method often used in popular culture. With a book cipher, both
the sender and recipient of a secret message must have the same copy of a book, usually down to
the same edition. The sender then encodes the secret message word-by-word by replacing the
plaintext word with coordinates mapping to the location of the same word within the chosen
book. For example, if the word “Kill” appeared in the book on page 39, paragraph 7, word 12,
the ciphertext coordinates would be {39:7:12}. To decode the word, the recipient would find the
word within their copy of the book in the notated position.

To solve the problem of encoding a message that includes words not contained in the book, the
sender could instead encode it character-by-character. The ciphertext coordinates could either
point to individual letters in the book or to words where the resulting plaintext character is the
first character of the word.

One-Time Pad

A one-time pad is an encryption technique that cannot be solved by brute-force (trying every
possible combination of key in hopes of outputting the original plaintext message). Encrypting a
message using a one-time pad requires a single-use pre-shared key of the same size or larger than
the plaintext message being encoded. Both the sender and the recipient of the message must
know the key but it must also be kept secret from everyone else.

So long as the same “pad” is never used twice, the ciphertext remains secure. Messages
encrypted using a one-time pad are resistant to cryptanalysis because it is possible to decode the
ciphertext into any plaintext message with the same number of characters as the original
plaintext message by using different keys. Specifically, there is no information in the ciphertext
that allows differentiating between multiple potential plaintext decodings of the same ciphertext.

Encoding a message with a one-time pad requires using modular addition, which is best
explained with an example. Let’s say we want to encode the plaintext message “KILL THE
SPY.” We must first select a one-time pad to use. Historically, one-time pads were generated as
a stack of pages. Both parties then agreed on which specific page to use in advanced. For this
example, we assume our agreed-upon one-time pad is:

HQWORJIHKSGSICOSFSSB
PCWCHGXYOUMWEOYYWUKY

Downloaded from www.notesmates.in Uploaded on: 3/2/2025, 3:44:39 pm

ANKUR CHOUDHARY - ankurchoudhary230663@acropolis.in


LKVZVHSMRJPLGHXULJBT
Next, each character in the plaintext message is paired up with a character from the pad, starting
with the first character. To make the modular addition calculation easier, we can convert each
character into its numeric value (e.g. “A” is 0, “B” is 1, etc.) Next we add the numeric values of
the corresponding message and key characters together, mod 26.

While modular addition sounds complicated, it is actually very simple. First, add the two
numbers together like normal. Then, if the resulting number is equal to or larger than 26 (our
mod value), subtract 26 from it. The resulting number is the numeric value of the ciphertext
character.

K I L L T H E S P Y message
10(K) 8(I) 11(L) 11(L) 19(T) 7(H) 4(E) 18(S) 15(P) 24(Y) message
+ 7(H) 16(Q) 22(W) 14(O) 17(R) 9(J) 8(I) 7(H) 10(K) 18(S) key
= 17 24 33 25 36 16 12 25 25 42 message + key
= 17(R) 24(Y) 7(H) 25(Z) 10(K) 16(Q) 12(M) 25(Z) 25(Z) 16(Q) (message + key) mod 26
R Y H Z K Q M Z Z Q ciphertext

In the above example, our plaintext message “KILL THE SPY” becomes “RYHZKQMZZQ”
using the one-time pad.

To decode the message, the same process is used, just in reverse. We subtract the key from the
ciphertext and if the result is negative we add 26.

R Y H Z K Q M Z Z Q ciphertext
17(R) 24(Y) 7(H) 25(Z) 10(K) 16(Q) 12(M) 25(Z) 25(Z) 16(Q) ciphertext
- 7(H) 16(Q) 22(W) 14(O) 17(R) 9(J) 8(I) 7(H) 10(K) 18(S) key
= 10 8 -15 11 -7 7 4 18 15 -2 ciphertext - key
= 10(K) 8(I) 11(L) 11(L) 19(T) 7(H) 4(E) 18(S) 15(P) 24(Y) ciphertext - key (mod 26)
K I L L T H E S P Y message

Computational Security

Conditionally or computationally secure cryptography uses a shared secret key of limited length
to provide security against an opponent with limited computational resources by making it
computationally infeasible extract the key or message.
Some ciphers are easy to crack and others are very difficult. In practice, perfect security is
impossible to achieve. Most ciphers used today rely on computational security. This means that
they rely on the fact that there is no computer system powerful enough to crack the cipher in a
reasonable amount of time.

Downloaded from www.notesmates.in Uploaded on: 3/2/2025, 3:44:39 pm

ANKUR CHOUDHARY - ankurchoudhary230663@acropolis.in


Can you decrypt this cipher text? The cipher used here is a mono-alphabetic substitution cipher
where each letter of the alphabet is replaced by another letter and the same substitution is used
each time.

GQH KZNRZNT-FZZ URDZ CNUGZ: Q GWQRB GWZ HMQR GWQRP GU


NZHZHKZN QT GWMG MRE NZMFFE XUCZNVIF GWQRP DMR KZ ITZJ VUN
PUUJ UN ZAQF. JERMHQGZ DMR KZ ITZJ GU KIQFJ GIRRZFT UN GU HMBZ
HQTTQFZT. ZRPQRZT DMR KZ XIG QR MHKIFMRDZT UN GMRBT. RIDFZMN
XUCZN DMR KZ ITZJ VUN KUHKT UN VUN ZFZDGNQDMF XUCZN.

Answer:

TIM BERNERS-LEE ONCE WROTE: I THINK THE MAIN THING TO REMEMBER


IS THAT ANY REALLY POWERFUL THING CAN BE USED FOR GOOD OR EVIL.
DYNAMITE CAN BE USED TO BUILD TUNNELS OR TO MAKE MISSILES.
ENGINES CAN BE PUT IN AMBULANCES OR TANKS. NUCLEAR POWER CAN BE
USED FOR BOMBS OR FOR ELECTRICAL POWER

Letter Frequency Analysis


Codebreakers use a variety of techniques to decrypt secret messages. One common technique is
to carry out a frequency analysis of the cipher text; this can reveal the "fingerprint" of the secret
message. Certain letters of the alphabet occur more frequently in the English language than other
letters. The most frequently occurring letter is E, followed by T, then A. Other languages will
generate different frequency distributions.
One Time Pad
A substitution cipher in which each character is encrypted using its own key is, in theory,
impossible to crack. This type of encryption scheme is known as a one-time pad. An example of
a cipher that uses a one-time pad is the Vernam cipher.

Even if the key comprises only letters, there are 26 options for each character of the plain text
message. This means that the message 'HELLO' would have 26, to the power 5
,265 (11,881,376) possible representations, including all possible five-letter words. Thus, even if
you used a computer to generate a list of all the possibilities, you could not determine the correct
plain text.

However, there are some rules that must be followed to achieve perfect security:

 The key must be the same length as (or longer than) the plain text
 The characters in the key must be truly random
 The key must be used once, and only once
 There must be only two copies of the key (held by the sender and recipient) and the key
must be secret to these parties
 The key must be destroyed after use

Downloaded from www.notesmates.in Uploaded on: 3/2/2025, 3:44:39 pm

ANKUR CHOUDHARY - ankurchoudhary230663@acropolis.in


Most codebreakers exploit human weakness or laziness to crack ciphers. Humans often take
shortcuts (this is how most ciphers are cracked). In addition:

True randomness (to generate keys) is very hard to achieve

Exchanging keys securely is extremely difficult

Most modern cryptography schemes rely not on perfect security, but on computational security.

A scheme can be said to be computationally secure if it cannot be cracked in 'reasonable time'.


This is a concept that relates to how long it will take a computer to carry out a task.

A reasonable time depends on the task in hand. If you intercepted the encrypted login details for
someone's bank account, spending a few days to decrypt it would probably be fine. However,
spending years to decrypt it is unlikley to be useful; after a few years the account may have been
closed or the password may have been changed. If cracking the cipher text takes hundreds or
thousands of years, the information will definitely not be useful.

Semantic Security
In cryptography, a semantically secure cryptosystem is one where only negligible information
about the plaintext can be feasibly extracted from the ciphertext.
Pseudo Random Number Generator
Pseudo Random Number Generator(PRNG) refers to an algorithm that uses mathematical
formulas to produce sequences of random numbers. PRNGs generate a sequence of numbers
approximating the properties of random numbers. A PRNG starts from an arbitrary starting
state using a seed state. Many numbers are generated in a short time and can also be
reproduced later, if the starting point in the sequence is known. Hence, the numbers
are deterministic and efficient.

Why do we need PRNG?


With the advent of computers, programmers recognized the need for a means of introducing
randomness into a computer program. However, surprising as it may seem, it is difficult to get
a computer to do something by chance as computer follows the given instructions blindly and
is therefore completely predictable. It is not possible to generate truly random numbers from
deterministic thing like computers so PRNG is a technique developed to generate random
numbers using a computer.

How PRNG works?


Linear Congruential Generator is most common and oldest algorithm for generating pseudo-
randomized numbers. The generator is defined by the recurrence relation:
Xn+1 = (aXn + c) mod m
where X is the sequence of pseudo-random values
m, 0 < m - modulus
a, 0 < a < m - multiplier

Downloaded from www.notesmates.in Uploaded on: 3/2/2025, 3:44:39 pm

ANKUR CHOUDHARY - ankurchoudhary230663@acropolis.in


c, 0 ≤ c < m - increment
x0, 0 ≤ x0 < m - the seed or start value
We generate the next random integer using the previous random integer, the integer constants,
and the integer modulus. To get started, the algorithm requires an initial Seed, which must be
provided by some means. The appearance of randomness is provided by performing modulo
arithmetic.

Characteristics of PRNG
 Efficient: PRNG can produce many numbers in a short time and is advantageous
for applications that need many numbers
 Deterministic: A given sequence of numbers can be reproduced at a later date if the
starting point in the sequence is known. Determinism is handy if you need to replay
the same sequence of numbers again at a later stage.
 Periodic: PRNGs are periodic, which means that the sequence will eventually
repeat itself. While periodicity is hardly ever a desirable characteristic, modern
PRNGs have a period that is so long that it can be ignored for most practical
purposes.

Applications of PRNG
PRNGs are suitable for applications where many random numbers are required and where it is
useful that the same sequence can be replayed easily. Popular examples of such applications
are simulation and modeling applications. PRNGs are not suitable for applications where it
is important that the numbers are really unpredictable, such as data encryption and gambling.

Pseudo Random Number Generator using srand()


#include<stdio.h>
#include<stdlib.h>
#include<time.h>
int main()
{
srand(time(NULL));
int i;
for(i = 0; i<5; i++)
printf("%d\t", rand()%10);
}
Output 1:
3 7 0 9 8
Output 2:
7 6 8 1 4

#include<bits/stdc++.h>
using namespace std;
int main()
{

Downloaded from www.notesmates.in Uploaded on: 3/2/2025, 3:44:39 pm

ANKUR CHOUDHARY - ankurchoudhary230663@acropolis.in


srand(time(NULL));
int i;
for(i = 0; i < 5; i++)
std::cout << (rand()%10) << "\t";
return 0;
}
// This code is contributed by Srj_27

Output 1:
3 7 0 9 8
Output 2:
7 6 8 1 4

perfect secrecy
The definition of perfect secrecy is based on statistics and probabilities. A ciphertext maintains
perfect secrecy if the attacker's knowledge of the contents of the message is the same both before
and after the adversary inspects the ciphertext, attacking it with unlimited resources.
Perfect Secrecy (or information-theoretic secure) means that the ciphertext conveys no
information about the content of the plaintext. In effect this means that, no matter how much
ciphertext you have, it does not convey anything about what the plaintext and key were. It can be
proved that any such scheme must use at least as much key material as there is plaintext to
encrypt. In terms of probabilities, it means that the probability distribution of the possible
plaintexts is independent of the ciphertext.

One-time- pad encryption


In cryptography, the one-time pad (OTP) is an encryption technique that cannot be cracked, but
requires the use of a single-use pre-shared key that is larger than or equal to the size of the
message being sent. In this technique, a plaintext is paired with a random secret key (also
referred to as a one-time pad). Then, each bit or character of the plaintext is encrypted by
combining it with the corresponding bit or character from the pad using modular addition.
The resulting ciphertext will be impossible to decrypt or break if the following four conditions
are met:

1. The key must be at least as long as the plaintext.


2. The key must be random (uniformly distributed in the set of all possible keys
and independent of the plaintext), entirely sampled from a non-algorithmic, chaotic source
such as a hardware random number generator; patternless, according to Gregory
Chaitin definition.[3] It is not sufficient for OTP keys to pass statistical randomness tests as
such tests cannot measure entropy, and the number of bits of entropy must be at least equal to
the number of bits in the plaintext. For example, using cryptographic hashes or mathematical

Downloaded from www.notesmates.in Uploaded on: 3/2/2025, 3:44:39 pm

ANKUR CHOUDHARY - ankurchoudhary230663@acropolis.in


functions (such as logarithm or square root) to generate keys from fewer bits of entropy would
break the uniform distribution requirement, and therefore would not provide perfect secrecy.
3. The key must never be reused in whole or in part.
4. The key must be kept completely secret by the communicating parties

Limitations
1) The key must be as long as the message.
2) The key can be used only once to encrypt a single message securely and hence its name
(OTP). Things start getting really messy when one reuses a one-time pad. As a matter of fact, US
and UK exploited this drawback to decrypt Russian plaintext in the Venona Project.
We show that one of the aforementioned limitations of the one-time pad encryption scheme is
inherent. We prove that any prefectly-secret encryption scheme must have a key space that is at
least as large as the message space.
What is the characterization of perfect secrecy?
Perfect secrecy of the cipher

The Vernam cipher has the perfect secret property if: (i) the key exchanged is as long as the
message, (ii) each key is used only once and is uncorrelated to the new one, and (iii) the key is
known only by the users.

Downloaded from www.notesmates.in Uploaded on: 3/2/2025, 3:44:39 pm

ANKUR CHOUDHARY - ankurchoudhary230663@acropolis.in

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy