You are on page 1of 1

START

Prompt :
"Enter input
text: "
INPUT
inputtext

Prompt :
"Enter key: "
INPUT key

Prompt : "Enter
encryption or
decryption (e/d):
"
INPUT modetype

posttext = ""

keyindex = 0

IF lowercase IF lowercase
True modetype is "e" False modetype is "d"

mode = 1 mode = -1 IF inputtext[ind]


True is uppercase
char = char mod 26

posttext = posttext +
uppercase of False keyindex = keyindex
chars = ['a', 'b', 'c', 'd',
chars[char] mod length of key
'e', 'f', 'g', 'h', 'i', 'j', 'k',
IF mode is 1 or
'l', 'm', 'n', 'o', 'p', 'q', 'r',
mode is -1 's', 't', 'u', 'v ', 'w', 'x' , 'y', posttext = posttext +
'z'] chars[char]
keyindex = keyindex
+1

False
ind = 0

posttext = posttext + char = char +


ind = ind + 1 mode*(index in
PRINT "Invalid
inputtext[ind]
chars of (lowercase
encrypt /
of key[keyindex]))
decrypt input"
IF ind < (l engt h of
False
inputtext)

IF lowercase of char = index in chars


False
inputtext[ind] in True of (lowercase of
chars inputtext[ind])

PRINT
END
posttext

You might also like