473,436 Members | 1,483 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,436 software developers and data experts.

MD5, SHA1 (can hash size be adjusted)

Hi,

Is it possible to adjust the hash size of the algorithm used. I would like
to get a hash size less than 160 bit.

Regards
Nov 17 '05 #1
3 2359
Jesper <Je****@discussions.microsoft.com> wrote:
Is it possible to adjust the hash size of the algorithm used. I would like
to get a hash size less than 160 bit.


I believe the MD5 algorithm is specifically defined to be 128-bit, and
and SHA-1 is defined to produce a 160-bit hash, rather than being
defined for an arbitrary hash size.

In other words, no. Of course, you could always ignore half the hash...
a well-behaved cryptographically-strong hash should be equally pseudo-
random in all bits, so by taking only part of it you should just get a
weaker version in terms of the probability of hash collisions.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Nov 17 '05 #2
You can use MGF1 which uses SHA1 underneath. MGF1 can produce a hash of any
size.
sEE IEEE Std 1363-2000 [26] and the draft ANSI X9.44 [1].

--
Philip Painter, HP
"Jesper" wrote:
Hi,

Is it possible to adjust the hash size of the algorithm used. I would like
to get a hash size less than 160 bit.

Regards

Nov 17 '05 #3
You can use MGF1 which uses SHA1 underneath. MGF1 can produce a hash of any
size.
sEE IEEE Std 1363-2000 [26] and the draft ANSI X9.44 [1].

--
Philip Painter, HP
"Jesper" wrote:
Hi,

Is it possible to adjust the hash size of the algorithm used. I would like
to get a hash size less than 160 bit.

Regards

Nov 17 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Randell D. | last post by:
Folks, I use md5 hash with some of my cookies and occassionally a hidden form field - I know the physical data on my network is insecure (unless being served via https) but I was wondering if...
6
by: Chang | last post by:
How to get SHA1 or MD5 of a big file (+5MB - 20GB) as I can't read 20GB into memory. -- Chang.
5
by: Michael H | last post by:
Hi all, I guess I don't fully understand how a SHA1 hash value is calculated in C# / .NET for a large file... I'm trying to calculate SHA1 values for large files that are much larger than my...
0
by: Dil via .NET 247 | last post by:
Fresher to .NET Aiming to produce a resulting hash of length 24 CHARACTERS, using MD5 or SHA1 Algorithms. According to the Class Libraries, the hash size for the SHA1 algorithm is 160 bits, and...
4
by: gkoreman | last post by:
I am trying to implement SHA1 based on the pseudo-code on Wikipedia. The pseudo-code is on: http://en.wikipedia.org/wiki/SHA-1 My code is working, but is not giving me the correct hashes. This...
8
by: Adam Carpenter | last post by:
Hello, I have my users passwords stored to my DB hashs created using SHA1CryptoServiceProvider, here is the function: Public Shared Function EncryptPassword(ByVal password As String) As Byte()...
2
by: Marcus | last post by:
Hello, I have read several online tutorials advocating storing a sha1() hashed password in a column of type BLOB. As far as I can tell, sha1() always returns a string of 40 characters,...
8
by: sathyashrayan | last post by:
Dear group, For a log-in page I have created a mysql db and user registers with a user name and password. The password field is encrypted with $passwd = sha1($_REQUEST); I insert the...
6
by: LaundroMat | last post by:
Hi - I'm trying to calculate unique hash values for binary files, independent of their location and filename, and I was wondering whether I'm going in the right direction. Basically, the hash...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.