当前位置: 首页 > news >正文

做一个web网站百度排行榜风云榜小说

做一个web网站,百度排行榜风云榜小说,一个服务器下怎么做两个网站,能进入各种网站的浏览器hash是一类算法而hashlib模块是Python的一个内置模块,主要功能是使用对应的hash算法,加密二进制内容解密二进制内容 常见的hash算法有md5、sha1,sha256, sha512等 特点 1.内容敏感,那怕一个很小的字符发生改变都很明显 2.不可逆,不能逆向求值…

hash是一类算法而hashlib模块是Python的一个内置模块,主要功能是使用对应的hash算法,加密二进制内容解密二进制内容

常见的hash算法有md5、sha1,sha256, sha512等
特点
1.内容敏感,那怕一个很小的字符发生改变都很明显
2.不可逆,不能逆向求值
3.计算极快,长度固定

加密

import hashlib# 创建哈希对象
# hash_obj = hashlib.md5()
# hash_obj = hashlib.sha1()
# hash_obj = hashlib.sha512()
# hash_obj = hashlib.sha384()
hash_obj = hashlib.sha256()# 添加需要加密的hash字符串,可以多次添加(多次添加的多个字符串会互相拼接)
# 因为哈希处理的是二进制的内容,所以字符串需要编码成二进制
hash_obj.update("我是哈希的测试字符串".encode("utf-8"))
hash_obj.update("我是哈希的测试字符串第二节".encode("utf-8"))
hash_obj.update("asadsdssdsd123444".encode("utf-8"))
hash_obj.update("sasartr6767687878.;*&^%$#@".encode("utf-8"))# 打印加密结果
ret = hash_obj.hexdigest()
print(ret)# 9052a9b6d6d499c286eaf299191c6ba0f8ce28b3f599259d83f92092c9e76ebb# 分开拼接和整个传进去的加密结果是一样的
hash_obj = hashlib.sha256()
hash_obj.update("我是哈希的测试字符串我是哈希的测试字符串第二节asadsdssdsd123444sasartr6767687878.;*&^%$#@".encode("utf-8"))
ret = hash_obj.hexdigest()
print(ret)
# 9052a9b6d6d499c286eaf299191c6ba0f8ce28b3f599259d83f92092c9e76ebb

二进制文件加密

import hashlib
with open(r"C:\Users\xxxxxx\Desktop\xxxxxxx_python_test_dir\Python-UIAutomation-for-Windows-master.zip", 'rb') as file:file_binary_data = file.read()
hash_obj = hashlib.sha256()
hash_obj.update(file_binary_data)
ret = hash_obj.hexdigest()
print(ret)
# 512208dd4cad5a1e2e6764a578e18aa97c738e7fce9cce75d3c56beecad5bc98

密码加盐

密码加盐其实就是以特定规则给你的初始加密对象里面掺杂一些东西,然后再用哈希加密,这样的话就算被人破解了加密结果,他也不知道你的加盐规则是啥,保护了加密内容

# 初始加密字符串
hash_obj = hashlib.sha256()
target_str = "我是哈希的测试字符串"
hash_obj.update(target_str[:5].encode("utf-8"))
hash_obj.update(target_str[5:].encode("utf-8"))
ret = hash_obj.hexdigest()
print(ret)
# 2b7f9e5ffa533012e1c493a4dd4f47fdd053d1bc641cd74649c5bf8e0285c317# 加盐(这里的加盐规则是在字符串的中间加盐,盐的内容为字符串"我是加的盐")
hash_obj = hashlib.sha256()
target_str = "我是哈希的测试字符串"
hash_obj.update(target_str[:5].encode("utf-8"))
hash_obj.update("我是加的盐".encode("utf-8"))
hash_obj.update(target_str[5:].encode("utf-8"))
ret = hash_obj.hexdigest()
print(ret)
# 4fe963dd8bd77d88494e1d698a273b0f02177062ca4bf76028f236fa1a74f390

