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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T23:30:25+00:00 2026-06-07T23:30:25+00:00

In an android project I am using import javax.crypto.Cipher; ecipher = Cipher.getInstance(AES/CBC/PKCS5Padding); I would

  • 0

In an android project I am using

import javax.crypto.Cipher;

ecipher = Cipher.getInstance("AES/CBC/PKCS5Padding"); 

I would like to ask: Whether AES128 or AES256 is used, is defined by the key that is used? For example key="012345678901234567890123456789012"; would have as a result AES256 to be used?

thanks
Thomas

  • 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-07T23:30:28+00:00Added an answer on June 7, 2026 at 11:30 pm

    Yes whether AES128 or AES256 is used is defined by the key that is in use.

    However it’s not the String length but the byte[] length that determines it. At some point in your code you should be converting String to byte[]. The size of resulting that byte[] is your key size. Without knowing how you convert "012345678901234567890123456789012", it’s not possible to know your encryption strength.

    Alternatively you can use KeyGenerator:

        KeyGenerator keyGen = KeyGenerator.getInstance("AES");
        keyGen.init(128); // or 256
    
        // Generate the secret key specs
        SecretKey secretKey = keyGen.generateKey();
        byte[] byteArray = secretKey.getEncoded();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I made an android project using eclipse. It looks like: src/ ActivityMain.java lib/ Square.java
We all can import an existing Android project into workspace using File->Import->Existing projects into
I am trying to build my android project using ant in command line mode.
I am working on an Android project using C++ for the main development and
I am trying to create an android project using eclipse IDE,its created successfully but
I am doing NDK profiling for my project using android-ndk-profiler-3.1. I have made changes
I'm using ActionBarSherlock in my Android project, and it's awesome. One small issue: My
i 'm doing a project using webview in android. i can't visit url: http://www.baidu.org
I'm using the stackmob API in an android project and it seems that the
I am currently working on android project where I am using a custom list

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.