課程名稱 Course Name:密碼工程 Cryptography Engineering
授課教師 Lecturer:謝致仁
授課時間 Semester:111-2 2023 Spring
A python program that can encrypt the text or image into DNA sequence, and decrypt it.
- User input the file path
- Use Adaptive Huffman coding algorithm to compress the file
- Use LFSR (Linear feedback shift register) to generate OTP (One time password) key
- Use XOR to encrypt the plaintext with the key
- Use a dictionary to translate binary into ACTG
- Save the encrypted ATCG message in a .txt file
Make sure that you have install all required packages in requirements.txt
You can use pip install -r requirements.txt
to install the packages
- Navigate to the
./src
directory. - Use
python main.py
to start the program - Choose the mode (encryption or decryption) and specify the file type and path.
- The encrypted result and its key would be saved into
cipher/Cipher.txt
andkey/Key.txt
- If you want to decrypt the file with the key, you can also use
python main.py
to decrypt it.