Quiz 3

Summary

使用Vigener cipher解密

Screenshots/Source Code

下面的code將字串分成一組、二組、三組並且分析每個平均ic

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →

下面的code將每一組的字母組成列出來
Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →

最後用這個function將密文復原
Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →

Tests Result

下面是對於第一組字串的分析

可以看到當key的長度是5,ic值最合理

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →

我用A前有6個(U,V,W,X,Y,Z)出現頻率很低,後面4個有一個(E)出現頻率很高,推測出key為“HOMER”
Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →

下面是對於第二組字串的分析

可以看到當key的長度是6,ic值最合理

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →

我用A前有6個(U,V,W,X,Y,Z)出現頻率很低,後面4個有一個(E)出現頻率很高,推測出key為“POIROT”
Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →

How to Use?

  1. 將檔案解壓縮

    Image Not Showing Possible Reasons
    • The image file may be corrupted
    • The server hosting the image is unavailable
    • The image path is incorrect
    • The image format is not supported
    Learn More →

  2. 並解在terminal輸入“python3 109550116.py"執行檔案

  3. 最後解完密的明文會在message1_out.txt與message2_out.txt

    Image Not Showing Possible Reasons
    • The image file may be corrupted
    • The server hosting the image is unavailable
    • The image path is incorrect
    • The image format is not supported
    Learn More →