Jump to content

Some 'Simple ' Encryption and Decryption Code with custom file names


G+_Tnt Seeker
 Share

Recommended Posts

Here's my take on what an encrypt/decrypt function in your program could look like: http://pastebin.com/V0cbQx0F

 

Also when listing the files and asking for them to pick one, use the number they entered as the index to the Folder_Content List and only have one block of code that opens/reads/closes the file. As part of your validation you could make sure that the number they enter is between 0 and the length of Folder_Content.

 

If you ever see patterns of code repeated like that in if-else blocks, it's time to look at what's common between them and reduce the code using a list, a loop, or a function.

Link to comment
Share on other sites

 Share

×
×
  • Create New...