pycrypto

How do I get around the “ No module named 'Crypto' ” error after doing “pip install pycrypto”?

前提是你 提交于 2020-08-23 09:49:11
问题 Basically, I'm trying to bring Chemobot into one of my own chatrooms, and its creator has suggested me that I should run the .py script on my own machine. I've barely started programming in python and my first interest as of now is to run that file. I'm using: Windows command prompt (cmd) to run Python 3.6 (I'm uneasy about this, he run the code with 2.7) Windows 8.1 Notepad++ to edit files Visual C++ 2015 Build Tools which I was prompted to install from here. Errors I'm getting: However when

20183215 实验三《Python程序设计》实验报告

╄→гoц情女王★ 提交于 2020-08-16 14:24:04
20183215 2019-2020-2 《Python程序设计》实验三报告 课程:《Python程序设计》 班级: 1832 姓名: 董振龙 学号: 20183215 实验教师:王志强 实验日期:2020年5月16日 必修/选修:公选课 1.实验内容 1.创建服务端和客户端,选择一个通信端口,用Python语言编程实现通信演示程序; 2.要求包含文件的基本操作,例如打开和读写操作。 3.要求发送方从文件读取内容,加密后并传输;接收方收到密文并解密,保存在文件中。 4.程序代码托管到码云。 2. 实验过程及结果 实验开始之前,我设想了一下实验结束后的效果,总觉得光秃秃的控制台缺乏美感(尽管是pycharm),于是,我打算加入GUI图形界面,既然追求美感,就贯彻到底咯。 首先,我打开了一个软件: wxFormBuilder (这里我参考了一个 大佬的博客 ),打开后的界面是这样的: 我们先选择Forms点击Frame,然后再建立几个boxsizer,加入一些必备控件textctrl、button,如图,其中,设置bsizer5的proportion为9,使其看上去更加和谐 最后进行一些细节上的设置,例如按钮名称以及事件绑定。最终效果如图: 其中三个按钮分别绑定事件: 保存之后可以导出对应的 .py文件 ,基本重复上述操作,可以得到客户端的图形界面和对应的 .py文件

First 8 byes of my encrypted data corrupting using 3DES and CBC

拥有回忆 提交于 2020-06-27 08:42:28
问题 I'm using PyCrypto in an application to encrypt data, but for some reason the first 8 bytes (corresponding to the first block) are coming through corrupt no matter what I do. >>> from Crypto.Cipher import DES3 >>> from Crypto import Random >>> iv = Random.new().read(DES3.block_size) >>> key = Random.new().read(DES3.key_size[-1]) >>> des3 = DES3.new(key, DES3.MODE_CBC, iv) >>> des3.decrypt(des3.encrypt('12345678abcdefgh12345678')) 't\x1b\x0f\xcbD\x15M\xababcdefgh12345678' I've read that that's

from Crypto.Cipher import AES ModuleNotFoundError: No module named 'Crypto'. How to run my Checksum.py file?

一个人想着一个人 提交于 2020-06-23 13:47:10
问题 First I tried pip install pycryptodome and the it says following error from Crypto.Cipher import AES ModuleNotFoundError: No module named 'Crypto' 回答1: Check the section why-do-i-get-the-error-no-module-named-crypto-on-windows on the pycryptodome documentation page. I hit the same issue when I first installed the incorrect module crypto instead of pycryptodome. In this case, follow this to correct the imports: pip uninstall crypto pip uninstall pycryptodome pip install pycryptodome 来源: https:

from Crypto.Cipher import AES ModuleNotFoundError: No module named 'Crypto'. How to run my Checksum.py file?

旧城冷巷雨未停 提交于 2020-06-23 13:46:07
问题 First I tried pip install pycryptodome and the it says following error from Crypto.Cipher import AES ModuleNotFoundError: No module named 'Crypto' 回答1: Check the section why-do-i-get-the-error-no-module-named-crypto-on-windows on the pycryptodome documentation page. I hit the same issue when I first installed the incorrect module crypto instead of pycryptodome. In this case, follow this to correct the imports: pip uninstall crypto pip uninstall pycryptodome pip install pycryptodome 来源: https:

Error installing PyCrypto on Mac 10.9.5

。_饼干妹妹 提交于 2020-05-15 18:04:12
问题 i'm trying to install PyCrypto for Python 3.4 but i'm having problem with the C compiled programs. it says that "error: cannot run C compiled program". anyone have an idea how to fix it?? code: running build running build_py running build_ext running build_configure checking for gcc... gcc checking whether the C compiler works... yes checking for C compiler default output file name... a.out checking for suffix of executables... checking whether we are cross compiling... configure: error: in `

IV must be 16 bytes long error in AES encryption

半世苍凉 提交于 2020-04-29 14:34:27
问题 I am using pycrypto module for AES encryption. And using documentation I have write down the below function but it al;ways gives error IV must be 16 bytes long but I am using 16 byte long IV. def aes_encrypt(plaintext): """ """ key = **my key comes here** iv = binascii.hexlify(os.urandom(16)) # even used without binascii.hexlify) aes_mode = AES.MODE_CBC obj = AES.new(key, aes_mode, iv) ciphertext = obj.encrypt(plaintext) return ciphertext 回答1: Use this: from Crypto.Cipher import AES import

IV must be 16 bytes long error in AES encryption

筅森魡賤 提交于 2020-04-29 14:33:22
问题 I am using pycrypto module for AES encryption. And using documentation I have write down the below function but it al;ways gives error IV must be 16 bytes long but I am using 16 byte long IV. def aes_encrypt(plaintext): """ """ key = **my key comes here** iv = binascii.hexlify(os.urandom(16)) # even used without binascii.hexlify) aes_mode = AES.MODE_CBC obj = AES.new(key, aes_mode, iv) ciphertext = obj.encrypt(plaintext) return ciphertext 回答1: Use this: from Crypto.Cipher import AES import

AES中ECB模式的加密与解密(Python3.7)

牧云@^-^@ 提交于 2020-04-25 01:43:03
本文主要解决的问题 本文主要是讲解AES加密算法中的ECB模式的加密解密的Python3.7实现。具体AES加密算法的原理这里不做过多介绍,想了解的可以参考文末的参考链接。 主要解决了两个问题: 在Python3.7版本下,所依赖包的安装问题 。(有一些博客时间久远,其中所提到的模块并不适用于Python3.7) 因为Python版本的问题,其他博客在基于Python3.6下的代码在Python3.7下并不能运行的问题 。 背景介绍 在爬虫项目中遇到,某些网站的账号、密码采用了AES的ECB模式进行了加密。 # 加密前的数据 123456asd # 加密后的数据 3cfeba82c31b6635e8fb085e04529e74 # 密钥 8NONwyJtHesysWpM 使用 在线AES加密解密、AES在线加密解密 ,进行尝试。 经过测试发现,在 AES 加密的 ECB模式 ,填充为 pkcs7padding ,数据块为 128位 ,输出格式为 hex 时,得到自己想要的结果。 (这里可以可以根据密文的格式进行判断输出的格式, 一般密文以==结尾的输出格式为base64 ,否则为hex格式) 问题1:Crypto模块安装报错 pip 安装 pycrypto模块,抛如下错误: error: command 'C:\\Program Files (x86)\\Microsoft