Skip to content

This python library gathers all the cryptographic attacks that I present on my site vozec.fr

Notifications You must be signed in to change notification settings

Vozec/Cryptolib

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 

Repository files navigation

GitHub release (latest by date)

Cryptolib

Description:

This python library gathers all the cryptographic attacks that I present on my website vozec.fr Most of the scripts are taken from my articles, so it is advisable to read them to better understand how they work!

Installation:

git clone https://github.com/Vozec/Cryptolib.git
cd Cryptolib
nano first_test.py
... enjoy !

Examples / test

You can retrieve test for all attacks in the examples folder.
The file test.py runs all tests in this folder.

Documentation:

RSA:

  • Create a RSA-Object with secure parameters

    sys = rsa_init()
  • Create a RSA-Object with custom parameters

    sys = rsa_init(
      e=65537,
      n=...
    )
  • Show info on known variables

    sys.info()

    output:

    --- Status ---
      E: known
      P: unknown
      Q: unknown
      N: known
      D: unknown
    PHI: unknown
    --------------
  • Encrypt Message: (e,n) have to be set

    c = sys.encrypt(b'Hello Vozec')
  • Decrypt Message: (e,n,d) have to be set

    m = sys.decrypt(c)
  • Remove a value:

    sys.pop('p')
  • Add a value:

    sys.add('n',7617...7187)
  • Get Public Key (.pub)

    sys.public_key()
  • Get Private Key (.pem)

    sys.private_key()

Attacks

  • FactorDb Factorization

    sys.factordb()
    m = sys.decrypt(c)
  • Fermat Factorization

    sys.fermat()
    m = sys.decrypt(c)
  • Wiener Factorization

    sys.wiener()
    m = sys.decrypt(c)
  • Common Prime Factorization

    sys.common_prime()
    m = sys.decrypt(c)
  • Small m decoder

    m = sys.small_m()
  • Common Modulus decoder

    m = sys.common_modulus()
  • Hastad Broadcast attack

    m = sys.hastad()
  • MultiPrimes decoder

    primes = [..,..,..]
    sys.multi_primes()
    m = sys.decrypt(c)
  • Franklin Reiter attack

    sys.add('c',c1)
      sys.add('c',c2)
      m2 = sys.franklin_reiter(a=a,b=b)
    #m2 = a*m1+b

About

This python library gathers all the cryptographic attacks that I present on my site vozec.fr

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages