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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T05:34:03+00:00 2026-06-17T05:34:03+00:00

I have the following code to encrypt a password, but when I am trying

  • 0

I have the following code to encrypt a password, but when I am trying to decode it, I don’t get the expected result here is the code.

BASE64Encoder encoder = new BASE64Encoder();
String afterhex=toSHA1("mypassword".getBytes());
String encodedBytes = encoder.encodeBuffer(afterhex.getBytes());

public static String toSHA1(byte[] convertme) {
    MessageDigest md = null;
    try {
        md = MessageDigest.getInstance("SHA-1");
    } catch (NoSuchAlgorithmException e) {
        e.printStackTrace();
    }
    return new String(md.digest(convertme));
}

For example if you tried to encode, jill you should get LQBIF2TS0FSDYtGjaNmC2gl/klw=

Any advice for restoring it back 🙂

  • 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-17T05:34:04+00:00Added an answer on June 17, 2026 at 5:34 am

    Hashing algorithm is not encryption / decryption algorithm.

    Hashing is a one way process of mapping large data sets of variable length (e.g. message), to smaller data sets of a fixed length (hash). The length depends on hashing algorithm.

    And it is NOT POSSIBLE to perform reverse operation from hash back to your message.

    Even though it is possible to find a message generating the same hash (for example using rainbow tables; much easier for weaker hashing algorithms like MD5), you never know if the message is identical to the original one which was used to generate the hash. One of the methods which prevents finding (guessing) a message (password) generating the same hash value is using salt when hashing a massage (password).

    EDIT

    I would also recommend any of Bruce Schneier books e.g. “Cryptography Engineering: Design Principles and Practical Applications” (written in a very nice and digestible way) which will describe cryptography and hashing in great details.

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

Sidebar

Related Questions

I have following code written to run NSTimer . But the NSTimer selector is
I have the following code to encrypt a value (listed below). Now I would
I have the following test code to encrypt and decrypt a string. It works
I have the following code to encrypt/decrypt data in node.js, which is working: var
I have the following c# code that generates keys: public static byte[] Encrypt(byte[] plainData,
I have following code in initialization im = imread('Image02.tif'); figure(); imagesc(im); colormap(gray); [hImage hfig
I have following code <div id=main> <div id=one> </div> <div id=two> </div> <div id=three>
I have following code for updating user's column public void UpdateLastModifiedDate(string username) { using
I have following code for loading image from url in xml parsing endElement method
I have following code for inserting data into database using PDO. It inserts data

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.