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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T17:15:26+00:00 2026-05-28T17:15:26+00:00

I have a file encrypted with java application using AES. I also have a

  • 0

I have a file encrypted with java application using AES. I also have a key file was encrypted with. But i can’t understand how to use the key to decrypt file. Most tutorials and examples create temporary random key, encrypt file and decrypt it in one place.
So, question is how to specify a key which have to be used for decryption?

EDIT:
Samples i found use following code to generate key. I have no idea where i can use my key here.

KeyGenerator kgen = KeyGenerator.getInstance("AES");
kgen.init(128);
SecretKey key = kgen.generateKey();
  • 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-28T17:15:27+00:00Added an answer on May 28, 2026 at 5:15 pm

    Just to summarise my comments to Lucifer’s answer.

    1. If you don’t know what padding was used to encrypt, then decrypt with ‘no padding’ set. That will decrypt everything, including the padding, and won’t throw an error because of mismatched padding.

    2. When you have decrypted the cyphertext, have a look at the last block of the output and see what padding was used. Different paddings leave different byte patterns, so it is usually easy enough to tell.

    3. Set your decryption method to expect the correct type of padding, and it will be automatically removed for you.

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

Sidebar

Related Questions

I've have a .txt file containing an NSString (encrypted using a private key) that
I have to encrypt/decrypt some sensitive information in a Xml file? Yes I can
i am trying to decrypt a PGP encrypted file. I would like to use
I have a file encrypted using the following code in c: unsigned char ckey[]
i have created table using Sqlite3.and also inserted record in that table.its running successfully.but
I have a PKCS#5 encrypted PKCS#8 RSA private key stored in a disk file
I have been tasked with decrypting a file in Java that has been encrypted
Let's say I have an encrypted file on an iPhone and every time I
I have a pgp-encrypted file that I need to extract data from at runtime.
In my applications web.config file I have a connection string stored. I encrypted it

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.