# Information Science Comap Chapter 17 Sections 17.3 and 17.4

AI and Robotics

Nov 21, 2013 (4 years and 7 months ago)

89 views

Information Science

Comap

Chapter 17

Sections 17.3 and 17.4

Micheal Kim

Objectives

Understand what cryptology is

Understand the basic logic behind cryptosystems

Learn what Boolean logic is and how it can be used in
web searches

Cryptography

What is Cryptography?

Encryption
: the process of disguising data

Cryptology
: the study of methods to make and break
codes

Cryptography

Some examples:

Military and diplomatic transmissions

Internet credit
-
card transactions

A quick history lesson: September 1998

President Bill Clinton and Ireland’s Prime Minister Bertie
Ahern used digital signatures to sign an intergovernmental
document

Cryptography: The
Caesar Cipher

The earliest known cryptosystem

Used by Julius
Caeser

to send messages to his troops

How it works :

There is a message and a shift value of three

Translate the letters into numbers, according to A = 0
… Z = 25

Add the shift value to the letter and then rewrite the
corresponding letter of the new number

Cryptography: The
Caesar Cipher

Example:

ATTACK AT DAWN

Example 2:

ZLOOLDP & PDUB

Cryptography: Modular
Arithmetic

For more sophisticated cryptosystems it is
convenient to use a special kind of arithmetic known
as modular arithmetic.

For any positive integers
a
and
n
, we define
a

mod

n
to
be the remainder when
a
is divided by

n
.

Ex:

3 mod 2 =

37 mod 10 =

342 mod 85 =

Cryptography: Modular
Arithmetic

For more sophisticated cryptosystems it is
convenient to use a special kind of arithmetic known
as modular arithmetic.

For any positive integers
a
and
n
, we define
a

mod

n
to
be the remainder when
a
is divided by

n
.

Ex:

3 mod 2 = 1

37 mod 10 = 7

342 mod 85 = 2

Cryptography: Modular
Arithmetic

We often unconsciously use this concept.

Example: If I say it is September what month will it
be 25 months from now

Obviously October

How did you get to this?

25 = 2 * 12 + 1

Cryptography: Modular
Arithmetic

So back to the Caesar cipher, how does modular
arithmetic apply?

A = 0, B = 1, C = 2, … Z = 25

The cipher then replaces the letter in position
i

with
the letter in position (
i

+ 3)
mod

26

Cryptography: The
Vigenere

Cipher

Using modular arithmetic as a base we can use this
more sophisticated cryptosystem.

How it works:

Select a key word

The letters of the key word are then used to determine
the amount of shifting for each letter of the message

Cryptography: The
Vigenere

Cipher

Example:

We will use the same message, ATTACK AT DAWN

Let the key word be MATH

The formula here is (
i

+ j
)
mod
26

Explanation: shift the first letter of the message by 12
because M = 12, the
seccond

is shifted by 0 because A = 0,
so on and so on. When you use all of the letters in the key
repeat

Web Searches and
Mathematical Logic

To understand any of this we must first understand
Boolean logic

What is it?

Web Searches and Mathematical
Logic: Boolean Logic

Boolean logic was created by George Boole.

It consists of expressions which are simply
statements that are either true or false

Web Searches and Mathematical
Logic: Boolean Logic

We can combine individual expressions into complex
expressions with things known as connectives

The three basic ones are AND, OR, NOT

So when we put this into the idea of a search engine:

Ex. Search for “Florida election”, this is interpreted as
an expression and when a web page contains the
phrase “Florida election” the result is true and is put in
the list of web pages.

Web Searches and Mathematical
Logic: Boolean Logic

Boolean logic can be quickly shown with truth tables.

Lets look at a basic truth table expressing p and q

P Q | P

Q

T T | T

T F | F

F T | F

F
F |
F

HW 1

Using the Caesar’s Cipher, decode

KRPHZRUN

HW 2

Show the truth table for p and not q and not r