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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T03:51:43+00:00 2026-06-15T03:51:43+00:00

I have a 48 character AES-192 encryption key which I’m using to decrypt an

  • 0

I have a 48 character AES-192 encryption key which I’m using to decrypt an encrypted database.

However, it tells me the key length is invalid, so I logged the results of getBytes().

When I execute:

final String string = "346a23652a46392b4d73257c67317e352e3372482177652c";
final byte[] utf32Bytes = string.getBytes("UTF-32");
System.out.println(utf32Bytes.length);

Using BlueJ on my mac (Java Virtual Machine), I get 192 as the output.

However, when I use:

Log.d(C.TAG, "Key Length: " + String.valueOf("346a23652a46392b4d73257c67317e352e3372482177652c".getBytes("UTF-32").length));

I get 196 as the output.

Does anybody know why this is happening, and where Dalvik is getting an additional 4 bytes from?

  • 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-15T03:51:44+00:00Added an answer on June 15, 2026 at 3:51 am

    You should specify endianess on both machines

    final byte[] utf32Bytes = string.getBytes("UTF-32BE");
    

    Note that "UTF-32BE" is a different encoding, not special .getBytes parameter. It has fixed endianess and doesn’t need BOM. More info: http://www.unicode.org/faq/utf_bom.html#gen6

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

Sidebar

Related Questions

I have a char* string that I have encoded using AES encryption. This string
I am using Bouncy Castle crypto libraries. I have a 13 character key something
i have a character controller which jumps but while jumping i want to change
I'm using Java Property files and would like to have a newline character put
In my project i am working on AES encryption and Decryption.i have used this
I have this code for AES encryption, can some one verify that this code
I want to use AES encryption in my application. I have come across some
I have a String (stringToEncrypt) , it is encrypted by AES-128 and got a
I am new to AES encryption but trying to build a solution which: Accepts
I have a character array and I'm trying to figure out if it matches

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.