diff --git a/content/from-0-to-crypto-by-projects/episode-2-proof-demonstration.md b/content/from-0-to-crypto-by-projects/episode-2-proof-demonstration.md index 0aef1ad..d5cabe6 100644 --- a/content/from-0-to-crypto-by-projects/episode-2-proof-demonstration.md +++ b/content/from-0-to-crypto-by-projects/episode-2-proof-demonstration.md @@ -25,11 +25,9 @@ The question is to proove that there exists a function $ rev(hashed) $ so that $ We intuitevely see points to split the issue into easier pieces: -- the algorithm threat data block by blocks with blocks of two opcodes (numbers between 0 and 256) knowns bigram. - -The algorith treat bigrams as following: - +The algorith treat bigrams (blocks of two opcodes) as following: - the two opcodes are both xored to the hardcoded password. +- diff --git a/static/from-0-to-crypto-by-projects/episode-2-proof-demonstration/latex-reverse-type7.pdf b/static/from-0-to-crypto-by-projects/episode-2-proof-demonstration/latex-reverse-type7.pdf index 133589c..1557566 100644 Binary files a/static/from-0-to-crypto-by-projects/episode-2-proof-demonstration/latex-reverse-type7.pdf and b/static/from-0-to-crypto-by-projects/episode-2-proof-demonstration/latex-reverse-type7.pdf differ diff --git a/static/from-0-to-crypto-by-projects/episode-2-proof-demonstration/latex-reverse-type7.tex b/static/from-0-to-crypto-by-projects/episode-2-proof-demonstration/latex-reverse-type7.tex index e7d49c3..ff4947a 100644 --- a/static/from-0-to-crypto-by-projects/episode-2-proof-demonstration/latex-reverse-type7.tex +++ b/static/from-0-to-crypto-by-projects/episode-2-proof-demonstration/latex-reverse-type7.tex @@ -103,17 +103,47 @@ \end{multline} $$ -## I/ exclusive or +## I/ substraction to reverse the addition -According to the [Karnaught table](https://fr.wikipedia.org/wiki/Table_de_v%C3%A9rit%C3%A9#Disjonction_exclusive), $ \forall x [(x \xor x) \implies (x = 0)] $. +$\forall x [(x = y + z) \implies (y = e \minus z)]$ then it follow that as the previous part of the function contains: $ h = x + 0x30 $, then $ h - 0x30 = x $ so $ \exists rev(h)[rev(H(p)) =p - 0x30] $ -Then as $ xlat \xor xlat = 0 $, and as $ p \xor 0 = p $, we know that the original password $p = xlat \xor h $. +## II/ exclusive or + +According to the Karnaught table at: https://fr.wikipedia.org/wiki/Table_de_v%C3%A9rit%C3%A9#Disjonction_exclusive, $ \forall x [(x \oplus x) \implies (x = 0)] $. +$$ +\\ +$$ +Then as $ xlat \oplus xlat = 0 $, and as $ p \oplus 0 = p $, we know that the original password $p = xlat \oplus h $. +$$ +\\ +\\ +$$ + +## III/ rotating 4 first to 4 last bits + +$ \forall x [(x \ggg y) \implies (x \lll y = x)] $. +$$ +\\ +$$ +Then as $z = (x \ggg y) = (x \lll y) $, we know that the original password $ p = H(p) \lll 4 $. +$$ +\\ +\\ +$$ + +## IV/ unmasking different signatures (recurrent marks) in the hash + +In the previous chapter one `I/ substraction to reverse the addition`, we told we can reverse the previous addition. We still need to guess which addition/substraction has been done previously. + +As both addition values are made depending of: + +``` +if (password[left] & 0xfffffff0 < 0xa0) -> password[left] + 0x30 or else password[left] + 0x37 +if (password[right] & 0x0000000f < 0x0a) -> password[right] & 0x0f + 0x30 or else password[right] & 0x0f + 0x37 +``` -## II/ substraction to reverse the addition -$\forall x [(x = y + z) \implies (y = e \minus z)]$ -## III/ truncating 4 first and 4 last bits Then we have proven that: