Gematmw Reviewer
Gematmw Reviewer
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.
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
● 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
ENCRYPTION DECRYPTION
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
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.
ed ≡ 1 mod (p-1)(q-1)
2. Group integers together to form a large integers, each representing a block of letters.
Decryption Process
● To retrieve the original message M, decrypt the message C using
Example
Goal: Send the message “STOP.” (ENCRYPTION)
Therefore, the message STOP is equivalent to the cipher text 2081 2182.
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
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.
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:
GO —--> 101
● Decode
○ “received word” is reverted back to a “message”
101 —--> GO
● Code vs codewords
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: