Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/ValarDragon/CTF-Crypto
/ functions
Functions
69 in github.com/ValarDragon/CTF-Crypto
⨍
Functions
69
◇
Types & classes
4
↓ 10 callers
Method
modinv
Modular Multiplicative Inverse, from https://rosettacode.org/wiki/Modular_inverse#Python
RSA/RSATool.py:611
↓ 8 callers
Method
generatePrivKey
(self, modulus="modulus",pubexp="e",p="p",q="q",outFileName="None")
RSA/RSATool.py:620
↓ 5 callers
Method
floorSqrt
(self,n)
RSA/RSATool.py:591
↓ 4 callers
Function
newAES
(key)
AES/MITM.py:23
↓ 2 callers
Method
extended_gcd
Extended Euclidean Algorithm, from https://rosettacode.org/wiki/Modular_inverse#Python
RSA/RSATool.py:599
↓ 2 callers
Function
franklinReiter
(n,e,r,c1,c2)
RSA/FranklinReiterSage.py:12
↓ 2 callers
Method
getCandidateA
(self,sieveModulus,N="RSA modulus",secondIter=False)
RSA/RSATool.py:231
↓ 2 callers
Method
invalidPubExponent
Recovers some bytes of ciphertext if n is factored, but e was invalid. (Like e=100) The vast majority of bytes are however lost, as we are tak
RSA/RSATool.py:433
↓ 2 callers
Method
isLastDigitPossibleSquare
(self,x)
RSA/RSATool.py:162
↓ 2 callers
Method
pollardf
(self,x)
RSA/RSATool.py:369
↓ 2 callers
Function
sToC
(s,e=3)
RSA/bleichenbacher.py:94
↓ 2 callers
Method
sieveFermatAttack
(self,N="RSA modulus",sieveModulus=4500,limit=1000,fermatTimeout=3*60)
RSA/RSATool.py:260
↓ 2 callers
Function
solve
(plaintext,ciphertext,KeyGen)
AES/MITM.py:9
↓ 2 callers
Method
wienerAttack
(self,n="n",e="e",wienerTimeout=3*60)
RSA/RSATool.py:145
↓ 1 callers
Function
CoppersmithShortPadAttack
Coppersmith's Shortpad attack! Figured out from: https://en.wikipedia.org/wiki/Coppersmith's_attack#Coppersmith.E2.80.99s_short-pad_attack
RSA/FranklinReiterSage.py:28
↓ 1 callers
Function
GenFakeKeys
(pubkey1)
Pairings/RogueKeyAttack.sage.py:7
↓ 1 callers
Function
GenFakeSignature
(b, hashedMsg)
Pairings/RogueKeyAttack.sage.py:17
↓ 1 callers
Function
TestRoguePublicKey
()
Pairings/RogueKeyAttack.sage.py:25
↓ 1 callers
Function
checkBrokenPublicExponent
()
RSA/testScript.py:50
↓ 1 callers
Method
checkFactorDB
See if the modulus is already factored on factordb.com, and if so get the factors
RSA/RSATool.py:117
↓ 1 callers
Function
checkHalfdPartialKeyRecoveryAttack
()
RSA/testScript.py:66
↓ 1 callers
Function
checkSameModulusDifferentPubExp
()
RSA/testScript.py:82
↓ 1 callers
Function
checkSievedFermatAttack
()
RSA/testScript.py:37
↓ 1 callers
Function
checkdpPartialKeyRecoveryAttack
()
RSA/testScript.py:94
↓ 1 callers
Function
chunks
(l, n)
RSA/bleichenbacher.py:100
↓ 1 callers
Method
commonModulusPubExpSamePlainText
Solves for message if you have two ciphertexts of the same message encrypted with different public exponents and same modulus
RSA/RSATool.py:408
↓ 1 callers
Function
compositeModulusGCD
(a, b)
RSA/FranklinReiterSage.py:22
↓ 1 callers
Method
contfrac_to_rational
(self, frac)
RSA/wienerAttack.py:27
↓ 1 callers
Method
convergents_from_contfrac
(self, frac)
RSA/wienerAttack.py:21
↓ 1 callers
Method
dpPartialKeyRecoveryAttack
Recovers full private key given d_p for CRT version of RSA. Links: https://www.iacr.org/archive/crypto2003/27290027/27290027.
RSA/RSATool.py:525
↓ 1 callers
Method
extended_gcd
Extended Euclidean Algorithm, from https://rosettacode.org/wiki/Modular_inverse#Python
Diffie Hellman/DiscreteLogarithmSolver.py:42
↓ 1 callers
Method
factorModulii
(self,pubkeys,outFileNameFormat="privkey-%s.pem")
RSA/RSATool.py:81
↓ 1 callers
Method
factorModulus
(self,pubKey="pubkey",e="e",n="n",outFileName="")
RSA/RSATool.py:27
↓ 1 callers
Method
floorSqrt
(self,n)
Diffie Hellman/DiscreteLogarithmSolver.py:63
↓ 1 callers
Method
genSquaresModSieve
(self,sieve)
RSA/RSATool.py:198
↓ 1 callers
Method
halfdPartialKeyRecoveryAttack
Recovers full private key given more than half of the private key. Links: http://www.ijser.org/researchpaper/Attack_on_RSA_Cr
RSA/RSATool.py:466
↓ 1 callers
Method
is_perfect_square
(self, n)
RSA/wienerAttack.py:37
↓ 1 callers
Method
isqrt
(self, n)
RSA/wienerAttack.py:51
↓ 1 callers
Function
knownMessageFormat
unknownEndBitIndex is measured from the LSB being bit #0 if unknownEndBitIndex is 0, it is knownMessageFormatUnkownAtEnd, but with epsilon so
RSA/partialKnownMessageSage.py:20
↓ 1 callers
Function
linearPaddingHastads
Performs Hastads attack on raw RSA with no padding. This is for RSA encryptions of the form: cArray[i] = pow(aArray[i]*msg + bArray[i],e,nArr
RSA/hastadsSage.py:24
↓ 1 callers
Function
loadBostonKeyPartyPEMs
()
RSA/testScript.py:7
↓ 1 callers
Function
main
()
RSA/testScript.py:12
↓ 1 callers
Function
main
()
RSA/testScriptSage.py:10
↓ 1 callers
Method
modinv
Modular Multiplicative Inverse, from https://rosettacode.org/wiki/Modular_inverse#Python
Diffie Hellman/DiscreteLogarithmSolver.py:54
↓ 1 callers
Method
pollardPminus1
(self,N="modulus",a=7,B=2**16,pMinus1Timeout=3*60)
RSA/RSATool.py:339
↓ 1 callers
Function
python_rsa_bleichenbacher
This can forge RSA signatures for low exponents for the python RSA module, for any modulus The CVE was reported in http://www.openwall.com/li
RSA/bleichenbacher.py:6
↓ 1 callers
Method
rational_to_contfrac
(self, x, y)
RSA/wienerAttack.py:12
↓ 1 callers
Method
smallPrimes
(self,n="n",upperlimit=1000000)
RSA/RSATool.py:320
↓ 1 callers
Function
testAESMITM
()
AES/MITM.py:35
Method
__enter__
(self)
RSA/RSATool.py:659
Method
__exit__
(self, type, value, traceback)
RSA/RSATool.py:662
Method
__init__
(self)
RSA/RSATool.py:18
Method
__init__
(self, seconds=1, error_message='[*] Timeout')
RSA/RSATool.py:654
Method
__init__
(self, n, e)
RSA/wienerAttack.py:63
Method
babyStepGiantStep
Baby Step Giant Step algorithm from https://en.wikipedia.org/wiki/Baby-step_giant-step Input: A cyclic group G of order n, having a g
Diffie Hellman/DiscreteLogarithmSolver.py:2
Method
bruteBestSieveModulus
(self,startVal,endVal,N="RSA modulus")
RSA/RSATool.py:307
Method
chineseRemainderTheorem
(self,moduliiValueDictionary)
RSA/RSATool.py:546
Method
fermatAttack
(self,n="n",limit=100,fermatTimeout=3*60)
RSA/RSATool.py:177
Method
generatePubKey
(self, modulus="modulus",pubexp="e",outFileName="None")
RSA/RSATool.py:639
Method
handle_timeout
(self, signum, frame)
RSA/RSATool.py:657
Function
hastads
Performs Hastads attack on raw RSA with no padding. cArray = Ciphertext Array nArray = Modulus Array e = public exponent
RSA/hastadsSage.py:6
Function
knownMessageFormatUnkownAtEnd
(prefix,e,n,c,eps=_sage_const_1 /_sage_const_8 )
RSA/partialKnownMessageSage.py:6
Method
pollardsRho
(self,n="modulus",rhoTimeout=5*60)
RSA/RSATool.py:372
Function
sample_KeyGen
()
AES/MITM.py:26
Function
testCoppersmithShortPadAttack
(eps=_sage_const_1 /_sage_const_25 )
RSA/FranklinReiterSage.py:63
Function
testFranklinReiter
()
RSA/FranklinReiterSage.py:84
Function
testFunction
()
RSA/bleichenbacher.py:104
Function
testKnownMessageFormat
()
RSA/partialKnownMessageSage.py:45
Function
testLinearPadding
()
RSA/hastadsSage.py:63