KEMBAR78
NS Unit 2 | PDF | Encryption | Cipher
0% found this document useful (0 votes)
14 views25 pages

NS Unit 2

The document discusses cryptography, focusing on the concepts and techniques used to secure messages through encoding and decoding. It covers various methods such as substitution ciphers, transposition techniques, and symmetric key cryptography, explaining how plaintext is transformed into ciphertext and vice versa. Additionally, it highlights the importance of key management and distribution in maintaining secure communications.

Uploaded by

gaurav katare
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)
14 views25 pages

NS Unit 2

The document discusses cryptography, focusing on the concepts and techniques used to secure messages through encoding and decoding. It covers various methods such as substitution ciphers, transposition techniques, and symmetric key cryptography, explaining how plaintext is transformed into ciphertext and vice versa. Additionally, it highlights the importance of key management and distribution in maintaining secure communications.

Uploaded by

gaurav katare
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/ 25

PAGE N0.

Unit 2 DATE

Cryetognaphy- Concepts K&Techniques


:-k the axt and science
gplapaply by encoding meiaye
oF make themsecusiy
3'ochieving
Aon- réadable.
to
yptanalysis is the tecbniueo?
decodingmessages from a non-zeadabe
a

foxmat back to 1eddable foymat otod


knoucin hew they weYe iniially conventel
hrom zeadable format to nom-zeadabie
Fomat
Crypolagy : is o combinahen oof Cyp
raphy andyphanalysts.

Basie tezmtoolagy used toy secuutky


purpose e
1,
Cryptogha1phy i- The azar and seience of
achieving secuiky hy encoding kFgon as
to make Hem nm-readabléis messag
yplyaghy
2.2-Phin
Pbin texti- Oriqinal message
3.Ciphetext :- when aelaia text is
codifed wsing aný suttable scheme, the
ztsuiny mesiuge 'n calledas ciahey test
4Secrete key i- he seczet key îs input
to encrypion algorihm. Tt j5 value indepene
pai plain tert and algovihm.
PAGE No.:
DATE

5Eocryplkom Alsorlhm i- It peatoms vavious


substiutons and tzonsoimations on the
plastest.
sDeczyphn Algonithm i- It take sezele
key and cipbea text ahd produces oxiginal
plabBext
Substihtin Techaiqú es i
A subshhin techoique is one in
wbich the Jetten: o latntext ae
ote Letfens ox nunbens
xeplaced by
OY symbals."
I plaiotext is viewed asia sequenLe
otbishen subshhutoj iavolves epacin
plaintext bit patteans oith ciphentext bik
pateas.
caseo
Ceasea Cephen is a special
substhutm techoigues wherein each.
is zeplated by
alphabet in a messagedown
Lalphabel tnee plauei the lne
e - -plaotext: Hellos wovld
Ciphentext : Khoor rvog
PAGE N0.:

DATE

ist ofdlposstble combinaion of alhabe


C DEFGHIJ7 LM N
Plain
iphen D E F G H I KLMNO P QRSTI NOPQRST
ciphen B C
Xy z A B

Numeical equivalent to each lette


a bcd. e 9h i j kl m
oI2 3 4 s 6: 7:8 9 lo J1

P2 hi:s t
14 s 16: I7 :13, 20 21, 22- 23 24 26

The aleosibm can be expresed as


ollows Fo, _each plaiotext iettenP.
Lsubstitute the ciphetext etter Qri
C =EC3,P)= (P+3) mod 26

A shitt m-y be ot any mmnt,so thed


the qeneaadl 'cease caesea aloxihn i
C=KP) = LP+K) mod 26
ohene k yaloes focm to 26

Pecrypken algaxfm
PDKoY= ((-k) mod 26,
PAGE NO.:

DATE

Demeais
uIThe encryphiom and deCIypion alyoibms ane
knwn
2 There ane ondy 25 keys to try
Thelanguage of plaintext is kaown and
easily 'reogoizable.
2 Monoalphaheti CipheY
Monoalphabetie icipea substhutes ene
lettea o' the alphabet toith ansten
alphabet. Rathen hunisibshhting acoxdin
4o aa requlan patlén 20y letlen can be
subsluked tax any sthen' lettea as long al
each lettea has a únigue substihute let!
Land vice versa.
Tn general theie aue n! permtation
In
ot set ot nielement because he tzst
lelement can be chosen) in one of nway.
Second in - ways thie io cor) and so on
Lnstead, the cighen lne can be any
peumutaien of the 26 alphabehc eharacten
Ehe thexe one 261 possible keys
PAGE NO.

DATE

B Playfai Ciphea based on. 4


Playfair algoitmis
consbu
use of Sxs matIX of leftens
a keyuord PLAYEAr.
e sup2Se keyw0Td is
Then sis matzík cantaiain, an key

rAyE LAyF
INKBCD I R BCD
EGKmN EGHKM
NoasT
VW

The matix îs constzucted by llingin


the lete oi the keyboand'tom el!
Yieht cnd top to bettom and then lag
in he zêmainden o he matzix t he
emainiag Jetteas in alpbabeti oxder
The lete IlT (ant as ne Jetfea.
Take anothen keyuod MONARCHY
oN AR
H|y B|D
LI S
PAGE No.:
DATE

The encayphion algorithm takes m


plaiatext leens and subsitutoy toy
hem mmciphentext lettes
The substihutien is detexmined by m
Linea equakions în which each chasacte
bedescIibed as
Ci =(kuPt Ky2P+ KigP) mod 2s

This can be expztssed as column


vectoxs andmatotces:
P)
P2 mod 26
C2
C3

c andP ane coluon vectoxs


wbereC
Lot length 3,7epresening plaiatext nd
cipheatext
kis sx3 matzis , epresenting the

encrypiog key
e. Pluntext
Plaintext = Paymore
Paymore money
land key (K)= 2)

2
PAGE NO.:

DATE

plaintex
The Axst thaee ettea oec toy
nerepresented by the
Is)

24
then
2) 18 2) 0 inod 26
2 2 I9/| 24

375
811 mod 26
486

LNS
13

fox plaintex'Pay cipheatex i 'L9S


Cipher C=ECK,p)kP mod 2&
Plaintext P= D(K.p)=cmcd 26
PAGE NO.:
DATE

Use play fair ciphex to encyet the


Follaaoing message This is a columnay
trangposihion use key APPLE
key

skeps:1tt
Repealing, plaintext letBeas that ane separake!
allen letter such as x, sothat
ballocn wald be tyeated as balxlo 00.
.Too plaintext lettens that Fall io the sam
To0 of he matix ane each replaced by
the letten to the zight, oith tyst elemene ot
te gouw chculany talowing he ast
a. Tiso plaintext letteas that fal) îg the same
caluron ane each replaced by he letten
beneath,t the top elementot the
colunn ciaulaly folsaiy te last
4o othen woise,eachplaintext leten fn a pai
i zeplaed by he letter that lies in its
Don ow and te column ocCupied by
Lohen plaintext lette
A PLE B
D F toDN H
KM N
S T U
W XY
nessage : Th is is ac k ol um
Po S) ti on
Ciphertes : QNLo
U6 MA MA MB SD IE S aP MT BK AM
PAGE NO.:
DATE

Using hill ciphea enixget plain text cog


ue key ANOTHERBZ.
2 Pa, platotext =cOE
2 14 4
key = ANOTHERBZ
O1314 197 417 | 25

.. P= 2 13 14
1 4
4 25

C = KP mod 26
I3 14 2
|19 7 4 14 mod 26
1} | 25|4

238
132 222
J43

Ciphentext =EVS
PAGE NO.:
DATE

