Solved

Simple cryptographic hash function

Posted on 2004-10-20
3
481 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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

RIA (Rich Internet Application) tools are interactive internet applications which have many of the characteristics of desktop applications. The RIA tools typically deliver output either by the way of a site-specific browser or via browser plug-in. T…
Although it can be difficult to imagine, someday your child will have a career of his or her own. He or she will likely start a family, buy a home and start having their own children. So, while being a kid is still extremely important, it’s also …
An introduction to basic programming syntax in Java by creating a simple program. Viewers can follow the tutorial as they create their first class in Java. Definitions and explanations about each element are given to help prepare viewers for future …
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 …

746 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

16 Experts available now in Live!

Get 1:1 Help Now