Questions tagged [message-digest]
124 questions
4
votes
3 answers
Hashing image bytes with SHA-256 yields many random collisions, what am I doing wrong?
I'm using the SHA-256 algorithm to detect identical images in a database. Because we use a lot of different image formats I don't want to compute the hash directly on the file. Instead I want to extract the pixel data and compute the hash on that.…
![](../../users/profiles/1200876.webp)
Tyler Bettilyon
- 63
- 6
4
votes
1 answer
Java MD5 hashing not matching C# MD5 hashing
I know very little about encryption/hashing.
I have to hash an encryption key. The example in Java is like this...
String encryptionKey = "test";
MessageDigest messageDigest = MessageDigest.getInstance("MD5");
…
![](../../users/profiles/751096.webp)
Theo
- 2,531
- 1
- 24
- 26
3
votes
1 answer
Something like a message digest but that progressively describes a file
I have a set of geographically remote nodes with heterogeneous operating systems which need to transfer files and updates around using a Java program I am writing. At present I need to send the entire file again if the file changes. Is there a way…
![](../../users/profiles/513992.webp)
feldoh
- 650
- 2
- 6
- 17
3
votes
2 answers
AWS SQS, How to calculate the MD5 message digest for message attributes
I'm currently trying to figure out how to calculate the MD5 message digest for message attributes in AWS.
I'm following the uri SQS message metadata > Calculating the MD5 message digest for message attributes
Although this seems straight forward I'm…
![](../../users/profiles/3226786.webp)
Samyne
- 187
- 10
3
votes
1 answer
Java equivalent for PHP's pack function
I have a sample application which generates a SHA1 hash in PHP as follows.
base64_encode(pack('H*', sha1($pass)));
I tried to achieve the same in Java, but so far, the output is different. The approach I used is as follows (Base64 and Hex classes…
![](../../users/profiles/279320.webp)
Yohan Liyanage
- 6,282
- 2
- 42
- 62
3
votes
3 answers
protocol to use password hashing with salt
I am trying to understand what information are needed to be sent in a web application . Basically I have a web app running on a web server , a database which has a user table with hashed password and salt , and of course the web client with…
![](../../users/profiles/670800.webp)
user670800
- 1,067
- 1
- 11
- 16
3
votes
3 answers
Update checksum (MD5, SHA1) when append files java
Is it possible to update the checksum (MD5, SHA1) when we have Hash value when we append file.
I have file A already uploaded to server and i already have MD5 file which contain MD5 hash value.
I want to append a new Data block (byte[]) to the file…
![](../../users/profiles/6220776.webp)
TuanNN
- 85
- 9
3
votes
1 answer
Generating an MD5 Hash with a char[]
How would one go about converting a char[] password obtained using this method:
char[] password = passwordInputField.getPassword();
To an MD5 Hash? Normally I would use the method below, but getBytes is only compatible with Strings:
MessageDigest…
![](../../users/profiles/2240931.webp)
Hrach Ghapantsyan
- 699
- 4
- 20
3
votes
2 answers
How to calculate message digests in custom output stream?
I would like to implement an OutputStream that can produce MessageDigests. Likewise, I already have an InputStream implementation of it here, which works fine and extends FilterInputStream.
The problem is this: if I'm extending FilterOutputStream,…
![](../../users/profiles/774183.webp)
carlspring
- 27,224
- 23
- 101
- 178
2
votes
1 answer
Is there a way to shorten a java.security.MessageDigest generated value?
If I generate a message digest (for a security feature in my app) using this Java code:
java.security.MessageDigest saltDigest = MessageDigest.getInstance("SHA-256");
saltDigest.update(UUID.randomUUID().toString().getBytes("UTF-8"));
String digest =…
![](../../users/profiles/963743.webp)
arezzo
- 2,825
- 2
- 13
- 14
2
votes
2 answers
Get sha1 message digest from plaintext+private key in delphi
I want to create a Sha1 message digest, and it should use my private key as input along with the plain text.
Everything I have found so far either dont use a private key or just take a lot of certificates as input.
![](../../users/profiles/317644.webp)
Mattias Sandsäter
- 81
- 3
2
votes
1 answer
Java byte array comparison of MessageDigest SHA1 result and original hash value?
I would like to compare two byte arrays. One is calculated from plaintext with MessageDigest SHA1, the other is the hex itself in byte array, without calculation.
MessageDigest returns 20 byte long result, String.getBytes() returns 40 byte long…
![](../../users/profiles/1424766.webp)
Gábor DANI
- 1,659
- 2
- 14
- 38
2
votes
2 answers
Collision Attacks, Message Digests and a Possible solution
I've been doing some preliminary research in the area of message digests. Specifically collision attacks of cryptographic hash functions such as MD5 and SHA-1, such as the Postscript example and X.509 certificate duplicate.
From what I can tell in…
Matthieu N.
2
votes
0 answers
MessageDigest implementation of MurmurHash2
I want to use the MurmurHash2 algorithm (32bit) for download verification in a Java application. There exist various implementations on GitHub, but I want to use a MessageDigest implementation, as I am interested in how to "translate" a hashing…
user6945931
2
votes
1 answer
MessageDigest.digest() returning same hash for different strings having Norwegian character
I am calling MessageDigest.digest() method to get the hash of the password.
If the password contains a Norwegian character e.g. 'ø', this method returns same hash for different strings with different last character.
"Høstname1" and "Høstname2" have…
![](../../users/profiles/3197920.webp)
namang029
- 23
- 3