diff --git a/.DS_Store b/.DS_Store deleted file mode 100644 index 012c56f..0000000 Binary files a/.DS_Store and /dev/null differ diff --git a/README.md b/README.md index f244d6b..0474116 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,17 @@ + +----------------------------------------------------------------- + + ███████╗ ██████╗██████╗ ██╗ ██╗██████╗ ████████╗ + ╚══███╔╝██╔════╝██╔══██╗╚██╗ ██╔╝██╔══██╗╚══██╔══╝ + ███╔╝ ██║ ██████╔╝ ╚████╔╝ ██████╔╝ ██║ + ███╔╝ ██║ ██╔══██╗ ╚██╔╝ ██╔═══╝ ██║ + ███████╗╚██████╗██║ ██║ ██║ ██║ ██║ + ╚══════╝ ╚═════╝╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝ + + +++++++++++++++++++++++++++++++++++++++++++++++ + ****<>********** +---------------------------------------------------------------- + # ZCrypt ## Basic decryption tool @@ -34,3 +48,8 @@ pip3 install -r requirements.txt ``` python3 ZCrypt.py ``` + +### Future Updates +* Currently working on its GUI +* Planning to add common attacks in AES for different modes + * Currently working on script for CBC BitFlipping Attack diff --git a/RSA/RSA1.py b/RSA/RSA1.py index 989127d..db715b5 100644 --- a/RSA/RSA1.py +++ b/RSA/RSA1.py @@ -2,6 +2,12 @@ from utils import * from factorizations.factordb import * banner() +''' +==> c = 61755320155925494660551920761454463487401548279688672761033639271968447552538039977698223026933796912494116347243805242200612025326482838810791756260085509550131713662597497521153195111273693512858774027842245708759910171933236029123361890400870896212504017945900641684931685449796719984403627813045065427962 +==> n = 75267542047891848594630737311377686328322054122372174893906679499848429933554461483262840858561421691196745054401234786962886383772042458390620571955008818482322126005048853034866519574149834251335018597072237820298484967761635887969772946574871350539523281304243297613418863668754341179466678536081767878689 +==> e = 65537 + +''' try: diff --git a/RSA/RSA2.py b/RSA/RSA2.py index 6aa917b..1bbae38 100644 --- a/RSA/RSA2.py +++ b/RSA/RSA2.py @@ -1,7 +1,14 @@ from banner import * -from utils import modinv, Convert +from utils import modinv, convert banner() +''' +==> c = 61755320155925494660551920761454463487401548279688672761033639271968447552538039977698223026933796912494116347243805242200612025326482838810791756260085509550131713662597497521153195111273693512858774027842245708759910171933236029123361890400870896212504017945900641684931685449796719984403627813045065427962 +==> p = 6958271393287170117448891021448827870244652620796166337874899406278127643022124226656230972235829204217718701711355755622520840943962368410353060326959627 +==> q = 10816988558466468069802205154113557859050665172995721741674476865844313409030354507360669179381457836401919224815040955096510785560864262908230559354811907 +==> e = 65537 +''' + try: c = int(input("==> c = ")) diff --git a/RSA/RSA3.py b/RSA/RSA3.py index 816a7a1..79297e9 100644 --- a/RSA/RSA3.py +++ b/RSA/RSA3.py @@ -1,5 +1,5 @@ from banner import * -from utils import egcd,modinv,Convert +from utils import egcd,modinv,convert banner() try: diff --git a/RSA/RSA4.py b/RSA/RSA4.py index 9451829..1f5ede9 100644 --- a/RSA/RSA4.py +++ b/RSA/RSA4.py @@ -1,7 +1,15 @@ from banner import * -from utils import Convert +from utils import convert banner() +''' +==> c = 89607111639919127209650034924273346966533469612321885496366954902260836555651605455268315685564884102521751315138745054317891549734624460415579282469559824676571129509386897261361718686847757184676797652741644509297296594801094652142919180951341757690575359920800914815550536137727683352201005845272448559627 +==> n = 89928311288179011519146428089532751379523591729622855508594372783166478638917327757191123264641418795443514859544099539422860363086133465517078412097475326937856290265542196688524185772419476324834419576555062944062383244109784866915010028008734205492481116857889368085002365514967068884805814897932754658961 +==> d = 9974348761062807799146671129023506870588476559540847714908715622638160630274349687459332514620420117247950158140074454919583929372310361488069990654691975678966812319952558452020783995983648814894273413199715498765593824693014878541105366177785811920577583349903357558945708664999648041451991782189528550577 + +''' + + try: c = int(input("==> c = ")) n = int(input("==> n = ")) diff --git a/RSA/RSA5.py b/RSA/RSA5.py index 894cc81..f84b035 100644 --- a/RSA/RSA5.py +++ b/RSA/RSA5.py @@ -1,10 +1,20 @@ from banner import * -from utils import Convert +from utils import convert import functools import gmpy banner() +''' +==> c1 = 8251412717378499426943044591229698372921470386799043004121511177127490360947672432828172950920462590131612740580667346789845592456601935083361010491364143991167754355753784659730080802613261548707296078812865553433595508332527259182849010044455347956676601579784507086046839727921827816698611494372771020370220204666127232765068459835347577650640380746779041820863713925451297171219193544837774581741151646875007941650557239399525694514278200390425920026333044311100410760285248540227801135653250431214060352848761880110983132813330039294997643112287410353948128815918569840988643578772550051280725313230021391380942 +==> c2 = 2702325779529388356371102063040984812124665040096740083415590291307659656117305889838882346989298792101301675475943519630707962469291374444160241176144438945716450393919324588280512162965834656691829393002354300184430292151232812832379450453239000612487613356778411786988702989653661016040401893797873661496019219713761717152774454407503253778794508261627260348018307413238031010132639873894130882230804487006727238991743901103529951650508735692190261561512563254962091894391335884495409277055781287361495675018521228212719289913631998193225375985394285744778656347088506213034138518416542660994351922789098153782426 +==> c3 = 3900786923701448353408400328996279443634365978988250027372176657417202602107709749413601922950255680346434821246225602149213848118274433155867843596693043442953202427150352180877384824428649481139269805852912723284877986721489556461272257756102572291913902519661603733662427660803951862948881013199212486295331474761125640673120787973554851559343144421866187607741449270421663485412329555125791603856752842050767936467505915266913093771220903152480407517200342375961712589389233164233844314560534425409330962177881162956636107825634564219533818875183351523212208900244508745427360366146728697555090746078827400829510 +==> n1 = 22354163791642068886566627219651104380195041959729310536115197372690426166153150709554121466476415239938369078918877984798582326979079153795774037292422071622126484521927631771658058095237139085385756115261972030995362441580297007439051832142457196151824718232248567366670706914779874402683742498695075966725643445863105930425231664277753503763301685728514729454184837909500791715332489780346705814147940635497894486147997813359576656960563599630666067976553724013307328267946814810660680917118025290583125363952665067417686810121196242575696597185045825025685213476854256583567246667302893495351968886389607277575017 +==> n2 = 21572642385016963477579971598617440264385803019459680727028155128709560426935255322579963615480913309319371656833660339467010507644019609202771890449419513825998921211898287110979094482184152680851462860763436118651357838279675837330160696073705562801691670054989971242359972394239624514658831442232416757294030962417420713484664248743040825601912659822670147259253345577287621617731732830801600663028815836518284528998558748540254850496265160959735474358970956309010617755485370782641135356868776640582716527007418304047891311611018237370467038297057657170187552676959058139793475780778636104344421256645433184319157 +==> n3 = 23538490262479781189676424291555687068164182643114661587432340961545193235358179989589472145285643966533983578871187834969068436328997665124747925015293061116055708486200061846952313798801858926911255182783099863586327412221517353934763470084520104303420274885565476991562950377811932201525369292989577677075746773213738116508556463673021568154490753308066042359478835646993306170787055261836477886518576333412004771973699327342803658870989682535232759787969849526764566716133935977445433821602865539462257059701760274658057551372518367400843423909801446235376486516405672866560803799383073579471615403602431711906749 +==> e = 5 +''' + def crt(n, a): sum = 0 prod = functools.reduce(lambda a, b: a*b, n) @@ -20,10 +30,10 @@ def crt(n, a): n1 = int(input("==> n1 = ")) n2 = int(input("==> n2 = ")) n3 = int(input("==> n3 = ")) + e = int(input("==> e = ")) N = [n1, n2, n3] C = [c1, c2, c3] - e = len(N) a = crt(N,C) for n,c in zip(N, C): assert a % n == c diff --git a/RSA/RSA6.py b/RSA/RSA6.py index b156256..6d6dbc1 100644 --- a/RSA/RSA6.py +++ b/RSA/RSA6.py @@ -1,8 +1,14 @@ from banner import * -from utils import Convert +from utils import convert import gmpy2 import binascii banner() +''' +==> c = 2029613660163843396903464782115528008655183225445848001281643028687992002927755695965369902157711827410470381085949600499524270486328046449551598001242088232771076726041029619343560895809087267563848414489258883125846714056071432180906074031501935662926108057389184049920101 +Probably 'e' will be small +==> e = 3 + +''' try: c = int(input("==> c = ")) diff --git a/RSA/RSA7.py b/RSA/RSA7.py index e9818f8..a5e73a6 100644 --- a/RSA/RSA7.py +++ b/RSA/RSA7.py @@ -1,5 +1,5 @@ from banner import * -from utils import modinv,Convert +from utils import modinv,convert banner() try: c = int(input("==> c = ")) @@ -9,10 +9,10 @@ dq = int(input("==> dq = ")) slowprint("\n[+] Please Wait ...\n") - def chinese_remainder_theorem(p,q,dp,dq,chipher_text): + def chinese_remainder_theorem(p,q,dp,dq,cipher_text): q_inv = modinv(p , q) - m1 = pow(chipher_text,dp,p) - m2 = pow(chipher_text,dq,q) + m1 = pow(cipher_text,dp,p) + m2 = pow(cipher_text,dq,q) h = (q_inv*(m1-m2)) % p return m2 + h * q convert(chinese_remainder_theorem(p,q,dp,dq,c)) diff --git a/RSA/RSA8.py b/RSA/RSA8.py index 8402342..5569b44 100644 --- a/RSA/RSA8.py +++ b/RSA/RSA8.py @@ -1,16 +1,22 @@ from banner import * +import requests from utils import * banner() + +''' +==> c = 34556241321778409829234252125398866442939962978969873136382201333200206297769416951162831936418949110944528236841238586744303476629927641535254876274091175076941922589651878305163739775003504738994366530124198403734813628243872035689617702431533182356107612904165873395653564321632211827028395012552136557561 +==> n = 58249221268117887085192679008666481391991742878175658044606254797052676155819469643550544167108699240617881767689293494057479101008755114805240541465257199228386194347185579064158612401962673691504221389762800553538973887572052975111188998739455329190241182045290899911336417224594604893583476744708037361423 +==> e = 65537 +''' try: - def fermat_factors(n): assert n % 2 != 0 - a = gmpy2.isqrt(n) - b2 = gmpy2.square(a) - n - while not gmpy2.is_square(b2): - a += 1 + a = gmpy2.isqrt(n) b2 = gmpy2.square(a) - n - return a + gmpy2.isqrt(b2), a - gmpy2.isqrt(b2) + while not gmpy2.is_square(b2): + a += 1 + b2 = gmpy2.square(a) - n + return a + gmpy2.isqrt(b2), a - gmpy2.isqrt(b2) c = int(input("==> c = ")) n = int(input("==> n = ")) @@ -34,4 +40,4 @@ def fermat_factors(n): except requests.exceptions.ConnectionError: slowprint("\n[-] Check Your Internet") except: - slowprint("False Attack") \ No newline at end of file + slowprint("False Attack") diff --git a/RSA/__pycache__/RSA1.cpython-38.pyc b/RSA/__pycache__/RSA1.cpython-38.pyc new file mode 100644 index 0000000..b6c2d69 Binary files /dev/null and b/RSA/__pycache__/RSA1.cpython-38.pyc differ diff --git a/RSA/__pycache__/RSA1.cpython-39.pyc b/RSA/__pycache__/RSA1.cpython-39.pyc deleted file mode 100644 index f558925..0000000 Binary files a/RSA/__pycache__/RSA1.cpython-39.pyc and /dev/null differ diff --git a/RSA/__pycache__/RSA7.cpython-38.pyc b/RSA/__pycache__/RSA7.cpython-38.pyc deleted file mode 100644 index e4f795a..0000000 Binary files a/RSA/__pycache__/RSA7.cpython-38.pyc and /dev/null differ diff --git a/XOR/__pycache__/repeating_key.cpython-38.pyc b/XOR/__pycache__/repeating_key.cpython-38.pyc deleted file mode 100644 index 37293e1..0000000 Binary files a/XOR/__pycache__/repeating_key.cpython-38.pyc and /dev/null differ diff --git a/ZCrypt.py b/ZCrypt.py index 4e300de..2a5340b 100644 --- a/ZCrypt.py +++ b/ZCrypt.py @@ -36,7 +36,7 @@ [0] - Exit """) z = int(input("==> ")) - if int(z) >= 1 and int(z) <= 7: + if int(z) >= 1 and int(z) <= 8: os.system('tput reset') exec('import RSA.RSA'+str(z)) else: diff --git a/__pycache__/banner.cpython-38.pyc b/__pycache__/banner.cpython-38.pyc deleted file mode 100644 index 778f305..0000000 Binary files a/__pycache__/banner.cpython-38.pyc and /dev/null differ diff --git a/__pycache__/banner.cpython-39.pyc b/__pycache__/banner.cpython-39.pyc deleted file mode 100644 index 0e308ac..0000000 Binary files a/__pycache__/banner.cpython-39.pyc and /dev/null differ diff --git a/__pycache__/utils.cpython-38.pyc b/__pycache__/utils.cpython-38.pyc deleted file mode 100644 index bff4029..0000000 Binary files a/__pycache__/utils.cpython-38.pyc and /dev/null differ diff --git a/__pycache__/utils.cpython-39.pyc b/__pycache__/utils.cpython-39.pyc deleted file mode 100644 index 7d30945..0000000 Binary files a/__pycache__/utils.cpython-39.pyc and /dev/null differ diff --git a/banner.py b/banner.py index 9f47c62..a561686 100644 --- a/banner.py +++ b/banner.py @@ -16,19 +16,15 @@ def slowprint(s): def banner(): os.system('tput reset') print(""" -+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -\-_-_-_-_-_-_-_-/ /-_-_-_-_-__\ || -_-_-_-_-_-\ \ / ||-_-_-_-_-_-\ \-_-_-_-_-_-_-_-/ - // // || \ \ / || \ || - // // || |\ \ / || |\ || - // || || || \ / || || || - // || || || \ / || || || - // || || || \ / || // || - // || || -_-_-_-_-_-_/ \-_-_-_/ ||-_-_-_-_-_-// || - // || || \ || || || - // || || \ || || || - // \ || \ || || || - // \ || \ || || || - /-_-_-_-_-_-_-_-\ \-_-_-_-_-_-_\ || \ || || || -+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -*******************************<> <>****************************** + + +███████╗ ██████╗██████╗ ██╗ ██╗██████╗ ████████╗ +╚══███╔╝██╔════╝██╔══██╗╚██╗ ██╔╝██╔══██╗╚══██╔══╝ + ███╔╝ ██║ ██████╔╝ ╚████╔╝ ██████╔╝ ██║ + ███╔╝ ██║ ██╔══██╗ ╚██╔╝ ██╔═══╝ ██║ +███████╗╚██████╗██║ ██║ ██║ ██║ ██║ +╚══════╝ ╚═════╝╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝ ++++++++++++++++++++++++++++++++++++++++++++++++ +************<>************ +Github : github.com/malladisiddu/ """) diff --git a/banner.py.save b/banner.py.save deleted file mode 100644 index 1d517ad..0000000 --- a/banner.py.save +++ /dev/null @@ -1,33 +0,0 @@ -import sys -import platform,os -from platform import system -import time -def slowprint(s): - for c in s + '\n': - sys.stdout.write(c) - sys.stdout.flush() - time.sleep(4. / 100) - -clear = "" -if "Linux" in platform.system(): - clear = "clear" - - -def banner(): - os.system('tput reset') - print(""" -+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -\-_-_-_-_-_-_-_-/ /-_-_-_-_-_-_\ || -_-_-_-_-_-\ \\ // ||-_-_-_-_-_-\ \-_-_-_-_-_-_-_-/ - // // || \\ \\ // || \\ || - // // || \\ \\ // || \\ || - // || || || \\ // || || || - // || || || \\ // || || || - // || || || \\ // || || || - // || || -_-_-_-_-_-_/ \-_-_-_-_/ || -_-_-_-_-_-/ || - // || || \\ || || || - // || || \\ || || || - // \\ || \\ || || || - // \\ || \\ || || || - /-_-_-_-_-_-_-_-\ \-_-_-_-_-_-_\ || \\ || || || -<> <> -+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++""") diff --git a/factorizations/__pycache__/factordb.cpython-38.pyc b/factorizations/__pycache__/factordb.cpython-38.pyc new file mode 100644 index 0000000..d07f3c9 Binary files /dev/null and b/factorizations/__pycache__/factordb.cpython-38.pyc differ diff --git a/utils.py b/utils.py index 12bfdb1..36fa9e6 100644 --- a/utils.py +++ b/utils.py @@ -1,7 +1,7 @@ import binascii import gmpy2 -def Convert(decimal): +def convert(decimal): hex_ = hex(decimal).replace("0x","").replace("L","") ascii = binascii.a2b_hex(hex_) print("\nPlainText in Decimal :",decimal)