Blunt
Dernière mise à jour
Cet article vous a-t-il été utile ?
Dernière mise à jour
Cet article vous a-t-il été utile ?
Catégorie: Crypto Difficulté: easy Flag: HTB{y0u_n3ed_a_b1gGeR_w3ap0n!!}
Valuing your life, you evade the other parties as much as you can, forsaking the piles of weaponry and the vantage points in favour of the depths of the jungle. As you jump through the trees and evade the traps lining the forest floor, a glint of metal catches your eye. Cautious, you creep around, careful not to trigger any sensors. Lying there is a knife - damaged and blunt, but a knife nonetheless. You’re not helpless any more.
Il s’agit d’une implémentation de l’algorithme de Diffie-Hellman. En cherchant les différentes vulnérabilités de celui-ci, on trouve un expliquant qu’un modulo inférieur à 512 bits, on peut le casser avec avec un Logarithme discret.
On sait que A = pow(g, a, p)
, autrement dit 3484137181 = pow(2212633605, a, 3714892429)
Ici on utilisera le site pour résoudre celui-ci et trouver a
.
On trouve alors a = 2766777741
Le secret partagé se calcule avec C = pow(B, a, p)
, soit C = pow(3298958249, 2766777741, 3714892429)
C = 1739735275
ce qui donne en bytes : **67b240eb
**
Il suffit de calculer ensuite le SHA256 : **7a9aa3ea818e71ce79b4018a2e295112263be9390003abe859410b6ec238b94f
**
La clé de l’AES correspond au 16 premiers octets du hash : **7a9aa3ea818e71ce79b4018a2e295112
**