52. Encrypt and decrypt files

Write a program similar to the one shown in the following screenshot to let the user encrypt or decrypt one file into another file:

Enter the original filename, the name of a file to hold the encrypted results, and a password. When you click Encrypt, the program should encrypt the original file and save the result in the encrypted file.

Next, enter a decryption password and the name of a recovery file to hold the decrypted data. When you click Decrypt, the program should decrypt the encrypted file and save the result in the recovery file.

Make the program show the original file, the encrypted file (only display the first 1,000 bytes), and the decrypted file in separate tabs as shown in the preceding screenshot.

The program should be able to handle any kind of file. In the screenshot, I used an RTF file containing English, Japanese, and an image. Verify that the program cannot decrypt the encrypted file if the decryption password is wrong by even a tiny-amount.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.142.135.190