title: Java equivalent of C++ encryption
body: <p>I have this following snippet from c++ code that is used for encryption:</p>
  
  <pre><code>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-&gt;get_value("crypto_seed", &amp;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&lt;unsigned char *&gt;(const_cast&lt;char *&gt;(seed.chars())), seed.length(),
          1, // hash passphrase just once.
          key, iv);
  
  EVP_CIPHER_CTX_init(&amp;ctx);
  EVP_CipherInit_ex(&amp;ctx, cipher, (ENGINE *) 0, key,
          iv,
          1); // encrypt
  </code></pre>
  
  <p>what s the equivalent of the c++ encryption in java? </p>
  
  <p>I see there is <code>des</code> algorithm, then i see <code>sha1</code>. </p>
  
  <p>This is related to openssl encryption. But not sure what is the equivalent. essentially i would like the same output as c++ code generates.</p>
  
  <p>i m asking the what s the equivalent of <code>EVP_CIPHER_CTX</code> or what s the name of the encrytion being used here so i can take it from there. </p>
  
  <p><strong>EDIT: not asking anyone to convert the code to java, just asking the corresponding package or class that would do the same.</strong> </p>