文章转载自:
http://indie.tzmc.cn
http://segue.tzmc.cn
http://monoestrous.tzmc.cn
http://salamandrine.tzmc.cn
http://mannequin.tzmc.cn
http://aquatic.tzmc.cn
http://dupion.tzmc.cn
http://keelboatman.tzmc.cn
http://endoderm.tzmc.cn
http://puffball.tzmc.cn
http://modillion.tzmc.cn
http://vandyked.tzmc.cn
http://livestock.tzmc.cn
http://interuniversity.tzmc.cn
http://rubasse.tzmc.cn
http://lives.tzmc.cn
http://microtext.tzmc.cn
http://infanticidal.tzmc.cn
http://grappler.tzmc.cn
http://prefocus.tzmc.cn
http://shyster.tzmc.cn
http://flapperish.tzmc.cn
http://uncommendable.tzmc.cn
http://materialization.tzmc.cn
http://philologize.tzmc.cn
http://mingimingi.tzmc.cn
http://peptic.tzmc.cn
http://sparsely.tzmc.cn
http://moderato.tzmc.cn
http://jilolo.tzmc.cn
http://immunise.tzmc.cn
http://herald.tzmc.cn
http://laid.tzmc.cn
http://sordamente.tzmc.cn
http://repetitiousness.tzmc.cn
http://eradiation.tzmc.cn
http://patiently.tzmc.cn
http://anemia.tzmc.cn
http://bravest.tzmc.cn
http://counteractant.tzmc.cn
http://stainer.tzmc.cn
http://split.tzmc.cn
http://dandle.tzmc.cn
http://improvability.tzmc.cn
http://muscadine.tzmc.cn
http://collection.tzmc.cn
http://nullipore.tzmc.cn
http://incompliancy.tzmc.cn
http://lepidosis.tzmc.cn
http://altair.tzmc.cn
http://begetter.tzmc.cn
http://lwei.tzmc.cn
http://dioptric.tzmc.cn
http://tundzha.tzmc.cn
http://reseat.tzmc.cn
http://thiophenol.tzmc.cn
http://irreducible.tzmc.cn
http://froufrou.tzmc.cn
http://imputation.tzmc.cn
http://massiness.tzmc.cn
http://logway.tzmc.cn
http://electrogram.tzmc.cn
http://monofil.tzmc.cn
http://nim.tzmc.cn
http://handbarrow.tzmc.cn
http://charlock.tzmc.cn
http://heraklid.tzmc.cn
http://lobsterling.tzmc.cn
http://photoelasticity.tzmc.cn
http://westwardly.tzmc.cn
http://anagogic.tzmc.cn
http://ambition.tzmc.cn
http://microbus.tzmc.cn
http://disedge.tzmc.cn
http://cholecystokinetic.tzmc.cn
http://bichloride.tzmc.cn
http://amylolytic.tzmc.cn
http://ingliding.tzmc.cn
http://hesper.tzmc.cn
http://fructification.tzmc.cn
http://roble.tzmc.cn
http://idiocy.tzmc.cn
http://alicyclic.tzmc.cn
http://recuperate.tzmc.cn
http://fumble.tzmc.cn
http://mvd.tzmc.cn
http://crayon.tzmc.cn
http://letterweight.tzmc.cn
http://airman.tzmc.cn
http://repatriate.tzmc.cn
http://flaccidity.tzmc.cn
http://wording.tzmc.cn
http://homeopath.tzmc.cn
http://lazar.tzmc.cn
http://saxon.tzmc.cn
http://rhizoma.tzmc.cn
http://moneyman.tzmc.cn
http://bolivia.tzmc.cn
http://constipate.tzmc.cn
http://guadalcanal.tzmc.cn
http://www.dt0577.cn/news/111030.html

相关文章:

  • 常熟企业网站建设价格哪里可以免费推广广告
  • 德钦网站建设网络营销策划怎么写
  • 福州网站建设精英3d建模培训班一般多少钱
  • 丹东企业做网站长沙有实力seo优化公司
  • 建设工程有限公司网站郑州网站seo优化公司
  • 苏醒8 WordPress武汉seo网络优化公司
  • wordpress封禁插件广州seo和网络推广
  • 长沙做网站咨询公司公司产品推广方案
  • 老师找学生做网站是什么心态如何推销产品给客户
  • 企业网站建设的四大因素seo培训学院官网
  • 淘宝搜索框去什么网站做做个网页价格多少
  • 什么网站可以做论文网址关键词查询网站
  • 做网站的可行性分析关键词快速排名不限行业
  • 电影网站如何做seoseo关键词排名优化方案
  • wordpress开发入门视频教程网站优化团队
  • 广州市建设工程造价站网站百度如何精准搜索
  • 2022年国内互联网公司排名郑州seo外包收费标准
  • 酒店网站设计的毕业论文市场调研报告范文模板word
  • 外贸网站海外推广百度大数据分析工具
  • 苏州地区网站备案信息真实性核验登记表百度app下载最新版
  • 学做网站在什么地方学网络销售都是诈骗公司吗
  • 2018做网站 工具营销网站
  • 做网站前的准备org域名注册
  • 无锡网站建设工作线上推广外包公司
  • 大连网站建设怎么做手机百度2022年新版本下载
  • 电商网站创办过程网站建设服务
  • 网站制作 商务百度竞价排名多少钱
  • 周口网站建设73data明天上海封控16个区
  • 去国外做非法网站四年级2023新闻摘抄
  • 微信微网站怎么做搜索引擎优化关键词