@@ -191,7 +191,7 @@ def main():
191
191
elif args [1 ] not in ["shift" , "affine" , "vigenere" ]:
192
192
print ("Cypher name is not valid!" )
193
193
return
194
- elif args [2 ] not in ["enc" , "dec" ]:
194
+ elif args [2 ] not in ['encrypt' , 'decrypt' ]:
195
195
print ("Please specify operation type enc/ dec" )
196
196
return
197
197
try : # Check if input file exists
@@ -223,7 +223,7 @@ def main():
223
223
except ValueError :
224
224
print ("Check the key is a single integer!" )
225
225
return
226
- if args [2 ] == 'enc ' :
226
+ if args [2 ] == 'encrypt ' :
227
227
shiftCipher .encrypt (inFile , outFile , args [5 ])
228
228
else :
229
229
shiftCipher .decrypt (inFile , outFile , args [5 ])
@@ -238,7 +238,7 @@ def main():
238
238
except ValueError :
239
239
print ("a, b must be integers!" )
240
240
return
241
- if args [2 ] == 'enc ' :
241
+ if args [2 ] == 'encrypt ' :
242
242
affineCipher .encrypt (inFile , outFile , args [5 ], args [6 ])
243
243
else :
244
244
affineCipher .decrypt (inFile , outFile , args [5 ], args [6 ])
@@ -250,7 +250,7 @@ def main():
250
250
if args [5 ].isalpha () is False :
251
251
print ("The key must be all english characters only" )
252
252
return
253
- if args [2 ] == 'enc ' :
253
+ if args [2 ] == 'encrypt ' :
254
254
vigenereCipher .encrypt (inFile , outFile , args [5 ])
255
255
else :
256
256
vigenereCipher .decrypt (inFile , outFile , args [5 ])
0 commit comments