Syrnetíe ke éryptphy
Transposiion Technique
A tyansp osihon ciphea rearangt, the
chaxatersin the plaintext to toTm Hhe
ciphertext
'The roil fence cipher is camposed by
writing the plainkext in tuo ows,
pyoceding down, then aczoss and reading.
the ciphestexlt acros hen don,
eg to eniphea the mesagf " meet me
atter this patty"oith a zasl Pence ot deptha
me
et
The ciphentext is
memathhsatet ef et iey
Attacking a transposihim ciphex aeguites
TeOTIangement oi the letters t e
ciphênke~t.
AApuae troansposition cipher is easily.
Tecogoized because it hai the same leter
hequencie1 as the oxiqinal plankex
The bok is sutable for
self shudy
S6 4) 3 2
PAGE NO.:
DATE

t h e
ki S 1
a
Se
S t s.d y

Ciphertext: bsledoifHouely.esbs utk


toshiqrt

Use the hasposiien cipher o entyet


the plaatext" WE AXE THBEST""
use key HEAVE N
K
key
Key Noi 4 2 6 3 5

Plaintet w E A RE T
B E
E S T

Ciphetext: ABEEES WHTTRE

This is olso knoon ac simple colunnan


tansgosthen.
PAGE NO.:
DATE

Vetnam Cipher
Vexnam Ciphex is aso called as cne
time pad
Tt
It is ioplemented usiag yandom set ot
n-xepeating character`as the input ojphey
text
Tt s called one time because,once
oput cipheY text for taspositin k used
it is neven used aqain fox any othex
mesaqe
he Tength o iaput ciphex is eual to
ength 'ot the oziinal plan text
Teat each plain text alphabet as a nunben
in an incYeasing seguenle J-e. Aozoß2)Z=25
Do the same for each character ot the ioput
cipher text
Add each number coTYeSponding to the plaig
tert alphabet to the cartspondins input cipheu
text alphabet nunber.
I sun hus produced is qxeatea thag 2s,
substyact 26 fiom t
Tanslate each nunben ot the sum back
to He cotespmding alphabet Thts give
he outpul ciphen text
PAGE NO.
DATE

how ae you
in
using veam ciphe. ighealen
Plun tetH ABR E
77 14 22 I7 4 24 14 20

One time B A
pad tey

Add 2o I6 2L I) 42 20 24 31 4a)
143
substack 20 J6 23 20
24
C
Cipher tert Y F R
PAGE N0.:

DATE

ENCRYPTTON o DECRYPTLON

The process of encoding plainis text message


in to cipher text messages s called
Encryphin
Hello John Limmp kei
Plain text Encrypt Gphen text

The yevense proces ot tansforminatext


ciphertext mejsages back to platn
meSages is caled as deczyphian.
Itmmp kpio tello John
Ciphen text Plain tert
Deypt

n computen to computer communiatiens,


the computer at the sender's end usually
tronstoxmsa plain text nessage in to
clplea text by petorming enxyphiam by
applying encayphh algozibo
The eHczypted ciphe text message ts thes
sent tohe receiyer over a ntuwozk.
The Teceivens cormputer then takes the
encrypted message and pexfoMS the xeveAse
st encryphin e. it petoxms
peifams he decryphy
process to obtain he orfginal_plaig téxt
message by appyiny decryphon algoithm
PAGE NO.:
DATE

Apaat from applyíny encrptn


Ldecry phen algosithm the Ghe
fox pestonn enayphon o7 deypi
k te Key
aspet
Akey issomebin similu to tte on#
tine pad used in he vemnam ciphÇx
Howevenit is the key used for
enczypin
process ot
and detnyphm that makathe
secnp.
PAGE N0.:

DATE |

Symmetsic nd Asyesaeti key (ayplbgap


hene ane tuo
Fox any encrypion appyoach,
mafor challanges:
Key distaibuti :Hoo do we COnvey keys
to those whose need them to estabiah
secue communicahn.
Key mangqement Gven a lange nmbe
ot keys ho do we preseAye their
safehy and make them' available as needed.

Symmetie keywant cogptbazaphy


to 'send acontidential
Example:A
lettes to B. Ways that can be adopted :
o)A puts Jetter in on envelop and sends by
Dost to B ’ No quaantee.
H) Sends via hand deliveYy by hizd peasen
Bo quaYantee.
sendt vta hond detiveTy by hind pesen
9 Envelop inside a sealedtelocked
9$ box
Tis saluFen prevents unauthoize
access but also to authonz ed ene.
key ath the box is abscuzd.
d) Sending
Solution is pachealy pstsle
PAGE NO.:
DATE

Now Suppose many peqle ant to e


such confidential létea coith this symnehi
key apenaton.
Suppaie
A Communicate with Blpair of lock and
A Communicate aih B.C7 2 pair of orkt
ACommunicutes A,B,(D 7 6 paiys CAB. A
BC, 8D, CD).
No locks and key poiYS Tequired
=n (n-)2!

foy |000
panties to communicate.it
requires 439s00 patrs of lock an key
o lod
PAGE N0.:
DATE

Dfe - Helman key exchange Alyoniby


athe- Helman key exchange algonihm f
Thased on mahemafital pridciple.
-xstly Allice and Bob aggee on tieo
lazgé pxine numbeAs n' cnd qThese
tuo fotegexs need not be kept secret
Alice andBob Can use an iosecuye
channeto agnee on tem.
A Alize chooses anotbeT ange large
Asuch
zandorg numben xand caleulates
hat
A1= mod n
sends the numbenA to Bob.
8. Allice
anahen lage
4. Bob independently ichoosescalculate
and Bsuch that
7andam nte y
B=qmod n
sends the nmbe Bto Alice
S Bob ki as
6A noo computes the seczet key
K, = B modn kz a
he secret key
com putes
ollos
Kz = A' mod 9n
Kz,ohich is symmetoic key
So k and keep secek
ohich Alice and Bob must
PAGE NO.:
DATE

Example
b ist Allice and Boh
pxime nwnbeas 9 and agre n tusn
Let n I| and =7
2- Allice chooses anothen lasge rardom
Calculate
A gq^ modn
Let 3 then
: 343 mod 1) =4 2
3 Allice send nunber Ato bob. Le he
4 Bob independently chaose another
Yondom uwnbe Yand caloulate lunge
B 4' mod n b
Let ==6then
6 B= mod )
4
SBob Send mben B to Alle es
6.A now compude sCLrete key K
KË = 4 mo | = 64 mod 1) =9
tB now computes sevete key K2
K2 A mod n
2
mod )
PAGE NO.:
DATE

Asymmetaic key
T this schemetusted third party
Inamed "I" who is certheday highly
tzustworthy and cihcient agency hy
govenment
To this scheme ¢ and B do nothave to
'otoHy apploach T or lock and key pair.
B alone approaches T_ond obtains
lock and key (K) and send it to A.
B tells A to seal the box eit kikË and
send it to him
B has differert het selated. key kz to
is called asymetic
This type
means tat 8 has both the keys
and K2
Ke for unlocking
ie Ki ox locking
and ts available to
key k for lockin not to be scrctc)
qeneaal pub'e Cned public key.
KI is thus caled_ unlockfng cnd thus
Kz is used fox scczete Thus kais
Key
had tolo be shicy oY secrete key.
hs
suid to be pri vate
PAGE NO.:
DATE

stenmgxanly, a
dcchaiquc hadt
thet
is to be kept seczcte inside other
zesult is
imessag ls. This
ot secrete message itselk
concealment
Technigus ued
Charaten manking i selected leters o
puiated ax tyerkmtten text aae oeurde
in penil. The mauks ane ardinaily aot
visible usless te papea îs held dt an
angle to baight abk
"Tyistble Taki A nunberof substance
ran be used or wsiting but leaves no
visible trace unt teef or Seme chenitdl
is appl'ed to the paper
Pn punctunes : Small pin punctnes an
selected etters ae eordineily net
yisibe te popen is held hont ot

"Typewniten corechen íben: Used Lehwe


ne typed wtth a black gibon the
sesult of typing coih the coirechon te
PAGE NO.:
DATE

ane visible only wnder a

stegangghy Cnyglegarby
pefnihn Tt is a techolgue to It is a technique to
hrde the exislance conyeat dota foto an.
of communicatfon. nconpAehensiJefom
puspee Keep communication Profde dta prdechio
secwre.

Data Never Always.

Dato Does not ater tte AlBers the overall


Sruthu ovenall struchue o struchue o date
data

Key optional , but otte Necessany req w


Mose secity if used. ment

Failwe Opce the preserke Tf yau posses the


o1 secret nersege
decrphenkey, the,
discovened,anyune con yu can fyuue aut
aviginal mesaye bd
ue secet data
an the cipheate
PAGE N0.:
DATE

Key Runge and Key Sze


Encyped MeSIA9e can be attacked
whene tcyplanalyst is aumed uoith
The enczyphn ldecayphon algorihn
The encryled messag!
knowlede about key size
Key Range i total nnben of keys tgm
smallest to langet avathble key.
Challenep foy the attacker: Achual value
The concept c key Tange leads to the
pindple oi key
the soluicn of
SIze
un problem lies fo te
expondin cT increasing the key Tange to siz
ohich reqyes attacken to wonk foy moxe
than s yeasc o_oxden to crack the key.
key size is measuned po bits and s
eit serted usiny binary o systey
Thug t key 3ange emnwnbento &then he
key size is 3bs or in othen oTds
e can suy it
iH the si2e in bits then K
Tenge is o to 2sG
ke size may be yanying ,depending
the appications and the cpbgiapi
aqoribn betng usedt cas bits.
PAGE NO.:
DATE

T orden to protect the ciphen text


Lagainst behesuch
biute-tae attad, te
such that he attacker cán
key size
should be
pot czack it within a specihed amaunt
ot time.
Loiginal
tert.
plain a) 2 )
ohàtLatackeat
SMe
orian isplain successfal
attack. moTeto
Obxiauslyte plain Baitd Lleiuae The eue attacktheCiphen choosenKhouon
Ciphen cip omeSsage
her plteaxtin ahen
bijgea considen the me atack
text iext. on attacke, ahad text,
thnee
eie sende
attácken or Text Pla in Text Possible
makes the to Plain on
he a aladtackerdoes Cnly
constastditiulk ta y
analyzei te the Text Text only tS of
tackea Small ,more frequency an plain Atlack Types
attempt
nd
ciphetext AHack. At ta ckAHack possibilhe
message ane mese into
nd i to chancero ique text its of
casdoun ciphertext
he aneciaNetphavi
ehentaextte ot he Io
n ipheaJues to ciphelext He
n ot comespondingencrypts Atack DATE

letHers out this


tesixtze the block ques) lshe kaye
the type
lo orig the the at
hu any of
ty Re
u

ahat tis,s to lcomnooly


baonelsExample koow tries paitsattacken
ofomahen same attacker selectChosenpaticua
triesto
a_plain company text Knoon
ciphertcxt choose
he in maTe to Usi n and
plain Jofle of plain
attaker the cipher look ox knows
thet all such and fnd
correspondin
text
text headeas his
mesages text othen abak atack
katentionally
eresulk
fte he plainformahen,
in more
the attack pars
in encrgehiern Hexe docunent ot ohiachtexts of some :
to of ciphei
abtaiin cncTypt bloteacknxtd i-
attacker ane ane plain and Tn DATE PAGE
N0.:

plcks Heae. textpairs this


found teretoe
compamy text. the
morpaten
e Pased is the atfacken for ofcase
he thoe pla,
on able

You might also like