Solved

Simple cryptographic hash function

Posted on 2004-10-20
3
483 Views
Last Modified: 2010-04-17
I am aware of the theory and purpose of cryptographic hashes like MD5, SHA, etc.
I also am interested in using a simple crypto hash in a small project I am currently dreaming up.  I say simple because i want the code for this project to be *extremely* small.  Under 1k would be good, under 512 bytes is my true goal.

I need to take in 10-50 bytes of a seed and create a 4-10 byte hash that can, of course, be guaranteed the same each time with the same input, and maximizing unique outputs for unique inputs.

I realize that this is a difficult, if not impossible, task.  What I am looking for is resources describing some lower theory of crypto hashes, like how to program them from scratch, and possibly some examples of existing simple crypto hash algorithms.
0
Comment
Question by:arantius
3 Comments
 
LVL 7

Accepted Solution

by:
LRHGuy earned 333 total points
ID: 12366629
You might consider looking here:

http://sourceforge.net/projects/tplockbox/

TurboPower's lockbox is free, with source (Delphi) ... but more than that, it has multiple methods, and the documentation is excellent...you'll find lots of info about MD5, etc...in the documentation, even if you don't use delphi.
0
 
LVL 84

Expert Comment

by:ozo
ID: 12366738
What cryptographic propertys do you require of your hash function?
A 4 byte hash would be extremely weak against attack, and collisions could easily be found by exhaustive search.
http://en.wikipedia.org/wiki/Cryptographic_hash_function
0
 
LVL 18

Author Comment

by:arantius
ID: 12369846
In short, I'm trying to write my own version of this password bookmarklet, there's a few changes I'd like to incorporate: http://www.angel.net/~nic/passwdlet.html

That one uses full MD5 (AFAIK) but I don't think it's necessary for this particular project.  The hash does not have to be so cryptographically strong, though I'm quite leaning towards the 8+ byte end of the size.  I just want to make sure that whatever I choose it won't be too big and break a website.  It will also, though, likely be encoded into hex so the 4 bytes would become 8 wasted bytes in the end.  Haven't decided which characters exactly I'd include.
The point of the project is minimization of risk should the password you use for a website be found/leaked.  Collisions are no problem.  There is not, necessarily, even the knowledge that you used this generator should the password become public.

With the further looking I've done since my first post, I am probably going to end up largely giving up on trying to keep it small enough to fit into IE's 508 byte limit.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I know it’s not a new topic to discuss and it has lots of online contents already available over the net. But Then I thought it would be useful to this site’s visitors and can have online repository on vim most commonly used commands. This post h…
Displaying an arrayList in a listView using the default adapter is rarely the best solution. To get full control of your display data, and to be able to refresh it after editing, requires the use of a custom adapter.
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …

863 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now