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 8694331
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T00:45:43+00:00 2026-06-13T00:45:43+00:00

I have this following snippet from c++ code that is used for encryption: EVP_CIPHER_CTX

  • 0

I have this following snippet from c++ code that is used for encryption:

EVP_CIPHER_CTX ctx;
const EVP_CIPHER * cipher = EVP_des_ede3_cbc();
unsigned char iv[EVP_MAX_IV_LENGTH];
unsigned char key[EVP_MAX_KEY_LENGTH];
String seed;

_config->get_value("crypto_seed", &seed); // uses the seed value from pimp config.

if (seed.is_empty())
{
    return false;
}

EVP_BytesToKey(cipher, EVP_sha1(),
        (unsigned char *) 0, // no salt
        reinterpret_cast<unsigned char *>(const_cast<char *>(seed.chars())), seed.length(),
        1, // hash passphrase just once.
        key, iv);

EVP_CIPHER_CTX_init(&ctx);
EVP_CipherInit_ex(&ctx, cipher, (ENGINE *) 0, key,
        iv,
        1); // encrypt

what s the equivalent of the c++ encryption in java?

I see there is des algorithm, then i see sha1.

This is related to openssl encryption. But not sure what is the equivalent. essentially i would like the same output as c++ code generates.

i m asking the what s the equivalent of EVP_CIPHER_CTX or what s the name of the encrytion being used here so i can take it from there.

EDIT: not asking anyone to convert the code to java, just asking the corresponding package or class that would do the same.

  • 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-06-13T00:45:45+00:00Added an answer on June 13, 2026 at 12:45 am

    The code you are converting from uses the openssl library. It carries out a triple-DES encryption using an Initial Vector. The first thing you need to understand is exactly what it’s doing (and preferably why).

    Unfortunately the openssl documentation isn’t terribly thorough (see here) … though the O’Reilley book Network Security with OpenSSL is quite a bit better (it’s a bit out of date, though).

    Once you know what needs to be done, you shouldn’t have much difficulty coding it in Java using the standard javax.crypto package.

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

Sidebar

Related Questions

From this site: http://www.toymaker.info/Games/html/vertex_shaders.html We have the following code snippet: // transformations provided by
I have the following code snippet from my PowerShell script that... Loops through a
Never thought I'd have this problem :) The following snippet of code works in
I have the following code snippet: using (SPSite site = new SPSite(this.ListAddress)) { using
I have the following snippet of code (as an example) that looks up a
I have the following source snippet from a book that I'm reading now. So
I have the following snippet of JS var Customer : function() { this.ShipProduct :
Can you guys help me figure this out? I have the following JavaScript snippet:
I have this following jquery text fly-in animation.Here is my code before I explain
I have the following scenario: a Bitmap that is used as background and another

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.