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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T20:51:02+00:00 2026-06-06T20:51:02+00:00

I have to encrypt and decrypt a zip file using DES Algorithm by using

  • 0

I have to encrypt and decrypt a zip file using DES Algorithm by using a KEY which is stored in a text file.Both Encrypt and Decrypt algorithm takes key from the text file to do the corresponding functionalities.

Is there any built-in packages available for doing DES algorithm in java…

Please Guide me to get out of this issue…

  • 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-06T20:51:03+00:00Added an answer on June 6, 2026 at 8:51 pm

    you could use stuff from javax.crypto package:

            // read the key
        FileInputStream fis = new FileInputStream(keyFile);
        byte[] keyBytes = new byte[fis.available()];
        fis.read(keyBytes);
        SecretKeySpec spec = new SecretKeySpec(keyBytes, "DES");
    
        // encrypt
        Cipher encCipher = Cipher.getInstance("DES");
        encCipher.init(Cipher.ENCRYPT_MODE, spec);
    
        CipherInputStream cipherIn = new CipherInputStream(new FileInputStream(zipFile), encCipher);
        FileChannel out = new FileOutputStream(encZipFile).getChannel();
        out.transferFrom(Channels.newChannel(cipherIn), 0, Long.MAX_VALUE);
    
        // decrypt
        Cipher decCipher = Cipher.getInstance("DES");
        decCipher.init(Cipher.DECRYPT_MODE, spec);
    
        cipherIn = new CipherInputStream(new FileInputStream(encZipFile), decCipher);
        out = new FileOutputStream(decZipFile).getChannel();
        out.transferFrom(Channels.newChannel(cipherIn), 0, Long.MAX_VALUE);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have to encrypt/decrypt some sensitive information in a Xml file? Yes I can
I have a winform (in C#) that encrypt and decrypt a file... it's OK,
I am using ColdFusion to encrypt and decrypt. I have variable active with a
I have a text file containing strings to encrypt. These strings are indicated by
I have a two very simple methods to encrypt/decrypt a byte[] using the AesCryptoServiceProvider.
Hi All I have to encrypt my data using Blowfish algorithm in C++...can you
I have an enCrypt and deCrypt class which I want to use in my
I have a CryptoAPI code to encrypt\ decrypt given data using AES-128 and a
We have an ant build file that needs to encrypt/decrypt a bunch of files
I am making an app in which I have to encrypt the xml from

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.