
python
xuqi7
这个作者很懒,什么都没留下…
展开
-
python---pefile
pefile可以解析、读取或修改PE文件。 github地址: https://github.com/erocarrera/pefile/ 一些示例地址: https://github.com/erocarrera/pefile/blob/wiki/UsageExamples.md 安装: `pip3 install pefile`原创 2022-10-01 08:13:36 · 1556 阅读 · 0 评论 -
python---struct
keywords: struct bytes python 数据互转 二进制数据和各种类型数据的转换原创 2022-08-21 08:41:39 · 321 阅读 · 0 评论 -
python---re
python的re模块简单使用re.findall,re.compile,re.match和re.search原创 2022-07-30 09:48:01 · 170 阅读 · 0 评论 -
保留NULL的异或
保留NULL的异或,规则如下: 1. 如果明文中字符是NULL(值为0的字节)或者密钥本身,则被跳过2. 如果明文中字符既不是NULL也不是密码本身,则将被使用XOR密钥加密可以稍微增加一点识别和恢复的难度。原创 2021-08-22 11:28:59 · 206 阅读 · 0 评论 -
steg---lsb---二维码
把一个二维码图片或者任意一张图片隐藏到另一张图片中。原创 2021-08-22 11:26:26 · 652 阅读 · 0 评论 -
steg---lsb
least significant bit, 最低有效位 这里说的lsb隐写就是把字符串按位放在一张图片的红、绿、蓝图层的最低位。用stegsolve可以看到。 这里用python实现一下lsb隐写。原创 2021-08-22 11:24:17 · 375 阅读 · 0 评论 -
python---str.format
python---str.format,字符串格式化举例原创 2021-07-24 11:11:00 · 191 阅读 · 0 评论 -
python---magic识别文件类型
magic是一个识别文件类型的python模块 原项目地址: https://github.com/ahupp/python-magic 这个项目整合了一下windows的需要的库,直接用这个吧: https://github.com/julian-r/python-magic原创 2021-02-28 10:22:17 · 795 阅读 · 1 评论 -
pip安装mysql-python出错
安装mysql-python,fatal error: my_config.h原创 2020-12-19 10:59:19 · 346 阅读 · 1 评论 -
01背包问题
01背包问题原创 2017-05-18 17:43:40 · 10848 阅读 · 17 评论 -
python---socket自动化交互
socket 的自动化交互假设服务端运行程序为:# coding:utf8# python3import randomimport socketimport sys# 创建 socket 对象serversocket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)port = 9999# 绑定端口号serversocket.bind(('', port))# 设置最大连接数,超过后排队serversocket.lis原创 2020-09-23 22:18:20 · 279 阅读 · 0 评论 -
python---命令行程序的自动化交互
keywords: python 命令行程序 自动化 交互以这个python程序为例:# coding:utf8# python3import randomfirst_num = str(random.randint(0, 10))second_num = str(random.randint(0, 10))first_input = input('input {}: '.format(first_num))second_input = input('input {}: '.forma原创 2020-09-23 22:17:12 · 1408 阅读 · 0 评论 -
python---dict和单引号字符串互转
# coding:utf8import astaa = { "a": "hello", 'b': 'world'}print(aa)# dict 转单引号字符串bb = str(aa)print(bb)# 单引号字符串转dictcc = ast.literal_eval(bb)print(cc)如果想转双引号字符串,用json模块,json只允许双引号...原创 2020-09-23 22:08:48 · 1660 阅读 · 0 评论 -
python2---argparse
官方文档: https://docs.python.org/2.7/library/argparse.html把看官方文档觉得对我有用的记录一下官方示例-取最大值或求和import argparseparser = argparse.ArgumentParser(description='Process some integers.')parser.add_argument('inte...原创 2019-12-28 20:12:08 · 750 阅读 · 0 评论 -
virtualenv---简单使用
virtualenv是创建孤立的Python环境的工具安装: pip install virtualenv创建环境: virtualenv vir # 这样会创建一个vir文件夹指定Python版本创建环境:(前提已经安装python3) virtualenv -p /usr/bin/python3 virpy3进入文件夹开启虚拟环境: source bi原创 2018-01-08 23:46:05 · 1253 阅读 · 0 评论 -
python--PIL操作像素例子
Pillow是PIL的延续,后者已经很久不维护了,PIL是Python Imaging Library 官网: https://python-pillow.org/ 官方文档: https://pillow.readthedocs.io/en/stable 安装: `pip install Pillow`原创 2017-05-15 18:43:14 · 5196 阅读 · 0 评论 -
pwntools 简单用法
官方一个示例remote.py """Example showing how to use the remote class."""from pwn import * # 也可以直接 import pwnsock = remote('127.0.0.1', 9001) # 连接远程服务print sock.recvline() # ...原创 2017-05-07 21:42:42 · 3282 阅读 · 3 评论 -
培根密码加解密
0x00 介绍培根密码实际上就是一种替换密码,根据所给表一一对应转换即可加密解密 它的特殊之处在于:可以通过不明显的特征来隐藏密码信息,比如大小写、正斜体等,只要两个不同的属性,密码即可隐藏 0x01 代码实现脚本很简单,就是建立对应关系,对密文,或者明文进行相应的替换即可 需要注意的是输入的都应该是全小写字母或全大写字母,在脚本里也有说明 python脚本如下:#...原创 2016-08-20 14:25:30 · 27210 阅读 · 0 评论 -
python--素数 最大公约数
python 判断素数 求最大公约数转载 2017-05-19 23:00:55 · 1042 阅读 · 0 评论 -
栅栏密码--Python解密脚本
栅栏密码 Python脚本转载 2017-05-19 23:31:04 · 6904 阅读 · 0 评论 -
python---requests
一些关于requests的使用,基本上把官方说明文档的简单用法搬了过来原创 2017-05-23 08:46:17 · 641 阅读 · 0 评论 -
RSA--低加密指数广播攻击例子
RSA—低加密指数广播攻击例子如果选取的加密指数较小,并且使用了相同的加密指数给一群接收者发送相同的信息,那么可以进行广播攻击得到明文原创 2017-07-20 21:41:37 · 11529 阅读 · 3 评论 -
python---快速排序
python 快速排序转载 2017-09-26 15:53:14 · 509 阅读 · 0 评论 -
python---引用其他py文件中的函数
有两种的实现方法,__init__.py和sys.path.append()原创 2017-12-09 10:31:22 · 40228 阅读 · 5 评论 -
现代密码学 实验
学了一门课 ,叫《现代密码学》,做实验要实现AES加密文件,RSA加密AES秘钥,然后再反向解密出来原创 2015-12-21 21:39:42 · 4031 阅读 · 0 评论 -
Python 二进制串转字符串例子
Python 二进制串转字符串例子0x01 问题 我现在有一串 0和1组成的字符串,就像这样的 110011011011001100001110011111110111010111011000010101110101010110011011101011101110110111011110011111101 我把它叫做二进制串,我怎么能把它转成我能看懂的字符串呢?0x02 思路 一个asc原创 2017-05-03 15:59:24 · 8879 阅读 · 0 评论