Ciphey在windows上安装及使用
Ciphey介绍
基于深度学习的文本自动解密算法。
项目地址:https://github.com/Ciphey/Ciphey
感兴趣的可以看看这篇文章:https://cuijiahua.com/blog/2020/08/dl-24.html
Ciphey安装
注意!!!
-
不能是 python3.9版本(因为我自己是3.9会有问题,后来选择用pycharm3.8的虚拟环境)
-
不能是 python 32位版本
-
建议使用 python 3.8 64位版本:python-3.8.10-amd64.exe
python官网:https://www.python.org/downloads/
使用pip安装即可
pip install ciphey -i https://pypi.mirrors.ustc.edu.cn/simple/
windows编码错误修改
UnicodeDecodeError: 'gbk' codec can't decode byte 0xbf
根据错误修改代码,主要是在读取文件的时候发生错误,将"r" 改为"rb",即可。
Ciphey 使用演示
出题脚本
#coding:utf-8
import random
import base64
import string
import hashlib
def flag2():
a = string.printable
flag = ""
for i in range(10):
flag += a[random.randint(0, 99)]
flag = r"flag{%s}"%(hashlib.md5(flag.encode()).hexdigest())
return flag
flag=flag2().encode()
def b32(m2):
return base64.b32encode(m2)
def b64(m3):
return base64.b64encode(m3)
b=random.randint(10,20)
for i in range(b):
a=random.choice('ab')
if a=='a':
flag=b64(flag)
if a=='b':
flag=b32(flag)
with open("1.txt","wb") as f:
f.write(flag)
解码方式
ciphey -t "aGVsbG8gbXkgbmFtZSBpcyBiZWU="
ciphey -f 文件名
我遇到的问题
- 运行中存在卡死,需要关闭终端后在运行
测试
1.可以解混合的base64 base32 base85 的编码
2.可以解有单词含义的16进制,没有意义的解不了
3.可以有单词含义的凯撒密码
pycharm测试图片