0% found this document useful (0 votes)
68 views14 pages

Gematmw Reviewer

The document discusses cryptography and encryption techniques. It defines cryptography as encrypting information to transmit it privately between parties. The main encryption methods covered are symmetric encryption using a shared key, and asymmetric encryption using public/private key pairs like in RSA encryption. It also explains classic encryption ciphers like the Caesar cipher and Vigenere cipher, and modern techniques like using modular arithmetic in RSA encryption.

Uploaded by

marcody
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)
68 views14 pages

Gematmw Reviewer

The document discusses cryptography and encryption techniques. It defines cryptography as encrypting information to transmit it privately between parties. The main encryption methods covered are symmetric encryption using a shared key, and asymmetric encryption using public/private key pairs like in RSA encryption. It also explains classic encryption ciphers like the Caesar cipher and Vigenere cipher, and modern techniques like using modular arithmetic in RSA encryption.

Uploaded by

marcody
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/ 14

CRYPTOGRAPHY

https://dlsu.instructure.com/courses/119309/files/12791149?module_item_id=3086693

Goals of Cryptography
● Relay information from one place to another without anyone else being able to know it.

Encryption and Decryption


● Encryption
○ The process of using an algorithm to transform information into a format that can
be read.
● Decryption
○ The process of using another algorithm to transform encrypted information back
into a readable format.

Plain text and Cipher Text


● The original information is referred to as the plain text while the encrypted version is the
cipher text
Objectives of Encryption
● Confidentiality
○ The sender (let us call her Alice) and receiver (let us call him Bob) can be assured
that no third party can read the message.
● Integrity
○ Alice and Bob can make sure that no third party can make changes in the
message.
● Authenticity
○ Bob can be sure that it was Alice who sent the message.
● Non-repudiation
○ Bob can prove to any third party that Alice sent the message.

Simple Ciphers
● Dancing Man Cipher System
○ A cypher created by Arthur Conan Doyle in 1903, and used in his Sherlock
Holmes short story The Adventure of the Dancing Men, published in Collier's and
The Strand Magazine in december 1903. The alphabet is a simple character
substitution. Each letter corresponds to a different humanoid symbol that is
dancing.
● Pigpen Cypher
○ The pigpen cipher, which dates back to the 18th century, is also known as the
Masonic cipher or Freemason (invented by Freemasons) cipher because of its use
by secretive groups that purportedly shield their practices from public
scrutiny.Each letter of the alphabet is substituted with a simple geometric picture
symbol. Symbols are created using grids and crosses so that each letter is
represented by fragments of a grid or cross with or without a dot. The name
"pigpen" refers to this grid pattern.
○ If there is a dot it refers to the second letter
○ https://www.youtube.com/watch?v=jTMTBCP2P7A

● Caesar’s Cipher
○ If Julius Caesar had anything confidential to say he wrote it in cipher, by changing
the order of the letters of the alphabet so that not a word could be made out. If
anyone wishes to decipher these, they must substitute the current letter with the
fourth letter of the alphabet, namely D, for A, and so with the others.
● Vigenere Cipher
○ The Vigenere encryption was the creation of the French diplomat, Blaise de
Vigenere, 1523-1596. He viewed the cipher as a substitution cipher where a
different alphabet was used for the next letter of the message, with the alphabets
repeating periodically — according to some key.
○ https://www.youtube.com/watch?v=QgHnr8-h0xI

Mono-Aplphabetic vs Poly-Alphabetic Cryptosystems


● A mono-alphabetic substitution cipher is a type of substitution cipher in which the
equivalent letters of the plaintext are restored by the same letters of the
ciphertext. Mono, which defines one, signifies that each letter of the plaintext has
a single substitute of the ciphertext. Dancing Man, Pigpen and Caesar Ciphers
are examples of mono-alphabetic cryptosystems.
● A poly-alphabetic cipher is any cipher based on substitution, using several
substitution alphabets. In polyalphabetic substitution ciphers, the plaintext letters
are enciphered differently based upon their installation in the text. Vigenere
Cipher is an example of a poly-alphabetic cryptosystem.
● Mono alphabetic ciphers can be decoded by using the method frequency analysis. But in
poly alphabetic cipher each symbol of plain text is replaced by a different cipher text
regardless of its occurrence. This makes it very difficult to be decoded by using
frequency analysis.
https://dlsu.instructure.com/courses/119309/files/12791150?module_item_id=3086694

