affine cipher

© All Rights Reserved

85 views

affine cipher

© All Rights Reserved

- Network Security & Cryptography MCQ'S
- Lainzine Vol. 1 - Lainchan.org
- Alberti Cypher
- A Recent Study of Various Encryption and Decryption Techniques
- DPG Issue Brief Cyber Security
- Contemporary NATO Doctrines
- Cryptography -- ps.ppt
- Conformance
- PSAA 608-600_Spring 2016_Davis.pdf
- McAfee License Review and Certification Form India
- 22
- 14012013145347-quantum-cryptography (1)
- Russia's Growing Reliance on Cyber Warfare Setting Dangerous Precedent for Future Foreign Policy
- Enhancing Data Security in WSN using Symmetric Key Algorithm
- UAS Bahasa Inggris FILKOM
- Finland s Cyber Security Strategy - Background Dossier
- 2011 11 16 Larry Clinton SC Magazine Keynote Presentation About APT Economic Misalignment and Regulation
- India Security Senario
- Key Manager Server
- Transpositiontec.ppt

You are on page 1of 16

Chris Christensen

Class notes

Affine Ciphers

Cryptography

Combining the two processes of the Caesar cipher and the multiplicative

cipher results in a transformation of the form C mP b . This is called an

affine cipher.

affine (adjective): via French, from Latin ad "to, at," and finis

"boundary, border," of unknown prior origin. Although the original

meaning of the Latin adjective affinis was "neighboring, adjacent," the

most common meaning eventually became "related by marriage." The

notion of kinship or affinity was carried into French, and from there to

English. In mathematics, the affine transformations include

translation [and] stretching [multiplication] .

Affine transformations maintain a "kinship" between the original

object and the transformed object. For example, in the plane, a pair of

parallel lines is transformed into a pair of parallel lines.

The Number of Possible Keys

Now we have two parts to the key an additive part b (the shift) and a

multiplicative part m (the decimation interval). As there are for Caesar

ciphers, there are 26 choices for b. For each of those choices, there are (as

there are for multiplicative ciphers) 12 possible choices for m. Therefore,

there are 26 12 312 possible affine ciphers. Of course, one of these does

nothing the cipher with b = 0 and m = 1 yields C = P, the plaintext

alphabet. This would obviously not be a good choice for encryption.

The 312 affine ciphers include the 26 Caesar ciphers (the affine ciphers with

m = 1; C = P + b) and the multiplicative ciphers (the affine ciphers with b =

0, C = mP).

key 7.

Affine cipher

Multiplicative key = 7 and additive key = 5

a

b

c

d

e

f

g

h

i

j

k

l

m

n

o

p

q

r

s

t

u

v

w

x

y

z

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

12

19

26

7

14

21

2

9

16

23

4

11

18

25

6

13

20

1

8

15

22

3

10

17

24

5

L

S

Z

G

N

U

B

I

P

W

D

K

R

Y

F

M

T

A

H

O

V

C

J

Q

X

E

Cryptanalysis

Recognition and Cryptanalysis

Just like the multiplicative cipher, an affine cipher with m 1 decimates the

alphabet but if b 0 there is also a shift. We can recognize an affine cipher

from its frequency chart if we can spot a decimation and a shift.

Here is a frequency chart transformed by the affine cipher with additive key

5 and multiplicative key 7.

Frequencies

Additive key = 5 and Multiplicative key = 7

A

B

C

D

E

F

G

H

I

J

K

L

M

N

O

P

Q

R

S

T

U

V

W

X

Y

Z

11111111

11

1

1111111

1111

111111

1111

11

1111

1111111

111

1111111111111

111111111

1111111

111

1

111

111

11

11111111

111

plaintext z. It is much more difficult to determine the decimation interval.

Notice that in this case cipher E corresponds to plaintext z. Counting

backwards from E in intervals of 7 we find

E

X

Q

J

C

V

(low)

(low)

(low)

(low)

(low)

(not high)

Another Cryptanalysis by Frequency Analysis

If we knew or had reason to suspect that we were dealing with an affine

cipher, we might use the following method of cryptanalysis.

Recall that for a Caesar cipher C = P + b we need only one plaintextciphertext letter correspondence to determine the shift b and for a

