from Crypto.Util.number import *
a = b"blahblah"
b = bytes_to_long(a)
c = long_to_bytes(b)from Crypto.Util.number import *
a = "deadbeef"
b = bytes.fromhex(a)
c = hex(bytes_to_long(b))import base64
a = "d293IHUgZGVjb2RlZCB0aGlzLiBjcmF6eS4gdXIgc28gdGFsZW50ZWQuIHNvIHNtYXJ0IA=="
b = base64.b64decode(a).decode()
c = base64.b58decode(a).decode()a = [101, 234, 255, 10, 11, 12]
b = bytearray(a)goated.
alternatively visit the site. but scripting encouraged.
use pip install factordb-pycli for the module.
from factordb.factordb import FactorDB
N = # number to be factored
f = FactorDB(N)
f.connect()
primes = f.get_factor_list()less goated. Use for smaller numbers ig.
from sympy import *
N = # number to be factored
factors = factorint(N).keys()other algorithms for factoring may include :
lenstras ecmpollard's p-1Quadratic Sieve
// to be implemented and logged
from sympy import * # pip install sympy
x,y,z = symbols('x y z')
eq1 = Eq( # LHS, # RHS )
eq2 = Eq( # LHS, # RHS )
eq3 = Eq( # LHS, # RHS )
# for n unknowns, n equations only.from z3 import * # pip install z3-solver
solver = Solver()
x = Int('x')
y = Int('y')
z = Int('z')
solver.add( # first equation in the form : LHS == RHS )
solver.add( # second equation in the form : LHS == RHS )
solver.add( # third equation in the form : LHS == RHS )
# can also add conditions in z3 such that :
solver.add( x > y )
solver.add( y > z )learn z3 -> https://github.com/ViRb3/z3-python-ctf
cyber chef - https://gchq.github.io/CyberChef/
dcode - https://www.dcode.fr/en
enigma - https://cryptii.com/pipes/enigma-machine
morse - https://morsecode.world/international/translator.html
citrix ctx1 - https://asecuritysite.com/cipher/citrix