0% found this document useful (0 votes)
513 views3 pages

S-DeS Decryption Sample

The document describes the steps to decrypt a ciphertext using the S-DES algorithm. It provides the ciphertext input of 01000110 that was produced from an original plaintext of 01101101. It then walks through each step of the decryption process, including initial permutation, expansion/permutation with subkeys K1 and K2, s-boxes, and final permutation to recover the original plaintext of 01101101.

Uploaded by

Shailendra Gupta
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)
513 views3 pages

S-DeS Decryption Sample

The document describes the steps to decrypt a ciphertext using the S-DES algorithm. It provides the ciphertext input of 01000110 that was produced from an original plaintext of 01101101. It then walks through each step of the decryption process, including initial permutation, expansion/permutation with subkeys K1 and K2, s-boxes, and final permutation to recover the original plaintext of 01101101.

Uploaded by

Shailendra Gupta
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/ 3

7/28/2016

SDESDecryptionsample

SDESDECRYPTIONSAMPLE
Theciphertextoutputproducedbytheencryptionsamplewas01000110.Wethereforeadoptthatasinputhere.Asacheck,weexpecttheoutputthatwill
emergeheretoproducetheencryptionsample'soriginalplaintextinput,whichwas01101101.
Asinputtothisdecryptionstage,useciphertextobtainedfrom
Input:
havingappliedSDEStosomeplaintext.Totheinput
0
1
(ciphertext),applyinitialpermutationIP:

IP
2

Inthenextsteps,wewilldevelop4bitswithwhichtoreplace
thelefthalfofthis"blue"result.
Toright4bitsofaboveresult,applyexpansion/permutation
E/P(generating8bitsfrom4).Thebitnumberingisthatofthe
4bitrightnibble,notofthe8bitbyte(e.g.,indicatedbit2
referstobyte'sbit6).
E/P
4

Uponaboveresult,performbinaryXORoperationwith
subkeyK2(whenencryptingweappliedK1firstthenK2
decryptingnow,wereversethatsequence):
K2
0

DeterminearowandacolumnfromaboveXORresult.For
therow,combinebits1and4andconverttodecimal.Forthe
column,combinebits2and3andconverttodecimal.
Determineanotherrowandcolumn.Forthissecondrow,
combinebits5and8forthissecondcolumn,bits6and7.
IdentifytheentryinsboxS0atthefirstrow/firstcolumnyou
determined.S0showsitindecimalconvertittobinary(two
bits).Enterthosebitsasthefirsthalfofthe4bitnumberat
right.IdentifytheentryinsboxS1atthesecondrow/second
columnyoudetermined.Convertittobinaryenterthosetwo
bitsasthesecondhalfofthenumberatright.

S0=

r0
r1
r2
r3

c0
1
3
0
3

c1
0
2
2
1

c2
3
1
1
3

c3
2
0
3
2

leftnibble:
bits1&4>10>2
bits2&3>10>2
therefore,getfromS0row2col2
resultis1>01
rightnibble:
bits1&4>01>1
bits2&3>00>0
therefore,getfromS1row1col0
resultis2>10

S1=

r0
r1
r2
r3

c0
0
2
3
2

c1
1
0
0
1

c2
2
1
1
0

c3
3
3
0
3

Toaboveresult,applypermutationP4:
P4
2
4
3

UpontheaboveP4result,performbinaryXORoperation,
XORwith1100
combiningitwiththeleft4bitsofourfirstresult(application
ofIPtooriginalciphertextinput,bluecellabove).
0
1
1
0
Wearetryingtoreplacethelefthalfofthatfirstresult.These
XORresultbitsarethereplacementbitsforit.
http://homepage.smc.edu/morgan_david/vpn/assignments/assgtsdesdecryptsample.htm

1/3

7/28/2016

SDESDecryptionsample

Rewritethat"blue"firstresultwithitslefthalfreplaced.(Look
itup,keep/copyitsrighthalf,usetheprecedingresultasthe
newlefthalf.)

Swapthetwo4bithalvesoftheabove(previous)result.
Inthenextsteps,wewillagaindevelop4replacementbits,
andwiththemreplacethelefthalfofthis"green"swapresult.
Thestepswillbethesameonesusedforthatpurposealready.
Toright4bitsofaboveswapresult,apply
expansion/permutationE/P(generating8bitsfrom4):

E/P
4

Uponaboveresult,performbinaryXORoperationwith
subkeyK1:
K1
1

Determinearowandacolumnfromaboveresult.Fortherow,
combinebits1and4andconverttodecimal.Forthecolumn,
combinebits2and3andconverttodecimal.
Determineanotherrowandcolumn.Forthissecondrow,
combinebits5and8forthissecondcolumn,bits6and7.
IdentifytheentryinsboxS0atthefirstrow/firstcolumnyou
determined.It'sgivenindecimalconvertittobinary(two
bits).Enterthosebitsasthefirsthalfofthe4bitnumberat
right.IdentifytheentryinsboxS1atthesecondrow/second
columnyoudetermined.Convertittobinaryenterthosetwo
bitsasthesecondhalfofthenumberatright.

S0=

r0
r1
r2
r3

c0
1
3
0
3

c1
0
2
2
1

c2
3
1
1
3

c3
2
0
3
2

leftnibble:
bits1&4>11>3
bits2&3>00>0
therefore,getfromS0row3col0
resultis3>11
rightnibble:
bits1&4>10>2
bits2&3>00>0
therefore,getfromS1row2col0
resultis3>11

S1=

r0
r1
r2
r3

c0
0
2
3
2

c1
1
0
0
1

c2
2
1
1
0

c3
3
3
0
3

Toaboveresult,applypermutationP4:
P4
2
4
3

UpontheaboveP4result,performbinaryXORoperation,
combiningitwiththeleft4bitsoftheearlierswapresult
(greencellabove).
Wearetryingtoreplacethelefthalfofthatswapresult.These
XORresultbitsarethereplacementbitsforit.
http://homepage.smc.edu/morgan_david/vpn/assignments/assgtsdesdecryptsample.htm

XORwith0001
1

0
2/3

7/28/2016

SDESDecryptionsample

Rewritethat"green"swapresultwithitslefthalfreplaced.
(Lookitup,keep/copyitsrighthalf,usetheprecedingresult
asthenewlefthalf.)

Toaboveresult,applyreverseofinitialpermutationIP,which
isIP1:

IP1
5
7

Thisresultisplaintext.ItistheSDESdecryptionofthe
ciphertextinput.Itshouldidenticallymatchtheoriginal
plaintext,fromwhichtheciphertextinputtothisprocesswas
firstderived.

Thisdecryptionoutputduplicatestheencryptioninput,sosatisfiesusthatprobablythealgorithmworksandourcalculationsaregood.

http://homepage.smc.edu/morgan_david/vpn/assignments/assgtsdesdecryptsample.htm

3/3

You might also like