First+Hash+Page

I am all excited to be able to get creative in mathematics. Here we are, learning about hash functions while playing with candidates for hash functions. **1.** Top priority: allow yourself the luxury of thinking of some weird way for a message to mix with itself and create an output of fixed size without much collision. If you come up with something vaguely interesting, let us all see it. How cool would it be to find a new species of hash function? When you look at Skein, you should think, "That's it? Mix and permute a bunch of times?"

**Four more.** The first four problems at the end of Chapter 8 (Ooops, I wrote 9, and you tried them, a Chapter ahead of ourselves.) are doable, even for us rookies. So give them a try. 1. If someone discovers k in ElGamal... s ≡ k^-1 (m-ar) (mod p-1) sk ≡ m-ar (mod p-1) ar ≡ m-sk (mod p-1) there are [gcd(r,p-1)] possibilities for a, so if gcd is small, we can get a list of possible a's. To check, calculate α^a mod p until you get β. user:bea001

3. When p=11, q=5, α=3, k=3 (α^k (mod p))(mod q) ≠ (α^k (mod q))(mod p) (3^3 mod 11)(mod 5) ≠ (3^3 mod 5)(mod 11) 5 (mod 5) ≠ 2 (mod 11) Order of operations does matter. 4a. s ≡ a^(-1)(m-kr) (mod p-1) sa ≡ m-kr (mod p-1) m ≡ sa+kr (mod p-1) α^m ≡ α^(sa+kr) ≡ (α^a)^s*(α^k)^r ≡ (α^a)^s*(r^r) (mod p) since α^k ≡ r b. s ≡ am + kr (mod p-1) α^s ≡ α^(ma+kr) ≡ (α^a)^m*(α^k)^r ≡ (α^a)^m*(r^r) (mod p) since α^k ≡ r c. s ≡ ar+km (mod p-1) α^s ≡ α^(ra+km) ≡ (α^a)^r*(α^k)^m ≡ (α^a)^r*(r^m) (mod p) since α^k ≡ r user:meganternes

In class, we began an investigation of a candidate for hash function based on a braid. I'm reproducing our work here. I will also put my TI code here. If the baby version holds up, we can make a bigger one in Maple. The structure is, add the key, then follow the strands of the braid downward. On an overpass, we do concatenation with the character string on the overpass written first. The underpass is addition mod 2. The last step is to break the last line of 8 digits into two strings of 4 and xor them. The braid: **6.** So, 1101 + 1011 = 0110. In my notes, we supposedly got 1000 in class for the same key and message. Obviously, we need some experience with this method. A. Is it strong collision-free? Weak? B. Is it linear? C. Is there a way to simplify the steps? D. For a braid which simplifies, do the simplifications in the braid change the output? My intuition says no.

We left off with the page 233 investigation, looking for messages which have the same hash value. I propose simply doing the sixteen cases out. Please take on a few yourself. EVERYBODY USE THE KEY 1011. We can keep a table here.

I didn't get numbers that fit McDaniel's graph below. Anyone is free to check them, as I did them twice and if I've got an error I'm not finding it now. I get the feeling the hash cycles, or has some pattern, but it's just a guess right now. user:ian.hart I do see that you have two 1101's there (fixed). I get 1101 to be 0110, which is different than both of yours. I get 0000->1000, 1110->1100, and 1111->1000 for the rest of your greens. user:kml003 Just noticed... the braid we are doing on here is different than the one we did in class, and I was using the class one to fill in the table. The difference is in the first level, in class it was an opposite crossing (/ over \). Which should we use? user:bea001 The hash in the table is from the braid we used in class. (Using the above braid gives hashes 1000, 0011, 1101, and 1011 respectively.) user:meganternes
 * Input || 0000 || 0001 || 0011 || 0101 || 0111 || 0010 || 0100 || 0110 || 1000 || 1001 || 1100 || 1010 || 1100 || 1101 || 1110 || 1111 ||
 * Hash || 1111 || 1101 || 0011 || 0101 || 1011 || 0110 || 0000 || 1110 || 1011 || 1110 || 0011 || 0101 || 1110 || 1011 || 1000 || 0101 ||

I'm not getting numbers to match the table either. My hash for 1100 matches our class example, so I did that part right. What am I missing? user:kml003

My TI-84 code so far: Prompt W,X,Y,Z (these are the key digits) Prompt A,B,C,D (these are the message digits) A xor W -> A B xor X -> B C xor Y -> C D xor Z -> D A xor B -> E 10*A + B -> F F + C -> G 100*C+F -> H 10*H+E -> A H + E -> B 10*G +D ->E G+D -> F Disp A Disp B,F Disp E I have to look at last digits of some displays. I am not sure this thing can keep track of leading zeroes because the calculator treats the numbers as numbers, not bits. So, the program might be complete garbage. The braid idea might be complete garbage. But isn't it fun to not know how it all turns out?

I did my program a little differently, because I didn't get a correct answer with yours. I kept it this the same: Prompt W,X,Y,Z (these are the key digits) Prompt A,B,C,D (these are the message digits) A xor W -> A B xor X -> B  C xor Y -> C  D xor Z -> D  A xor B -> E  10*A + B -> F  but then changed a few things: 100*C+F->G C xor B->H 10*G+E->I E xor B->J H xor D->K 10*H+D->L Disp I Disp J,K,L and then you just have to xor the results (This is for the braid on the wiki, not the one in class) user:bea001 Examining the result of the braid let me simplify and make a much easier program, in binary only. I prompt for A,B,C,D as the braid input because the key addition is mindless. 1000*C+100*A+10*B=(A xor B) -> K (And i have to remember K is SUpposed to be 4 digits, since it won't show any leading zeroes) A -> L (I noticed the xors simplified) (B xor C xor D) -> M (B xor C)*10+D -> N  (And I have to remember N is supposed to be 2 digit.) I display K, L, M, N, make the appropriate leading zero corrections and then add K with the other 4 digit number by hand. It isn't perfect. But it seems to work.user:mcdaniel30

I have to check with a computer. But I did a bunch of calculations yesterday. The directed graph below sums up the braid hash outcomes. If an edge connects two vertices, the arrow on that edge indicates the way hash: input is tail, output is head. Those two loops mean that 0000 and 1101 hash to themselves. (Can we say they self-hash?) The blue is a separate component from the rest. The two shades of purple are one component. If this structure is true, we see some collision, but not a lot - a very hoperful sign. We also do not have a simple pattern, a sign that the idea may indeed turn out to be strong collision free. The phrase for such a diagram/process is "dynamical system." Our braid hash is actually an application of a dynamical system.

Further questions: What is an algorithm for this braid hash? Can we use the algorithm to solve for self-hashing? How much different is our system when we use digits in octal or hextal? I know we'd get 16^4=65536 entries on the circle in hextal. Would we get "parallel" copies of the pattern above?

I have some Maple to tweak. Maple treats strings of symbols as strings and you have to convert them to numbers. Or, rather, I have to convert them to numbers. Then this should work. Just writing the code shows how weakly this braid mixes stuff. I use cat(c,a,b) three times.