Two Basic Techniques of encryption


● Symmetric encryption
○ (also called secret key encryption)

● Asymmetric encryption
○ (also called public key encryption)
Public Key Cryptosystem
● In 1976, W. Diffie and M. Hellman introduced a new method of encryption and key
management now referred to as public key cryptography.
● Public key cryptography is a system that uses a pair of keys (a PUBLIC KEY and a
PRIVATE KEY). This method is also referred to as asymmetric cryptography.
● How they work
○ Each individual is assigned these keys to encrypt and decrypt information.
○ A message encrypted by one of these two keys (the public key) can only be
decrypted by the other key in the pair (the private key).
○ The public key is available for others to use when encrypting information that will
be sent to an individual.
○ People can use that individual’s public key to decrypt information sent by him.
○ The private key, on the other hand, is accessible only to the individual.
○ The individual can use his private key to decrypt any message encrypted with his
public key.
● Math Explanation
○ Say I want to encrypt the message “7.”

Key: 328

7 x 328 = 2296

Plain Text: 7 Plain Text: ?


Key: 328 Key: 328
Cipher Text: ? Cipher Text: 2296

7 x 328 = 2296 2296 x 1/328 = 7

ENCRYPTION DECRYPTION

Cipher Text: 2296


Encryption Key: 328
Decryption Key:1/328
2296 x 1/328 = 7

https://www.youtube.com/watch?v=E5FEqGYLL0o
Modular Arithmetic
● The mathematical statement
○ a≡b (mod n)
(read as “a is congruent to b modulo n)
means that the difference a - b is divisible by the integer n.
● Examples:
○ 8≡2 (mod 3) =
since the number 8 - 2 = 6 is divisible by 3.
the answer is 2
○ 0≡24 (mod 6) =
since 0 - 24 = 24 divisible by 6.
○ 14≠2 (mod 5) =
since 14 - 2 = 12 is NOT divisible by 5.
● What is x when
○ x ≡ 5 (mod 4)?
x-5 should be divisible by 4
x=9, -1 and may have other values

RSA Cryptosystem
● RSA is based on the assumption that factoring large integers is computationally hard.
● Ron Rivest, Adi Shamir and Leonard Adleman

Trap door Function


● A trap door function is a function that is easy to compute “forwards” but difficult to
compete “backwards”.
● It is fairly cheap to compute the output from the input but computationally infeasible to
find the input from the output.
● It is sometimes called a one-way function
● RSA implemented two important ideas:
public key encryption and digital signatures.
● This is used for electronic mail and for other electronic transactions and transmissions,
such as fund transfers.

RSA Key Generation

1. Take two large primes p and q and compute


n = pq

2. Choose a number e less than n and relatively prime to

3. Find another number d such that ed - 1 is divisible by

i.e.
ed ≡ 1 mod (p - 1) (q - 1)

4. The public key is (n, e) and the private key is (n, d).

Trap door
● That part of the public key n is easy to generate (multiplication of two very large prime
numbers yields it).
● But to know the private key d requires your knowledge of the two prime numbers.
● What are the factors of n?
ed≡1 mod(p-1)(q-1)

A formula for d is

1+𝑘(𝑝−1)(𝑞−1)
d= 𝑒
,k integer

● Example:
Let p = 43 and q = 59. Then n = pq = 2537. Choose e = 13.

This number is both less than 2537 and relatively prime to (p - 1)(q - 1) = 42(58) = 2436.

We search for the number d so that

ed ≡ 1 mod (p-1)(q-1)

13d ≡ 1 mod 2436


Encryption Process
1. Translate the message into a sequence of integers.

2. Group integers together to form a large integers, each representing a block of letters.

3. Transform the message M to the encrypted version C using

Decryption Process
● To retrieve the original message M, decrypt the message C using

Example
Goal: Send the message “STOP.” (ENCRYPTION)

Step 1: Translate this message into a sequence of integers


ABCDEFGHIJKLMNOPQRSTUVWXYZ —-> 00 01 02 . . . 25.
STOP → 18 19 14 15

Step 2: Encrypt 1819 and 1415 as follows:


p = 43 and q = 59. Then n = pq = 2537. e = 13

Therefore, the message STOP is equivalent to the cipher text 2081 2182.

DECRYPTION

Goal: Decrypt “2081 2182” will perform the following decryption:

The receiver will conclude that 2081 2182 is 1819 1415 or ST OP or STOP.
More about Cryptography:
● Cipher Machine, the German Enigma
● The Imitation Game
○ A movie based on the life of Alan Turing, the father of computer science.
○ In WWII, Alan joined the Government Codes and Cypher School at Bletchley
Park. He developed a machine (The Bombe) which helped break the code for the
German Enigma machine (a device for sending coded messages to units of the
German forces).
● Steganography
○ Steganography is a means of concealing secret information within (or even on top
of) an otherwise mundane, non-secret document or other media to avoid
detection. It comes from the Greek words steganos, which means “covered” or
“hidden,” and graph, which means “to write.” Hence, “hidden writing.”
○ https://www.youtube.com/watch?v=TWEXCYQKyDc
● Digital Signatures
○ electronic fingerprinting
https://dlsu.instructure.com/courses/119309/files/12791151?module_item_id=3086695

Coding Theory

Your brain is a code-cracking machine…

Problems in Coding Theory


● Each time an intended message is sent through a channel, the message received may
contain errors.
○ How do we detect errors, if any?
○ How do we correct these errors?
● The Basic Problem of Coding Theory

But received messages coming from noisy channels may contain errors
● Goals of Coding Theory
○ Error Detection
○ Error Correction
Imperfect Transmission of Data
● Messages are usually transmitted in the form of binary strings (0s and 1s).
● However transmission isn’t perfect
● Causes of Imperfect Transmission
○ An electric surge, cross-contamination from another data stream, or human error
can easily change some of the 0s to 1s and vice versa.

Applications of Coding Theory


● Transmission of pictures from outer space
○ How are pictures taken from outer space
■ The picture is divided into many pixels (say 800 x 800) and each pixel has
a varying degree of brightness.
■ Each degree of brightness is represented by a string of 0s and 1s.
● Quality of sound in compact discs
● Communication through telephone lines
● Messaging through wireless communication

Terms to Understand
● Source Coding
○ Source coding is changing the message source, such as a data terminal or the
human voice, to a suitable code for transmission through the channel.
○ An example of source coding is the ASCII code.

○ The source encoder transforms the source output into a sequence of symbols
which we call a “message”
○ A codeword is a string of 0’s and 1’s representing an actual message. Its length is
determined by the number of digits
● Code
○ The collection or set of all codewords.
○ Example:

Stop —-> 000


Go —---> 101
Wait —-> 110

The code is C = {000, 101, 110}.


● Encode
○ “message” becomes a “codeword”

GO —--> 101

● Decode
○ “received word” is reverted back to a “message”

101 —--> GO
● Code vs codewords

Parity Check Codes


● A bit string is said to have odd parity or even parity depending on the number of 1s in the
string
● Example:

0010110 has odd parity


0101110 has even parity
● The simplest form of error detection is parity, where a single bit is appended to a bit
string. The idea is to have a code with only one parity (usually even).

Repetition Codes
● The simplest possible error-correcting code is the repetition code.
● If 1010 is the intended message. We repeat each bit a certain times, say three times, and
we obtain 111000111000
● Example:
1. Encode the bit string 011001 by repeating each bit thrice.
Solution:
000 111 111 000 000 111
2. Encode the bit string 011 by repeating each bit four times

Solution:

0000 1111 1111

How to detect and correct errors using repetition codes

You might also like