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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T18:44:56+00:00 2026-05-30T18:44:56+00:00

I encrypted a file in android using triple des. This file is uploaded to

  • 0

I encrypted a file in android using triple des. This file is uploaded to the server using php. Have to write php script to decrypt the same file.

New to php, any help would be appreciated with php scripts.

public void encrypt(InputStream in, OutputStream out) throws Exception {
    final SecretKey key = new SecretKeySpec(keyBytes, "DESede");
    final IvParameterSpec param = new IvParameterSpec(iv);
    final Cipher cipher = Cipher.getInstance("DESede/CBC/PKCS5Padding");
    cipher.init(Cipher.ENCRYPT_MODE, key, param);

    // Read in the cleartext bytes and write to out to encrypt
    int numRead = 0;
    while ((numRead = in.read(buf)) >= 0) {
        byte[] output = cipher.doFinal(buf, 0, numRead);
        if(output != null) {
            byte[] enc = Base64.encode(output, 0);
            out.write(enc);
        }   
    }
    out.close();
}

I’m passing hard coded values for keyBytes and iv which are hexadecimal values.

  • 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-30T18:44:58+00:00Added an answer on May 30, 2026 at 6:44 pm

    So, it seems like you are going to have to use the mcrypt extension. The mcrypt extension supports TRIPLEDES.

    Installation

    List of ciphers supported by mcrypt.

    Here are some mcrypt examples.

    The mcrypt function to decrypt is here.

    I’m currently learning android and advanced php. If you are new to php, I highly recommend going to php.net for everything. It’s been very helpful for me.

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

Sidebar

Related Questions

I would like to decrypt a file that I previously encrypted with C# using
I have been unsuccesfully attempting to upload an encrypted file to an FTP server,
I am using the SQLCipher Library for Android to Encrypt/Decrypt the DB file. I
I'm trying to decrypt a DES-encrypted file from an external source with a known
I have a pgp-encrypted file that I need to extract data from at runtime.
Let's say I have an encrypted file on an iPhone and every time I
I've encrypted the connectionstring in my web.config file using the steps in the link
In my applications web.config file I have a connection string stored. I encrypted it
I encryptd a file using gpg , now I want to decrypt the file.
I am trying to add special handling to emacs to handle Triple-DES encrypted files

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.