multiplicative cipher C = mP we need only one plaintext-ciphertext letter

correspondence to determine the multiplier m. On way of cryptanalyzing

those ciphers is to assume that the most common ciphertext letter

corresponded to the plaintext e. (If that turned out to be an incorrect choice,

we assumed that another high frequency plaintext letter corresponded to e,

and we continued this process until the correct key was determined.)

For an affine cipher, we need to determine two keys b and m. We need two

ciphertext-plaintext correspondences to do that.

Example 7.1

Here is a ciphertext

OINRFHORXHONAPFVHLHMNZOFUOINANGRLZI

PYNJLHOINMKVBLYGMKVBSFLAGLAALYBNRNY

OVHNGSXPO

4

A

B

C

D

E

F

G

H

I

J

K

L

M

N

O

P

Q

R

S

T

U

V

W

X

Y

Z

11111

111

1111

1111

111111

1111

1

11

1111111

111

1111111111

11111111

111

1111

11

1

1111

11

1111

11

Let us assume that an affine cipher was used. We need two plaintextciphertext correspondences. We might begin by assuming the most frequent

ciphertext letter N corresponds to plaintext e and the second most frequent

ciphertext letter O corresponds to plaintext t.

This would give us two equations to solve modulo 26.

C mP b mod 26

If ciphertext N(C = 14) corresponds to plaintext e (P = 5),

14 m5 b mod 26 .

15 m20 b mod 26 .

14 5m b mod 26

15 20m b mod 26

Here is a solution. We begin by subtracting the first congruence from the

second.

1 15m mod 26

m 151 mod 26

m 7 mod 26

m = 7. Now substitute this into one of the congruences, say the first.

14 5 7 b mod 26

14 35 b mod 26

b 21mod 26

b 5mod 26

b = 5.

If we were correct in our assumptions that ciphertext letter N corresponds to

plaintext letter e and ciphertext letter O corresponds to plaintext letter t, then

the affine cipher has additive key 5 and multiplicative key 7.

Use the key given above to decipher the ciphertext.

Brute Force

Although it would not be pleasant to do by hand (however, you might be

willing to do that if the security of the free world depended upon it), it would

not be hard for a computer to print out the 312 plaintext messages which

result in this ciphertext. Then, we just need to find the one that makes sense.

Another Approach

We could search through the ciphertext for an enciphered version of the.

Here are the 312 affine ciphers of the.

Enciphered the

Multiplicative key

ACJ

ACR

ADJ

AEF

AGB

AOL

AQH

ASD

AUZ

AWV

AXP

AYR

BDK

BDS

BEK

BFG

BHC

BPM

BRI

BTE

BVA

BXW

BYQ

BZS

CAT

CEL

15

23

21

17

19

1

3

5

7

9

25

11

15

23

21

17

19

1

3

5

7

9

25

11

11

15

Additive key

13

15

25

25

11

7

19

5

17

3

22

15

14

16

0

0

12

8

20

6

18

4

23

16

17

15

CET

CFL

CGH

CID

CQN

CSJ

CUF

CWB

CYX

CZR

DAS

DBU

DFM

DFU

DGM

DHI

DJE

DRO

DTK

DVG

DXC

DZY

EAZ

EBT

ECU

EGN

EGU

EHN

EIJ

EKF

ESP

EUL

EWH

EYD

FBA

FCU

FDW

FHO

FHW

FIO

FJK

FLG

FTQ

23

21

17

19

1

3

5

7

9

25

25

11

15

23

21

17

19

1

3

5

7

9

9

25

11

15

23

21

17

19

1

3

5

7

9

25

11

15

23

21

17

19

1

17

1

1

13

9

21

7

19

5

24

25

18

16

18

2

2

14

10

22

8

20

6

7

0

19

17

19

3

3

15

11

23

9

21

8

1

20

18

20

4

4

16

12

FVM

FXI

FZE

GAF

GCB

GDV

GEX

GIP

GIX

GJP

GKL

GMH

GUR

GWN

GYI

HBG

HDC

HEW

HFY

HJQ

HJY

HKQ

HLM

HNI

HUS

HXO

