Questions tagged [m2crypto]

M2Crypto is the most complete Python wrapper for OpenSSL featuring RSA, DSA, DH, HMACs, message digests, symmetric ciphers (including AES); SSL functionality to implement clients and servers; HTTPS extensions to Python's httplib, urllib, and xmlrpclib; unforgeable HMAC'ing AuthCookies for web session management; FTP/TLS client and server; S/MIME; ZServerSSL.

M2Crypto is the most complete Python wrapper for OpenSSL featuring RSA, DSA, DH, HMACs, message digests, symmetric ciphers (including AES); SSL functionality to implement clients and servers; HTTPS extensions to Python's httplib, urllib, and xmlrpclib; unforgeable HMAC'ing AuthCookies for web session management; FTP/TLS client and server; S/MIME; ZServerSSL.

271 questions
0
votes
2 answers

Unable to Install m2crypto

I am unable to install M2Crypto on OSX 10.11.1. I have swig and pcre already installed. Below is the trace from my installation. Please help !! $ pip install M2Crypto Collecting M2Crypto Using cached M2Crypto-0.22.5.tar.gz Installing collected…
Nitish Rai
  • 41
  • 6
0
votes
2 answers

M2Crypto: read PKCS#7 structure in DER format?

M2Crypto SMIME object has methods to load itself from PKCS#7 file in PEM format: smime_object = SMIME.load_pkcs7('file.pem') I do not see any method to load from PKCS#7 file in DER format. How can this be done?
Konstantin Shemyak
  • 2,369
  • 5
  • 21
  • 41
0
votes
1 answer

PKCS#7 signature verifies with OpenSSL, but not with M2Crypto

I have a signed PKCS#7 structure data-signed.pem: $ openssl smime -sign -binary -in data.txt -inkey key.pem -outform pem -out p7.pem -signer cert.pem It verifies successfully via OpenSSL command line: $ openssl smime -verify -CAfile cert.pem…
Konstantin Shemyak
  • 2,369
  • 5
  • 21
  • 41
0
votes
1 answer

Migrating RSA signature generation from m2crypto to pycrypto

I am hoping you can help me out with my migration to PyCrypto from M2Crypto. The content to encrypt is XML. I am loading the pk as follows: M2Crypto: sha = hashlib.sha1(xml) rsa_private_key = M2Crypto.RSA.load_key_string(PRIVATE_KEY) signature =…
0
votes
1 answer

SALT_LEN = m2.PKCS5_SALT_LEN AttributeError: 'module' object has no attribute 'PKCS5_SALT_LEN'

I installed M2Crypto as per this guide: https://github.com/dsoprea/M2CryptoWindows I run this command: C:\grr-build\M2Crypto-master>C:\Python27\python.exe setup.py install Then, I got this which confirms to me that the M2Crypto module has been…
user2192774
  • 3,807
  • 17
  • 47
  • 62
0
votes
0 answers

ImportError: DLL load failed: The operating system cannot run %1

I want to build M2Crypto for Windows x64 to be used in python 2.7 in Windows x64. I downloaded the library package named: "M2CryptoWin64-master" from: https://github.com/martinpaljak/M2Crypto Then, I followed these steps from enter link description…
user2192774
  • 3,807
  • 17
  • 47
  • 62
0
votes
1 answer

extracting public key from private key dynamically using M2Crypto

is it possible to extract public key from private key in pem format in python, with something like M2Crypto? I want to same thing happen like when you use this command: openssl rsa -in mykey.pem -pubout > mykey.pub
Armita
  • 345
  • 1
  • 12
0
votes
1 answer

M2Crypto error Unable to find vcvarsall.bat

I am a windows7 64-bit user working with Python 3.4. I installed M2Crypto library. I followed the steps mentioned in this link for installing M2Crypto on Windows: https://github.com/martinpaljak/M2Crypto/blob/master/INSTALL I have Microsot Visual…
user2192774
  • 3,807
  • 17
  • 47
  • 62
0
votes
2 answers

M2Crypto installation

I am struggling to get my M2Crypto installation to work C:\Python27>python Python 2.7.9 (default, Dec 10 2014, 12:24:55) [MSC v.1500 32 bit (Intel)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> from M2Crypto…
Niklas
  • 1
  • 1
  • 3
0
votes
2 answers

Unable to install M2Crypto package in Windows 8.1 64 bit machine

I am using Win8.1 64 bit machine with Python 2.7 installed. I have installed swigwin 3.0.5. When I do "pip install M2Crypto" I got the following errors: SWIG\_m2crypto.i(30) : Error: Unable to find 'openssl\opensslv.h' SWIG\_m2crypto.i(33) : Error:…
Ram
  • 25
  • 1
  • 4
0
votes
0 answers

Getting pub key and digital signature using M2Crypto

I used a GUI tool to make a X509 certificate and tried to use M2Crypto of Python to extract useful information from that cert, but came across issues. Code as below: ca=X509.load_cert("MyCA.crt", X509.FORMAT_PEM) print…
frogcd
  • 61
  • 1
  • 9
0
votes
0 answers

Segmentation fault when calling M2Crypto's X509.load_request_string in pypy env

Although in pypy compatibility list says the M2Crypto is supported, but I got segmentation fault after run less than 100 times in a loop. my code similar as below: TIMES = 1000 def main(): csr_b64 =…
Jim Horng
  • 1,587
  • 1
  • 13
  • 23
0
votes
2 answers

M2Crypto: Is PKey a reference to a Public or a Private key?

In the PKey class documentation of the M2Crypto python package (an OpenSSL wrapper for Python) it is said that PKey is a reference to a Public key. My opinion is instead that it's a reference to a Private Key because the init method of the PKey…
Andrea Zilio
  • 4,444
  • 3
  • 29
  • 34
0
votes
1 answer

Debugging Python SAML assertion validation

A similar question has been asked before, but no information was provided on ho to debug. If I am working with this code: from lxml import etree import base64 from M2Crypto import EVP, RSA, X509 decoded_assertion = base64.b64decode(assertion) root…
Tony D
  • 1
  • 2
0
votes
1 answer

Decrypt string using Python M2Crypto

I am trying to decrypt an email message in python using M2Crypto. The problem I have is the examples I find online all seem to read in a file. But in my code I have a string that contains the body of an email. So I am passing in the body of the…
TheBigOnion
  • 615
  • 3
  • 9
  • 19