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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T23:36:47+00:00 2026-05-29T23:36:47+00:00

I am using SHA-512 to hash my passwords and store them in mysql database.

  • 0

I am using SHA-512 to hash my passwords and store them in mysql database. Is there any requirement that the input to the sha-512 should not contain any special character?
Because the passwords ‘Qwerty123.1’ and ‘Qwerty123.’ are being treated the same, but ‘Qwerty.11’ is not the same as the above. What is the problem?

The code that I am using is:

BASE64Decoder decoder=new BASE64Decoder();
byte[] b=decoder.decodeBuffer(r1);            //r1 is the string containing password

MessageDigest md=MessageDigest.getInstance("SHA-512");
md.update(b);
byte[] plaintext=md.digest();
BASE64Encoder encoder=new BASE64Encoder();
String digest1=encoder.encode(plaintext);   //digest1 contains the msg digest
  • 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-05-29T23:36:50+00:00Added an answer on May 29, 2026 at 11:36 pm

    Is r1 a valid base64 encoded string? It seems to me you’re getting the same result because you’re trying to decode something which is not a valid Base64 array, and BASE64Decoder is somehow failing silently. Have you tried something like:

    byte[] b = r1.getBytes("UTF-8");
    MessageDigest md=MessageDigest.getInstance("SHA-512");
    md.update(b);
    byte[] plaintext=md.digest();
    BASE64Encoder encoder=new BASE64Encoder();
    String digest1=encoder.encode(plaintext);   //digest1 contains the msg digest
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using SHA-512 to hash my passwords (with a salt ofcourse). I don't think
I have a pascal code that encrypts files using RIJNDAEL / sha 512 and
I plan to hash passwords on my server using SHA512 before inserting them into
Using ASP.NET MVC there are situations (such as form submission) that may require a
Using TortoiseSVN against VisualSVN I delete a source file that I should not have
All, I am using the following PHP function to salt & hash user passwords
when I hash my password using hash('sha512', $salt . $password); , should the maximum
I'm using this code to hash passwords: hash_hmac('sha512', $password . $salt, $hmac_key); Is 4096
In the Free Pascal libraries there's a hash library that enables use of MD5
I'm trying to compute hmac using sha-512. The Perl code: use Digest::SHA qw(hmac_sha512_hex); $key

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.