Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1027381
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T12:13:59+00:00 2026-05-16T12:13:59+00:00

I have a working test of a hardware device that uses RSA encryption, in

  • 0

I have a working test of a hardware device that uses RSA encryption, in Python using M2Crypto. Now I need to test a similar device that uses 3DES encryption. But I can’t figure out how to use M2Crypto to do triple DES encryption.

I know it should be possible from this chart. But unfortunately the documentation of M2Crypto I’ve found is sketchy. (The homepage at http://chandlerproject.org/ seems to be gone, along with Chandler.)

I’ve searched for 3DES and “OpenSSL API” and found some hard to grok C code for decrypting which makes it look like I need to use M2Crypto.EVP.Cipher. But I haven’t found any examples of using it for DES. The closest I’ve found is this blog post on using it for AES encryption. It looks like I just need to figure out the correct arguments to M2Crypto.EVP.Cipher.__init__(). I’ll keep digging, but I thought it worth posting this question.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T12:13:59+00:00Added an answer on May 16, 2026 at 12:13 pm

    The following code worked for me:

    with open(keyfile, 'rb') as f:
        key = f.read()
    encrypt = 1
    cipher = Cipher(alg='des_ede3_ecb', key=key, op=encrypt, iv='\0'*16)
    ciphertext = cipher.update(plaintext)
    ciphertext += cipher.final()
    

    Note the keyfile is a 24-byte (binary) file with parity set as sometimes required for DES.

    Note also that the iv argument is (I believe) ignored when using ‘des_ede3_ecb’, but I couldn’t pass None.)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have mocks working where I test that methods on my mocked object are
I have been working on some legacy C++ code that uses variable length structures
I have been working on a jquery plugin that uses a HTML5 audio player
I'm working on a little test application at the minute and I have multiple
I have been working with Visual Studio (WinForm and ASP.NET applications using mostly C#)
I have been working with a string[] array in C# that gets returned from
I have a working copy of my project, checked out using Subversion 1.5.1. When
I have a project I'm working on, where a piece of Hardware is producing
I have a working copy that I cannot check in due to a conflict.
I have been working on a web services related project for about the last

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.