Python Assignment


Posted : 9 months ago

Write a program that encrypts and decrypts the user input.  Note – Your input should be only lowercase characters with no spaces.

Your program should have a secret word that will be used for encryption/decryption.  Each character of the user’s input should be offset by the value of the same character in your secret word.  For example, if my secret word is “cab” and the user wants to encrypt “apples”.

c

a

b

c

a

b

3

1

2

3

1

2

 

 

 

 

 

 

a

p

p

l

e

s

1

16

16

12

5

19

 

 

 

 

 

 

4

17

18

15

6

21

d

q

r

o

f

u

 

The encrypted output would be “dqrofu”.

The program should ask the user for input to encrypt, and then display the resulting encrypted output.  Next your program should ask the user for input to decrypt, and then display the resulting decrypted output.

Enter phrase to Encrypt (lowercase, no spaces): apples
Result: dqrofu
 
Enter phrase to Decrypt (lowercase, no spaces): dqrofu
Result: apples
Budget : $20.00


Files Attached


No files attached



Answers


Price : $20.00