#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2012
    Posts
    37
    Rep Power
    3

    General Question about has algorithms


    Hello everyone,
    I am having some serious trouble with the two questions below. I have a final exam coming up tomorrow and I know these two problems will be on there. I have been searching for explanations online with no success. Can anyone please help me understand these two problems?

    1) A message is made of 100 characters. A hash algorithm creates a digest out of this message by choosing characters 1, 11, 21, 31, 41, 51, 61, 71, 81 and 91. The resulting digest has 10 characters. Does this algorithm meet the first criterion of a hash algorithm? Does it meet the second criterion? Does it meet the third criterion?


    2) What are all the possible number combinations of inputs in a 6-by-2 S-box? What is the possible number of outputs?


    thank you
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    May 2007
    Posts
    765
    Rep Power
    928
    First off, we don't do people's homework here. Second, how much help you get is usually dependent on how much effort you show. Posting what you've done so far your problem, where you got stuck, what you understand & where you lose it, etc., go a long way to A: show us what information would be most helpful to you and B: convince us to bother. Anyways, I'm charitable (or maybe just procrastinating) tonight so,

    For (1), presumably your text book describes three criteria that an algorithm must satisfy to be a used as a hash. Reading that section would be a good start.

    For (2), do you know what an S-box is? Given an S-Box and an input value can you produce the output value? What does the x in x-by-y S-box stand for?

    If I write out a 3x2 S-box,
    Code:
      | 00 | 01 | 10 | 11 |
    --+----+----+----+----+
    0 | 11 | 10 | 01 | 00 |
    --+----+----+----+----+
    1 | 01 | 11 | 00 | 10 |
    --+----+----+----+----+
    Can you tell what the range of the input values is? Or for that matter, can you count the output values?


    Incidentally, you may want to spend some time re-evaluating how you search for information on-line. The first (or second depending on search engine) link when you search for "S-Box" is Wikipedia's S-Box article which answers question (2) in the third sentence.
    sub{*{$::{$_}}{CODE}==$_[0]&& print for(%:: )}->(\&Meh);

IMN logo majestic logo threadwatch logo seochat tools logo