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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T15:15:52+00:00 2026-06-15T15:15:52+00:00

I’m using Apache DS with Spring LDAP for authentication and user management. Apache DS

  • 0

I’m using Apache DS with Spring LDAP for authentication and user management. Apache DS sends password fields as hashed byte arrays, so I need to decrypt it into String. I’m using MD5 hashing.

For example, here’s the window that is used to enter password using Apache DS Studio:

(For the sake of demonstration, I’d like to tell the entered password which is 1)

enter image description here

Apache DS sends password fields as hashed byte arrays. When I try to get it using Spring LDAP like below, I got [B@66ca6254. I need to decrypt it and got the hex value of it which is c4ca4238a0b923820dcc509a6f75849b as it is shown above.

  • 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-15T15:15:53+00:00Added an answer on June 15, 2026 at 3:15 pm

    You’ve got two problems here:

    • You’re using the term “decrypt” as if you were actually able to recover the original password. That’s not the case. Hopefully you understand this already, and you’re just using the term “decrypt” inappropriately
    • You’re calling toString() on a byte array. That’s what’s giving the value “[B@66ca6254” which is an indication that the object you’re calling it on is a byte array, then a hash. What you’re actually interested in is a hex representation of the byte array.

    Basically you just need to convert the byte array to a hex string. There are various ways of doing that – either in your own code, or using a third party library such as Apache Commons Code and its Hex class. If you don’t want to include an extra library, there are loads of code snippets for byte array to hex string conversion on Stack Overflow, such as here. (There’s also javax.xml.bind.DataTypeConverter, but I personally wouldn’t want to use that for general conversion – it smells too much like an XML-specific type to me. I dare say it would work fine, it just gives the wrong impression in code.)

    EDIT: Now that you’ve told us the bytes that you’re getting, you don’t just want to use hex. You’ve been given the ASCII encoded form of "{MD5}xMpCOKC5I4INzFCab3WEmw==", which itself shows that it’s MD5 and then has the base64-encoded version. You should therefore:

    • Convert the byte array to a string using new String(data, "ASCII")
    • Check that the string starts with "{MD5}"
    • Decode the rest of the string as base64 (i.e. strip the first 5 characters, then run the rest through base64 decoding). Again, you can use Apache Commons Codec for this, or this public domain base64 decoder (or many other solutions).
    • At that point, you’ve got the real raw binary data of the hash. You can then convert that to hex if you want, as discussed earlier.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have thousands of HTML files to process using Groovy/Java and I need to
I need to clean up various Word 'smart' characters in user input, including but
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
That's pretty much it. I'm using Nokogiri to scrape a web page what has
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I am using the SimpleRSS gem to parse a WordPress RSS feed. The only
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
In my XML file chapters tag has more chapter tag.i need to display chapters
We're building an app, our first using Rails 3, and we're having to build
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this

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.