Python解密过程及代码是什么
Admin 2022-08-23 群英技术资讯 824 次浏览
这篇文章给大家分享的是“Python解密过程及代码是什么”,对大家学习和理解有一定的参考价值和帮助,有这方面学习需要的朋友,接下来就跟随小编一起学习一下吧。以下是使用Python解密加密文件的示例代码;
#!/usr/bin/python # ---------------- READ ME --------------------------------------------- # This Script is Created Only For Practise And Educational Purpose Only # This Script Is Created For http://bitforestinfo.blogspot.in # This Script is Written By # # ################################################## ######## Please Don't Remove Author Name ######### ############### Thanks ########################### ################################################## # # # =================Other Configuration================ # Usages : usage = "usage: %prog [options] " # Version Version="%prog 0.0.1" # ==================================================== # Import Modules import optparse, sys,os from toolkit import processor as ps def main(): parser = optparse.OptionParser(usage = usage,version = Version) parser.add_option( '-i','--input',type = 'string',dest = 'inputfile', help = "File Input Path For Encryption", default = None) parser.add_option( '-o','--output',type = "string",dest = 'outputfile', help = "File Output Path For Saving Encrypter Cipher",default = ".") parser.add_option( '-p','--password',type = "string",dest = 'password', help = "Provide Password For Encrypting File",default = None) (options, args) = parser.parse_args() # Input Conditions Checkings if not options.inputfile or not os.path.isfile(options.inputfile): print " [Error] Please Specify Input File Path" exit(0) if not options.outputfile or not os.path.isdir(options.outputfile): print " [Error] Please Specify Output Path" exit(0) if not options.password: print " [Error] No exit(0) inputfile = options.inputfile outputfile = options.outputfile password = options.password work = "D" ps.FileCipher(inputfile,outputfile,password,work) return if __name__ == '__main__': main()
您可以使用以下命令执行上述代码 :
python pyfilecipher-decrypt.py -i encrypted_file_path -p password
执行上面显示的命令时,您可以观察以下代码 :

注意 : 输出指定加密前和解密后的哈希值,它记录了同一文件已加密并且过程成功.
免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:mmqy2019@163.com进行举报,并提供相关证据,查实之后,将立刻删除涉嫌侵权内容。
猜你喜欢
这篇文章主要介绍了Python基础之矩阵输入的实例,具有很好的参考价值,希望对大家有所帮助。如有错误或未考虑完全的地方,望不吝赐教
本文主要介绍了TensorFlow训练网络两种方式,一种是基于tensor(array),另外一种是迭代器,文中通过示例代码介绍的非常详细,具有一定的参考价值,感兴趣的小伙伴们可以参考一下
这篇文章主要介绍了python出现RuntimeError错误问题及解决方案,具有很好的参考价值,希望对大家有所帮助。如有错误或未考虑完全的地方,望不吝赐教
本篇文章给大家带来了关于Python的相关知识,其中主要介绍了关于实现定时任务的相关问题,可以使用第三方包来管理定时任务,相对来说apscheduler使用起来更简单,下面一起来看一下使用的方法,希望对大家有帮助。
这里给大家分享的是实现二终端网络可靠度的方法以及使用Python实现的代码,有需要的小伙伴可以参考下。
成为群英会员,开启智能安全云计算之旅
立即注册关注或联系群英网络
7x24小时售前:400-678-4567
7x24小时售后:0668-2555666
24小时QQ客服
群英微信公众号
CNNIC域名投诉举报处理平台
服务电话:010-58813000
服务邮箱:service@cnnic.cn
投诉与建议:0668-2555555
Copyright © QY Network Company Ltd. All Rights Reserved. 2003-2020 群英 版权所有
增值电信经营许可证 : B1.B2-20140078 粤ICP备09006778号 域名注册商资质 粤 D3.1-20240008