File tree Expand file tree Collapse file tree 1 file changed +26
-6
lines changed Expand file tree Collapse file tree 1 file changed +26
-6
lines changed Original file line number Diff line number Diff line change 5
5
2. In the second line the user inputs the string as per his choice given in part 1.
6
6
"""
7
7
8
-
9
-
10
-
11
-
12
-
13
8
from random import choice
14
9
15
10
def decrypt (encrypted_string ,key_val ):
@@ -59,4 +54,29 @@ def encrypt(input_string,key_val):
59
54
key_val = int (input ('Enter the key value ' ))
60
55
print ('Decrypted string is : ' + decrypt (encrypted_string ,key_val ))
61
56
62
-
57
+ """
58
+ Sample Test Case :
59
+ Case 1 :
60
+ User chooses to input string and encrypt the inputted string .
61
+ input :
62
+ string : escrsce
63
+ key value : 5
64
+ output :
65
+ encrypted string : JXHxwhJ
66
+
67
+ Case 2 :
68
+ User chooses to enter an encrypted string and decrypt it .
69
+ input :
70
+ string : trWEcere
71
+ key value : 6
72
+ output :
73
+ Decrypted String : ZXDKIKXK
74
+
75
+ Explaination :
76
+ In this program , we take the input string and key value .Once we get the key value , we substitute the alphabet of the string with the updated key value alphabet .
77
+ For eg . if input character is A and key value is 3 , so it will be subsituted by D ( A + 3 = D )
78
+ Also in case if the encrypted string consists of both lower and uppercase characters we convert the whole string to uppercase
79
+
80
+ '''
81
+
82
+
You can’t perform that action at this time.
0 commit comments