?
Solved

Simple cryptographic hash function

Posted on 2004-10-20
3
Medium Priority
?
497 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 7

Accepted Solution

by:
LRHGuy earned 999 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

Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

Question has a verified solution.

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

Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
Whether you’re a college noob or a soon-to-be pro, these tips are sure to help you in your journey to becoming a programming ninja and stand out from the crowd.
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…
Introduction to Processes

765 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