下载下来俩文件,1和FFFL@G.cry,后者打开是乱码,前者内容如下:

    1. [35, 8, 6, 23, 2, 34, 9, 8, 15, 17, 24, 20, 17, 0, 24, 32,5,2,0,0,2,1,0,0,0,0,8,3,0,0,5,2]

    仔细观察可以发现数组的前面一部分带空格,而后面则不带,将两部分分开,正好一组16个元素,可以组成两个4x4的矩阵。
    接着去搜索相关的密码,查到有可能是希尔密码,找到一个解密脚本:https://blog.csdn.net/qq_43968080/article/details/103643920

    1. #!/usr/bin/python3.7
    2. # -*- coding: utf-8 -*-
    3. # @Time : 2019/12/11 14:53
    4. # @Author : SystemDefenser
    5. # @Email : mrwx1116@163.com
    6. # @Software: PyCharm
    7. from numpy import linalg
    8. # 输入矩阵并判断是否存在逆矩阵
    9. def inputMatrix():
    10. while True:
    11. # 输入一行、作为行列式的阶数和行列式的第一行
    12. rank = list(input("").split())
    13. matrix = [[0] * len(rank) for i in range(len(rank))]
    14. matrix[0] = rank
    15. # 输入行列式剩余数据
    16. for i in range(1, len(matrix)):
    17. matrix[i] = list(input("").split())
    18. # 判断每一行输入是否合法
    19. if len(matrix[i]) != len(matrix):
    20. print("输入有误,重新输入。")
    21. continue
    22. # 转换字符型为整型
    23. for i in range(len(matrix)):
    24. matrix[i] = list(map(lambda x: int(x), matrix[i]))
    25. # 判断是否存在逆矩阵
    26. if not judgeInverse(matrix):
    27. print("矩阵不存在逆矩阵,重新输入。")
    28. continue
    29. return matrix
    30. # 判断是否存在逆元
    31. def judgeInverse(matrix):
    32. try:
    33. linalg.inv(matrix)
    34. except:
    35. return False
    36. return True
    37. # 生成密钥(矩阵的逆矩阵)
    38. def createMatrixInverse(matrix):
    39. try:
    40. matrix_inverse = linalg.inv(matrix)
    41. except:
    42. return -1
    43. return matrix_inverse
    44. # 生成消息分组
    45. def createMassageList(massage, matrix):
    46. matrixRank = len(matrix)
    47. massageList = []
    48. # 扩充消息序列并创建分组
    49. while len(massage) % matrixRank != 0:
    50. massage += " "
    51. for i in range(1, len(massage) + 1, matrixRank):
    52. massageList.append(massage[i-1:i + matrixRank - 1])
    53. return massageList
    54. # 字母序列转化为数字
    55. def letterToDigit(massageList):
    56. massageDigitList = [] # 替换后的数字列表
    57. letterList = [] # 字母列表
    58. for i in range(ord("a"), ord("z") + 1):
    59. letterList.append(chr(i))
    60. for i in range(10):
    61. letterList.append(str(i))
    62. # 添加空格,解决分组填充问题
    63. letterList.append(" ")
    64. # 替换字母为数字
    65. for massage in massageList:
    66. listTmp = []
    67. for i in range(len(massage)):
    68. listTmp.append(letterList.index(massage[i]))
    69. massageDigitList.append(listTmp)
    70. return massageDigitList
    71. # 数字序列转化为字母
    72. def digitToLetter(massageList):
    73. massageLetterList = [] # 还原后的字母列表
    74. letterList = []
    75. for i in range(ord("a"), ord("z") + 1):
    76. letterList.append(chr(i))
    77. for i in range(10):
    78. letterList.append(str(i))
    79. letterList.append(" ")
    80. # 替换数字为字母
    81. for massage in massageList:
    82. massageLetterList.append(letterList[massage % 37])
    83. return massageLetterList
    84. # 加密
    85. def encrypt(massage, matrix):
    86. ciphertextList = [] # 加密结果列表
    87. massageList = createMassageList(massage, matrix)
    88. massageDigitList = letterToDigit(massageList)
    89. # 矩阵相乘
    90. for massageDigit in massageDigitList:
    91. for i in range(len(massageDigit)):
    92. sum = 0
    93. for j in range(len(massageDigit)):
    94. sum += massageDigit[j] * matrix[j][i % len(matrix)]
    95. ciphertextList.append(sum % 37)
    96. return ciphertextList
    97. # 解密
    98. def decrypt(massage, matrix):
    99. plaintextList = [] # 解密结果列表
    100. matrix_inverse = createMatrixInverse(matrix)
    101. massageList = createMassageList(massage, matrix)
    102. # 矩阵相乘
    103. for msg in massageList:
    104. for i in range(len(msg)):
    105. sum = 0
    106. for j in range(len(msg)):
    107. sum += msg[j] * matrix_inverse[j][i % len(matrix)]
    108. plaintextList.append(sum % 37)
    109. # 浮点型转换为整型(采用四舍五入——round())
    110. plaintextList = list(map(lambda x: int(round(x)), plaintextList))
    111. plaintextList = digitToLetter(plaintextList) # 数字转换为字母
    112. plaintext = ""
    113. for item in plaintextList:
    114. plaintext += item
    115. return plaintext
    116. if __name__ == "__main__":
    117. while True:
    118. print("—————希尔密码—————")
    119. choice = input("1、加密 2、解密\n请选择:")
    120. if choice == "1":
    121. print("输入矩阵:")
    122. matrix = inputMatrix()
    123. massage = input("输入msg:")
    124. massageList = createMassageList(massage, matrix)
    125. ciphertextList = encrypt(massage, matrix)
    126. print("加密结果:", ciphertextList)
    127. elif choice == "2":
    128. massageList = list(map(int, list(input("输入密文序列:").split(","))))
    129. print("输入矩阵:")
    130. matrix = inputMatrix()
    131. matrix_inverse = createMatrixInverse(matrix)
    132. print("逆矩阵:")
    133. for item in matrix_inverse:
    134. print(item)
    135. plaintext = decrypt(massageList, matrix)
    136. print("解密结果:", plaintext)

    结果:

    1. —————希尔密码—————
    2. 1、加密 2、解密
    3. 请选择:2
    4. 输入密文序列:35,8,6,23,2,34,9,8,15,17,24,20,17,0,24,32
    5. 输入矩阵:
    6. 5 2 0 0
    7. 2 1 0 0
    8. 0 0 8 3
    9. 0 0 5 2
    10. 逆矩阵:
    11. [ 1. -2. 0. 0.]
    12. [-2. 5. 0. 0.]
    13. [ 0. 0. 2. -3.]
    14. [ 0. 0. -5. 8.]
    15. 解密结果: thisispassword

    得到密码后,看另一个文件,根据文件后缀cry,猜测完整后缀名是crypto,经过查阅资料,得知需要使用软件:Encrypto打开。
    打开后得到一堆emoji,使用https://aghorler.github.io/emoji-aes/解密,密钥是弱口令ISCC2021。
    image.png