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

  • Home
  • SEARCH
  • 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 3938920
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T00:14:23+00:00 2026-05-20T00:14:23+00:00

I need to decrypt some data that has been 3des encoded on system running

  • 0

I need to decrypt some data that has been 3des encoded on system running mono (C#)

I need to use openssl and decrypt on the iPhone.

I found an example which looks like this, and it runs without error on the iphone when I have openssl etc installed, but generates the wrong result for my test case which I’ve verified on the encoding system. The initialisation vector is correct, but what should I set the key schedule to since the only information I have is the input?

   DES_cblock ivec[] = {0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0};   
   DES_key_schedule  ks1, ks2, ks3; 

   // What (and how) should I set ks1/2/3 to?

   DES_ede3_cbc_encrypt(input,output, 24*8, &ks1, &ks2, &ks3,ivec, DES_DECRYPT);

The decoding on the mono system is done with the following code;

   TripleDESCryptoServiceProvider m_des = new TripleDESCryptoServiceProvider();

   byte[] IV ={0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0};
   m_des.KeySize = 24*8;

   MemoryStream memStream = new MemoryStream();
   CryptoStream cryptStream = new CryptoStream(memStream,m_des.CreateDecryptor(key, IV), CryptoStreamMode.Write);

   cryptStream.Write(input, 0, input.Length);
   cryptStream.FlushFinalBlock();

As far as I can tell, the key schedule isn’t being specified, so I don’t know what to set it to? I guess it gets derived from the key … penny starting to drop … but how?

Any ideas? (ideally from people with openssl expertise, use of this library is a pre-requisite for the project)

  • 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-20T00:14:24+00:00Added an answer on May 20, 2026 at 12:14 am

    Starting with the typedef for a DES_cblock:

    typedef unsigned char DES_cblock[8];
    

    Fill in you own code for the comments and use something like:

    DES_key_schedule ks1, ks2, ks3;
    DES_cblock key_8bytes;
    
    /* ... copy the first 64 bits of the 192 bits into key_8bytes....*/
    DES_set_key_unchecked(&key_8bytes, &ks1);
    
    /* ... copy the second 64 bits of the 192 bits into key_8bytes....*/
    DES_set_key_unchecked(&key_8bytes, &ks2);
    
    /* ... copy the final 64 bits of the 192 bits into key_8bytes....*/
    DES_set_key_unchecked(&key_8bytes, &ks3);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using DPAPI in C++ to encrypt some data that I need to store
need ask you about some help. I have web app running in Net 2.0.
I need to encrypt and decrypt a querystring in ASP.NET. The querystring might look
Need a function that takes a character as a parameter and returns true if
Need to an expression that returns only things with an I followed by either
Need a function like: function isGoogleURL(url) { ... } that returns true iff URL
I need to know about Epoll On linux System. Could you recommend manual or
I need medium to strong encryption on serverside, so I thought I would use
We have a situation in our product where for a long time some data
I need to develop an application which stores data in a SQL Server 2005

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.