C.2 Examples for Chapter 2
Example 1
A shift cipher was used to obtain the ciphertext kddkmu
.
Decrypt it by trying all possibilities.
>> allshift(’kddkmu’)
kddkmu
leelnv
mffmow
nggnpx
ohhoqy
piiprz
qjjqsa
rkkrtb
sllsuc
tmmtvd
unnuwe
voovxf
wppwyg
xqqxzh
yrryai
zsszbj
attack
buubdl
cvvcem
dwwdfn
exxego
fyyfhp
gzzgiq
haahjr
ibbiks
jccjlt
As you can see, attack
is the only word that occurs on this list, so that was the plaintext.
Example 2
Encrypt the plaintext message cleopatra
using the affine function :
>> affinecrypt(’cleopatra’,7,8)
ans =
’whkcjilxi’
Example 3
The ciphertext mzdvezc
was encrypted using the affine function . Decrypt it.
SOLUTION
First, solve for to obtain . We need to find the ...
Get Introduction to Cryptography with Coding Theory, 3rd Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.