HZK

IAL

ICH

IED

IFX

IGZ

IKR

IKZ

ILR

IMN

IOJ

IWT

IYP

JBM

JDI

JFE

JGY

3

5

7

7

9

25

11

15

23

21

17

19

1

3

5

7

9

25

11

15

23

21

17

19

1

3

5

5

7

9

25

11

15

23

21

17

19

1

3

5

7

9

25

24

10

22

23

9

2

21

19

21

5

5

17

13

25

11

24

10

3

22

20

22

6

6

18

14

0

12

13

25

11

4

23

21

23

7

7

19

15

1

14

0

12

5

10

JHA

JLA

JLS

JMS

JNO

JPK

JXU

JZQ

KAR

KCN

KEJ

KGF

KHZ

KIB

KMB

KMT

KNT

KOP

KQL

KYV

LBS

LDO

LFK

LHG

LIA

LJC

LNC

LNU

LOU

LPQ

LRM

LZW

MAX

MCT

MEP

MGL

MIH

MJB

MKD

MOD

MOV

MPV

MQR

11

23

15

21

17

19

1

3

3

5

7

9

25

11

23

15

21

17

19

1

3

5

7

9

25

11

23

15

21

17

19

1

1

3

5

7

9

25

11

23

15

21

17

24

24

22

8

8

20

16

2

3

15

1

13

6

25

25

23

9

9

21

17

4

16

2

14

7

0

0

24

10

10

22

18

19

5

17

3

15

8

1

1

25

11

11

11

MSN

NBY

NDU

NFQ

NHM

NJI

NKC

NLE

NPE

NPW

NQW

NRS

NTO

OCZ

OEU

OGR

OIN

OKJ

OLD

OMF

OQF

OQX

ORX

OST

OUP

PDA

PFW

PHS

PJO

PLK

PME

PNG

PRG

PRY

PSY

PTU

PVQ

QEB

QGX

QIT

QKP

QML

QNF

19

1

3

5

7

9

25

11

23

15

21

17

19

1

3

5

7

9

25

11

23

15

21

17

19

1

3

5

7

9

25

11

23

15

21

17

19

1

3

5

7

9

25

23

20

6

18

4

16

9

2

2

0

12

12

24

21

7

19

5

17

10

3

3

1

13

13

25

22

8

20

6

18

11

4

4

2

14

14

0

23

9

21

7

19

12

12

QOH

QSH

QSZ

QTZ

QUV

QWR

RFC

RHY

RJU

RLQ

RNM

ROG

RPI

RTA

RTI

RUA

RVW

RXS

SGD

SIZ

SKV

SMR

SON

SPH

SQJ

SUB

SUJ

SVB

SWX

SYT

THE

TJA

TLW

TNS

TPO

TQI

TRK

TVC

TVK

TWC

TXY

TZU

UAV

11

23

15

21

17

19

1

3

5

7

9

25

11

15

23

21

17

19

1

3

5

7

9

25

11

15

23

21

17

19

1

3

5

7

9

25

11

15

23

21

17

19

19

5

5

3

15

15

1

24

10

22

8

20

13

6

4

6

16

16

2

25

11

23

9

21

14

7

5

7

17

17

3

0

12

24

10

22

15

8

6

8

18

18

4

5

13

UIF

UKB

UMX

UOT

UQP

URJ

USL

UWD

UWL

UXD

UYZ

VBW

VJG

VLC

VNY

VPU

VRQ

VSK

VTM

VXE

VXM

VYE

VZA

WAB

WCX

WKH

WMD

WOZ

WQV

WSR

WTL

WUN

WYF

WYN

WZF

XAG

XBC

XDY

XLI

XNE

XPA

XRW

XTS

1

3

5

7

9

25

11

15

23

21

17

19

1

3

5

7

9

25

11

15

23

21

17

17

19

1

3

5

7

9

25

11

15

23

21

21

17

19

1

3

5

7

9

1

13

25

11

23

16

9

7

9

19

19

6

2

14

0

12

24

17

10

8

10

20

20

21

7

3

15

1

13

25

18

11

9

11

21

22

22

8

4

16

2

14

0

14

XUM

XVO

XZG

XZO

