emin_int11

problematic-solution-crypto

Apr 10th, 2016
182
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.78 KB | None | 0 0
  1. void expand(u8 out[32], const u8 in[32], u32 x, u32 y)
  2. {
  3. for (u32 i = 0; i < 32; ++i)
  4. {
  5. out[i] = (in[i] - x) ^ y;
  6.  
  7. x = ROL(x, 1);
  8. y = ROL(y, 1);
  9. }
  10. }
  11.  
  12.  
  13. x = symbolic value
  14. y = symbolic value
  15.  
  16. Algo:
  17.  
  18. First, try to solve the problem by hand a bit to develop a feel of the difficulty of the problem. For any single byte pair of plaintext and ciphertext (pi, ci) it’s quite easy to find 8 bits within the key so that the mapping is correct. In fact, you can choose ANY byte in EBX to subtract, since you can adjust the difference via the xor by the corresponding byte in EDX.
  19. The value of the key for each byte mapping is completely open ended (256 possibilities). But actually choosing a value for the key for that mapping propagates a constraint across the possibilities of the other parts of the key. And this is the beauty of the algorithm.
  20.  
  21.  
  22. Conditional statement - ~(P β†’ Q) = ~( ~ P V Q) = P Ξ› ~Q
  23.  
  24. E.g FFFF:
  25.  
  26.  
  27. \begin{array}{lr}
  28. & (\sin(x)^3 = \cos(\log(y)\cdot x) \vee b \vee -x^2 \geq 2.3y) \wedge \left(\neg b \vee y < -34.4 \vee \exp(x) > {y \over x}\right)
  29. \end{array}
  30. where
  31. b \in {\mathbb B}, x,y \in {\mathbb R}
  32. OR
  33. https://upload.wikimedia.org/math/3/2/6/326141c4149d5f41a2f281cc388370ec.png
  34. where
  35. https://upload.wikimedia.org/math/7/7/8/7782c0a89922c157cf16f3b34eae56b9.png
  36.  
  37. Get qabaga gel dala :F
  38. sym1 = x
  39. sym2 = y
  40.  
  41. shl edx, 0xF ; EDX=sym1 << 0xf
  42. add edx, 0b10001 ; EDX=((sym1 << 0xf) + 17)
  43. not edx ; EDX ~= (sym1 << 0xf) + 17)
  44. and edx, 0xfffffff ; EDX= ~((sym1 << 0xf) + 17) & 0xfffffff)
  45. sub eax,0x2 ; EAX = sym2 - 0x2
  46. xor eax, edx ; EAX=(sym2 - 0x2) ^ ~((sym1 << 0xf) + 17) & 0xfffffff)
  47.  
  48. we are to use z3 to try find specific value.
  49.  
  50. solve(((sym2 - 0x2) ^ ~(((sym1 << 0xf) + 17) & 0xfffffff)) == 0x3b17f78)
Add Comment
Please, Sign In to add comment