sage

HITCON CTF 2019 Quals | Lost Modulus Again

from Crypto.Util.number import * class Key: def __init__(self, bits): assert bits >= 512 self.p = getPrime(bits) self.q = getPrime(bits) self.n = self.p * self.q self.e = 0x100007 self.d = inverse(self.e, (self.p-1)*(self.q-1)) self.dmp1 =…

Sagemath Reference

sage GF == FiniteField 有限体。Field = GF(13) みたいな感じで作って、 Field(9) みたいな感じでインスタンス化する。 Field(9) * 200 == 9とかになる PolynomialRing 多項式環。整数上の多項式だったり有限体上の多項式だったするので、 PR.<x> = Polynomial</x>…

TAMUctf 19|Mike's Marvelous Mystery Curves

#TAMUCTF19 https://ctftime.org/task/7746 Mike, the System Administrator, thought it would be a good idea to implement his own Elliptic Curve Diffie Hellman key exchange using unnamed curves to use across the network. We managed to capture …