# Cryptography and Mathematics

AI and Robotics

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

124 views

Cryptography and
Mathematics

Sarah Brown

March 2, 2005

Cryptography:

The enciphering and deciphering of messages in
secret code or cipher.

We will focus on how data is securely transmitted
over the internet.

Source: Merriam
-
Webster Online Dictionary m
-
w.com

Alice and Bob:

Two parties communicating over the internet.

Security Requirements

Authentication

Privacy/confidentiality

Integrity

Non
-
repudiation

Source:
http://www.garykessler.net/library/crypto.html

Authentication

Proving one's identity.

Alice must know that Mallory, a malicious
person, cannot pretend to be Bob.

Privacy/confidentiality

Ensuring Eve, an eavesdropper, cannot

Integrity

Bob needs assurance that the message
has not been altered by malicious Mallory.

Non
-
repudiation

Bob must prove that Alice really sent the
message.

?

Definitions

key:
the set of instructions governing the
encipherment and decipherment of
messages

plaintext:

the initial unencrypted data

ciphertext:

the encrypted plaintext

Source: Merriam
-
Webster Online Dictionary m
-
w.com

Source:
http://www.garykessler.net/library/crypto.html

Three Encryption Techniques

Secret Key Cryptography

Public Key Cryptography

Hash Functions

Source:
http://www.garykessler.net/library/crypto.html

Secret Key Cryptography

Alice and Bob have same key

Both can encrypt and decrypt

Most common scheme: Data Encryption
Standard (DES)

Problem: How does Alice get the key to
Bob without anyone intercepting it?

Source:
http://www.garykessler.net/library/crypto.html

Public Key Cryptography

Public key

how to encrypt

Secret key

how to decrypt

Alice wants to send confidential message
to Bob. Bob’s public key tells her how to
scramble the message. Bob uses his
secret key to unscramble it.

Source:
http://www.garykessler.net/library/crypto.html

Inverse Functions!

Easy to scramble message, hard to
unscramble

It’s easy to find f(x) but very hard to find f
-
1
(x)

Examples

Multiplication vs. factorization:

45462979 is the product of two prime
numbers. Factor it.

Multiply 5741 and 7919.

Exponentiation vs. logarithms:

Find x and y satisfying

log
x

59049 = y.

Evaluate 3
10
.

Nonrepudiation

Alice uses her secret key to scramble a
message. Bob uses Alice’s public key to
unscramble it.

Why? Bob knows Alice must have sent it.

Source:
http://www.garykessler.net/library/crypto.html

RSA

Most common public key algorithm

Developed by Ronald Rivest, Adi Shamir,

Easy to multiply two prime numbers.

Given the product of two huge prime
numbers, it is difficult to factor.

Source:
http://www.garykessler.net/library/crypto.html

Basic Steps

Let p and q be prime. Calculate n = pq.

Choose a number e that is relatively prime to
(p
-
1)(q
-
1).

Choose d so that (ed
-
1)/[(p
-
1)(q
-
1)] is an
integer.

n,e are public information

d is private

Source:
http://www.garykessler.net/library/crypto.html

Encrypting/Decrypting the Message

To encrypt a message M, create the
ciphertext

C = Me mod n

The receiver decrypts the ciphertext using

M = Cd mod n

Source:
http://www.garykessler.net/library/crypto.html

Simplified Example

Let p=3 and q=5. Then n = pq = 15.

Choose e to be relatively prime to (p
-
1)(q
-
1) = (2)(4) = 8. Select
e=11

The value (11d
-
1)/[(2)(4)] = (11d
-
1)/8 must be an integer.
Calculate one possible value, d=3.

Let's say we wish to send the string
SECRET,
which has the
decimal representation of the ASCII values of the characters
83
69 67 82 69 84
.

The sender encrypts each digit one at a time using the public key
value (e,n)=(11,15). Thus, each ciphertext character
C
i

=

M
i
11

mod

15. The input digit string
0x836967826984

will be
transmitted as
0x2c696d286924
.

The receiver decrypts each digit using the private key value
(d,n)=(3,15). Thus, each plaintext character M
i

=

C
i
3

mod

15. The
input digit string
0x2c696d286924

will be converted to
0x836967826984

and, presumably, reassembled as the plaintext
string
SECRET
.

Source:
http://www.garykessler.net/library/crypto.html

Money for Factoring

RSA
-
640

Prize: \$20,000

Status: Not Factored

Decimal Digits: 193

31074182404900437213507500358885679300
37346022842727545720161948823206440518
08150455634682967172328678243791627283
80334154710731085019195485290073377248
22783525742386454014691736602477652346
609

Source: RSA Laboratories http://www.rsasecurity.com/rsalabs/

RSA
-
2048

Prize: \$200,000

Status: Not Factored

Decimal Digits: 617

251959084756578934940271832400483985714292821
262040320277771378360436620207075955562640185
258807844069182906412495150821892985591491761
845028084891200728449926873928072877767359714
183472702618963750149718246911650776133798590
957000973304597488084284017974291006424586918
171951187461215151726546322822168699875491824
224336372590851418654620435767984233871847744
479207399342365848238242811981638150106748104
516603773060562016196762561338441436038339044
149526344321901146575444541784240209246165157
233507787077498171257724679629263863563732899
121548314381678998850404453640235273819513786
36564391212010397122822120720357

Source: RSA Laboratories http://www.rsasecurity.com/rsalabs/

Hash Functions

Guarantee data integrity.

Cannot decrypt the message!

Source:
http://www.garykessler.net/library/crypto.html

http://www.teachersandfamilies.com/nursery/humpty.html

Humpty Dumpty

Humpty Dumpty sat on a wall.

Humpty Dumpty had a great fall.

All the king's horses and all the
king's men.

Couldn't put Humpty together
again.

Source:
http://www.garykessler.net/library/crypto.html

Pros and Cons

Secret key:

-
getting the key to Bob without someone intercepting it

+1000 times faster than public key

Public key:

-
slow

+don’t worry about someone finding the key

Hash function

-
+can’t get the message back

Source:
http://www.garykessler.net/library/crypto.html

Hybrid

Source:
http://www.garykessler.net/library/crypto.html

Career Information

Potential employers: NSA (National
Security Agency), IBM, RSA Security,
national labs such as Sandia, NRL (Naval
Research Lab), MIT’s Lincoln Labs.

Math classes to take: linear algebra,
number theory, combinatorics

Computer classes: general programming,
algorithms

Thanks to Jason Holt of BYU for most of this info.

Last Word

It’s easier to hack than decrypt.

Main Source

http://www.garykessler.net/library/crypto.html