Compression function which takes 64-bit msg and 32-bit IV and outputs 32-bit digest.

Posted on 2006-05-24
Last Modified: 2010-04-01
Any hints on writing a function like so:
Compression function which takes 64-bit msg and 32-bit IV and outputs 32-bit digest.
Any help is majorly appreciated!

Question by:edifer1984
    LVL 53

    Expert Comment

    What does IV stand for ?

    Does the hash function need to be secure (as MD5, SHA  eg.) ? Or is it just gonna be used for a simple table lookup eg. ?

    Does the 64bit message have a specific format ? Anything you can tell us about that ? Any recurring parts ?

    These questions are quite important to propose the best hashing algorithm for you.
    LVL 86

    Expert Comment

    Do you want to compress data or do you want to create a digest?

    Author Comment

    Apologies, IV = initial vector.
    The hash function is MD5. 64-bit message is split into 8 blocks which are 8-bits long each. Two rounds where each round has 8 iterations. The 32-bit chaining variables are bytes.
    What can you proprose?

    Aim is to get a compression function.
    LVL 84

    Accepted Solution

    If you want the function to be reversible, you can't do it, unless there are no more than 2^32 different 64-bit messages that could be compressed.
    If you just want a hash, there are many you could choose from, includingMD5
    LVL 53

    Assisted Solution

    >> Aim is to get a compression function.
    You mean to use the hash to check whether de-compression was ok ... or that the hash itself is the compressed content ? In the last case, then ozo's comment shows the problem with this.

    In the first case - when it's just needed to check for errors - a simple CRC might be enough (look up CRC32 eg.).
    LVL 53

    Expert Comment

    We're still waiting for edifer1984 to respond to our last comments. If you're reading this, can you let us know whether you need further assistance ?

    Featured Post

    Highfive Gives IT Their Time Back

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    Join & Write a Comment

    Suggested Solutions

    Written by John Humphreys C++ Threading and the POSIX Library This article will cover the basic information that you need to know in order to make use of the POSIX threading library available for C and C++ on UNIX and most Linux systems.   [s…
    IntroductionThis article is the second in a three part article series on the Visual Studio 2008 Debugger.  It provides tips in setting and using breakpoints. If not familiar with this debugger, you can find a basic introduction in the EE article loc…
    The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…
    The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.

    731 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

    15 Experts available now in Live!

    Get 1:1 Help Now