File encryption and decryption Experiment
[Experiment content]
Use des, AES, and RC2 algorithms to encrypt and decrypt texts, images, audios, videos, and other files.
File encryption and decryption Experiment
[Experiment principle]
Some of the computer's unsuitable private or confidential files are easily stolen and exploited by hackers. The fundamental solution to this problem is to encrypt important files. In practical applications, various encryption and decryption algorithms are used to protect files by directly using built-in tools or other special tools.
This experiment uses the DES, AES, and RC4 algorithms to encrypt and decrypt the content of texts, images, audios, and videos. The general process of encryption is to read the file content, encrypt, write the ciphertext into the file, overwrite the content, and save and decrypt the process.
File encryption and decryption Experiment
[Lab environment]
ISES Client
Lab procedure]
Take text files as examples. You can refer to other files, such as images, audios, and videos.
(1) The plaintext content of the new file 1.1.91.
650) This. width = 650; "src =" http://s3.51cto.com/wyfs02/M02/49/DE/wKioL1Qc2qrxWIthAAAxhk-y-dc700.jpg "Title =" jia1.jpg "alt =" wKioL1Qc2qrxWIthAAAxhk-y-dc700.jpg "/>
Figure 1.1.91
(2) Use the DES algorithm to encrypt the file, as shown in 1.1.92.
650) This. width = 650; "src =" http://s3.51cto.com/wyfs02/M02/49/DD/wKiom1Qc2qSSOkJwAADlv5vTtKU986.jpg "Title =" jia2.jpg "alt =" wkiom1qc2qssokjwaadlv5vttku986.jpg "/>
Figure 1.1.92
(3) check that the files in the encrypted file 1.1.93 have been encrypted by the DES algorithm.
650) This. width = 650; "src =" http://s3.51cto.com/wyfs02/M00/49/DE/wKioL1Qc2tSwl58FAABMsn726jY256.jpg "Title =" jia3.jpg "alt =" wkiol1qc2tswl58faabmsn1_jy256.jpg "/>
Figure 1.1.93
(4) decrypt the encrypted file 1.1.94. view the decrypted file and compare it with the encrypted file 1.1.95.
650) This. width = 650; "src =" http://s3.51cto.com/wyfs02/M00/49/DD/wKiom1Qc2srDfWKlAADwn4A75uk716.jpg "Title =" jia4.jpg "alt =" wkiom1qc2srdfwklaadwn4a75uk716.jpg "/>
Figure 1.1.94
650) This. width = 650; "src =" http://s3.51cto.com/wyfs02/M01/49/DE/wKioL1Qc2vjSVZEhAABNh-VJDa4263.jpg "Title =" jia5.jpg "alt =" wKioL1Qc2vjSVZEhAABNh-VJDa4263.jpg "/>
Figure 1.1.95
(5) If you modify the key pair to decrypt the file, a message indicating that the decryption failed is displayed, as shown in 1.1.96.
650) This. width = 650; "src =" http://s3.51cto.com/wyfs02/M01/49/DD/wKiom1Qc2u2BYjfuAAEsBrbQMHg521.jpg "Title =" jia6.jpg "alt =" wkiom1qc2u2byjfuaaesbrbqmhg521.jpg "/>
Figure 1.1.96
(6) Select the AES and RC2 algorithms to encrypt and decrypt the file and compare the encryption and decryption results.
This article is from the network blog, please be sure to keep this source http://zznetwork.blog.51cto.com/9398550/1555418
Cryptography experiment-file encryption