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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T06:29:18+00:00 2026-06-13T06:29:18+00:00

I creating MD5 this way: public void encrypeUsername(String sessionid) { byte[] defaultBytes = sessionid.getBytes();

  • 0

I creating MD5 this way:

public void encrypeUsername(String sessionid)
    {
        byte[] defaultBytes = sessionid.getBytes();
        try
        {
            MessageDigest algorithm = MessageDigest.getInstance("MD5");
            algorithm.reset();
            algorithm.update(defaultBytes);
            byte messageDigest[] = algorithm.digest();

            StringBuffer hexString = new StringBuffer();
            for (int i = 0; i < messageDigest.length; i++)
            {
                hexString.append(Integer.toHexString(0xFF & messageDigest[i]));
            }
            System.out.println("sessionid " + sessionid + " md5 version is " + hexString.toString());
        }
        catch (Exception e)
        {
            e.printStackTrace();
        }



    }

for input 123456 we get MD5: e1adc3949ba59abbe56e057f2f883e

I want to create another method to authenticate the result.

For example if i give an input of e1adc3949ba59abbe56e057f2f883e and “123456” then I get as result: true/false.

Any idea how to achieve this?

thanks,
ray.

  • 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-13T06:29:19+00:00Added an answer on June 13, 2026 at 6:29 am
    String pass = "123456";
    String secret = "e1adc3949ba59abbe56e057f2f883e";
    if encrypeUsername(pass).equals(secret) System.out.printl("ok!")
    

    Remember that md5 is one-way. It is hard* to get the password from the secret back again.

    (*)Not so hard nowerdays for weak passwords.

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

Sidebar

Related Questions

I gather that this is creating an md5 hash, but confused about exactly what
(creating a separate question after comments on this: Javascript redeclared global variable overrides old
I'm creating a python script that logs into a website (in this case, it's
I'm creating a MySQL database with registered users, and I'm thinking to use md5
What's the best way to store, index, and lookup text strings (URLs in this
When creating new Rails app I get this error <internal:lib/rubygems/custom_require>:29:in `require': libcrypto.so.0.9.8: cannot open
so im creating this situation where a count down happens, when it counts down
I have a file that I am creating on the fly like this: //
Consider the following scenario (this is not production code): class MyClass { public function
I'm planning on creating a view using this SQL SELECT, but the explain for

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.