YAH

YAP

YBH

YCD

YEZ

YMJ

YOF

YQB

YSX

YUT

YVN

YWP

ZBI

ZBQ

ZCI

ZDE

ZFA

ZNK

ZPG

ZRC

ZTY

ZVU

ZWO

ZXQ

25

11

15

23

15

23

21

17

19

1

3

5

7

9

25

11

15

23

21

17

19

1

3

5

7

9

25

11

19

12

10

12

11

13

23

23

9

5

17

3

15

1

20

13

12

14

24

24

10

6

18

4

16

2

21

14

trigraphs of the ciphertext against the table, but we luck out. The very first

trigraph OIN appears in the table as the enciphered version of the when the

multiplicative key is 7 and the additive key is 5.

15

Exercises

1. Construct a plaintext-ciphertext correspondence for an affine cipher

with multiplicative key 11 and additive key 16.

2. Encipher the following message using an affine cipher with

multiplicative key 11 and additive key 16.

TheRussiansandGermansalsosolvedPURPLE.

EJURBIOJMRXGEMHHUBXWTWJZMQEJURBISUS

BWQEIQVGZWNBCIVGZMJUYWUSBJWMQSWHWEB

JIZGEMHHUBIOWZWJMBWMBXGJNYWUSBJWMQ

of the. Then determine the multiplicative and additive keys and recover

the plaintext.

16

- Network Security & Cryptography MCQ'SUploaded byGuruKPO
- Lainzine Vol. 1 - Lainchan.orgUploaded byJohn Smith
- Alberti CypherUploaded bycagedraptor
- A Recent Study of Various Encryption and Decryption TechniquesUploaded byIRJAES
- DPG Issue Brief Cyber SecurityUploaded byCvr Lightings Calicut
- Contemporary NATO DoctrinesUploaded byKrzysztof Gruszczynski
- Cryptography -- ps.pptUploaded byumti29
- ConformanceUploaded bygame__over
- PSAA 608-600_Spring 2016_Davis.pdfUploaded bykris Richey
- McAfee License Review and Certification Form IndiaUploaded byharish_in
- 22Uploaded byप्रॉजेक्टपैराडायस
- 14012013145347-quantum-cryptography (1)Uploaded byRishabh pal Aarya
- Russia's Growing Reliance on Cyber Warfare Setting Dangerous Precedent for Future Foreign PolicyUploaded byMuhammad Tayyab Bin Akram
- Enhancing Data Security in WSN using Symmetric Key AlgorithmUploaded byInternational Organization of Scientific Research (IOSR)
- UAS Bahasa Inggris FILKOMUploaded bySyarif Hidayat
- Finland s Cyber Security Strategy - Background DossierUploaded byYury Chemerkin
- 2011 11 16 Larry Clinton SC Magazine Keynote Presentation About APT Economic Misalignment and RegulationUploaded byisalliance
- India Security SenarioUploaded byrajunair
- Key Manager ServerUploaded byVivian Aspdin
- Transpositiontec.pptUploaded byVandita Grover
- gilberto barrios gonzalez paper 1 final draftUploaded byapi-406910665
- Ethics and It Raw PptUploaded byGaurav Gharat
- CRRY98Uploaded byFlamist Kazuye Eienno Honou
- Security Issues in Mobile ComputingUploaded bysauru7
- Doc40Uploaded bygusloh
- 1509260192319Uploaded byDinesh Gaikwad
- SLM - Unit 03Uploaded byPunit Sundriyal
- DepeUploaded byDe Pe
- Granja y Charpenel, Kant y La Prohibición de MentirUploaded byOMAR SAR
- Nuclear Bible - The End of the InternetUploaded byTrue Prophet

- Cryptography ExercisesUploaded byNaru Desu
- Caesar CipherUploaded byJose Luis Gonzalez
- ADFGVX cypherUploaded byJose Luis Gonzalez
- El Gamal CipherUploaded byJose Luis Gonzalez
- Charles Dickens - A Christmas CarolUploaded bynafees_ali_4
- Presentation TipsUploaded byGuillermo Rodriguez Maruri
- sap-demoUploaded byJose Luis Gonzalez
- SAP FI Consultant CertificationUploaded bymsamala09
- Guia Estudio SAP FI 2012Uploaded byDiana Jiménez Arzamendi
- Sap_Unit 6 – Cash JournalUploaded byJose Luis Gonzalez
- Sap_Unit 3 – Document ControlUploaded byJose Luis Gonzalez
- Sap Financial StatementsUploaded byJose Luis Gonzalez
- Sap_Financial Accounting TFIN 50_1Uploaded byJose Luis Gonzalez
- SAP_FI-12!08!2011_SAP MM Certification Questions, Answers, And ExplanationsUploaded byJose Luis Gonzalez
- Sap_Lesson 1 – Organizational UnitsUploaded byJose Luis Gonzalez
- Sap Document SplittingUploaded byJose Luis Gonzalez
- Sap Correspondence OverviewUploaded byJose Luis Gonzalez
- Sap Chapter 2 Chart of AccountsUploaded byJose Luis Gonzalez
- Sap Bank AccountsUploaded byJose Luis Gonzalez
- sap-ficoUploaded byJose Luis Gonzalez
- Sap Intro Functional Fi 14nov2007Uploaded byJose Luis Gonzalez
- sap_fico194801282380587Uploaded byJose Luis Gonzalez
- Sap Fi Transaction Codes List iUploaded byJose Luis Gonzalez
- 1Z0-052-2.pdfUploaded byJose Luis Gonzalez
- 1Z0-052-1.pdfUploaded byJose Luis Gonzalez
- A Tale of Two Cities NTUploaded byikroman
- Treasure Island TUploaded bypenol

- Fall 2017_CS205_2_BC140400374Uploaded bybrainofpc
- As 2805.6.2-2002 Electronic Funds Transfer - Requirements for Interfaces Key Management - Transaction KeysUploaded bySAI Global - APAC
- 11 × 11 Playfair Cipher based on a Cascade of LFSRsUploaded byInternational Organization of Scientific Research (IOSR)
- ChaptersUploaded byTejesh Pasupuleti
- Image Security Using Linear Feedback Shift RegisterUploaded byInternational Journal of Innovative Science and Research Technology
- PracticeProblems-Crypto7eUploaded byp0go
- Inforamation Assurance & SecurityUploaded byBalraj Gill
- Computer Security and Cryptography ExamsUploaded byLucien Yemah
- Advanced SerializationUploaded byLalit Kumar
- Q_crypt_vcUploaded byVikramChandraRaushan
- Accurate Information Retrieval Using Semantic Searching From Encrypted DatabaseUploaded byInternational Journal of Innovative Science and Research Technology
- Types of CryptographyUploaded byBridget Smith
- Syllabus R2013 ME Comm & NWUploaded bySornagopal Vijayaraghavan
- AIT-4Uploaded byAshish Patel
- CAP613 __ CRYPTOGRAPHY AND SECURITY RISK MANAGEMENT.pdfUploaded byAmar Deep
- Analytical Study of Modified RSA Algorithms for Digital SignatureUploaded byEditor IJRITCC
- A Firewall is an Integrated Collection of Security Measures Designed to Prevent Unauthorized Electronic Access to a Networked Computer SystemUploaded byvaibvhav
- Computer Science 9608 Assignment.pdfUploaded byjibraan
- Thesis- Project reportUploaded byjay patel
- Data Hiding using EmoticonsUploaded byEditor IJRITCC
- CryptographyUploaded byBarbacaru Denis
- EncryptionUploaded byamit mahajan
- Cryptography TutorialUploaded bybob
- Cryptography Prateek SharmaUploaded byapi-3811430
- Symmetric and Asymmetric EncryptionUploaded byViney Bansal
- Basic Cryptanalysis, Field Man - Department Of The Army Publica_23252.pdfUploaded byOmar Valenzuela
- Topic+2+_Classic_Cryptosystems+-+Feb+12Uploaded byRyan
- Computer NetworksUploaded bymihir_patel65
- Adaza Netcom Latest ProfileUploaded bymohd khair bin othman
- An Implementation of Reverse Caesar cipher (RCC) Algorithm in Google Cloud using Cloud SQLUploaded byseventhsensegroup