Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file removed .DS_Store
Binary file not shown.
19 changes: 19 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@

-----------------------------------------------------------------

███████╗ ██████╗██████╗ ██╗ ██╗██████╗ ████████╗
╚══███╔╝██╔════╝██╔══██╗╚██╗ ██╔╝██╔══██╗╚══██╔══╝
███╔╝ ██║ ██████╔╝ ╚████╔╝ ██████╔╝ ██║
███╔╝ ██║ ██╔══██╗ ╚██╔╝ ██╔═══╝ ██║
███████╗╚██████╗██║ ██║ ██║ ██║ ██║
╚══════╝ ╚═════╝╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝

+++++++++++++++++++++++++++++++++++++++++++++++
****<<Created by: Siddartha Malladi>>**********
----------------------------------------------------------------

# ZCrypt
## Basic decryption tool

Expand Down Expand Up @@ -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
6 changes: 6 additions & 0 deletions RSA/RSA1.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@
from utils import *
from factorizations.factordb import *
banner()
'''
==> c = 61755320155925494660551920761454463487401548279688672761033639271968447552538039977698223026933796912494116347243805242200612025326482838810791756260085509550131713662597497521153195111273693512858774027842245708759910171933236029123361890400870896212504017945900641684931685449796719984403627813045065427962
==> n = 75267542047891848594630737311377686328322054122372174893906679499848429933554461483262840858561421691196745054401234786962886383772042458390620571955008818482322126005048853034866519574149834251335018597072237820298484967761635887969772946574871350539523281304243297613418863668754341179466678536081767878689
==> e = 65537

'''

try:

Expand Down
9 changes: 8 additions & 1 deletion RSA/RSA2.py
Original file line number Diff line number Diff line change
@@ -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 = "))
Expand Down
2 changes: 1 addition & 1 deletion RSA/RSA3.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from banner import *
from utils import egcd,modinv,Convert
from utils import egcd,modinv,convert
banner()

try:
Expand Down
10 changes: 9 additions & 1 deletion RSA/RSA4.py
Original file line number Diff line number Diff line change
@@ -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 = "))
Expand Down
14 changes: 12 additions & 2 deletions RSA/RSA5.py
Original file line number Diff line number Diff line change
@@ -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)
Expand All @@ -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
Expand Down
8 changes: 7 additions & 1 deletion RSA/RSA6.py
Original file line number Diff line number Diff line change
@@ -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 = "))
Expand Down
8 changes: 4 additions & 4 deletions RSA/RSA7.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from banner import *
from utils import modinv,Convert
from utils import modinv,convert
banner()
try:
c = int(input("==> c = "))
Expand All @@ -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))
Expand Down
20 changes: 13 additions & 7 deletions RSA/RSA8.py
Original file line number Diff line number Diff line change
@@ -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 = "))
Expand All @@ -34,4 +40,4 @@ def fermat_factors(n):
except requests.exceptions.ConnectionError:
slowprint("\n[-] Check Your Internet")
except:
slowprint("False Attack")
slowprint("False Attack")
Binary file added RSA/__pycache__/RSA1.cpython-38.pyc
Binary file not shown.
Binary file removed RSA/__pycache__/RSA1.cpython-39.pyc
Binary file not shown.
Binary file removed RSA/__pycache__/RSA7.cpython-38.pyc
Binary file not shown.
Binary file removed XOR/__pycache__/repeating_key.cpython-38.pyc
Binary file not shown.
2 changes: 1 addition & 1 deletion ZCrypt.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
Binary file removed __pycache__/banner.cpython-38.pyc
Binary file not shown.
Binary file removed __pycache__/banner.cpython-39.pyc
Binary file not shown.
Binary file removed __pycache__/utils.cpython-38.pyc
Binary file not shown.
Binary file removed __pycache__/utils.cpython-39.pyc
Binary file not shown.
26 changes: 11 additions & 15 deletions banner.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,15 @@ def slowprint(s):
def banner():
os.system('tput reset')
print("""
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
\-_-_-_-_-_-_-_-/ /-_-_-_-_-__\ || -_-_-_-_-_-\ \ / ||-_-_-_-_-_-\ \-_-_-_-_-_-_-_-/
// // || \ \ / || \ ||
// // || |\ \ / || |\ ||
// || || || \ / || || ||
// || || || \ / || || ||
// || || || \ / || // ||
// || || -_-_-_-_-_-_/ \-_-_-_/ ||-_-_-_-_-_-// ||
// || || \ || || ||
// || || \ || || ||
// \ || \ || || ||
// \ || \ || || ||
/-_-_-_-_-_-_-_-\ \-_-_-_-_-_-_\ || \ || || ||
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
*******************************<<ZCrypt:Basic Decryption Tool>> <<Coded by: st0ic3r>>******************************


███████╗ ██████╗██████╗ ██╗ ██╗██████╗ ████████╗
╚══███╔╝██╔════╝██╔══██╗╚██╗ ██╔╝██╔══██╗╚══██╔══╝
███╔╝ ██║ ██████╔╝ ╚████╔╝ ██████╔╝ ██║
███╔╝ ██║ ██╔══██╗ ╚██╔╝ ██╔═══╝ ██║
███████╗╚██████╗██║ ██║ ██║ ██║ ██║
╚══════╝ ╚═════╝╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝
+++++++++++++++++++++++++++++++++++++++++++++++
************<<Created by: st0ic3r>>************
Github : github.com/malladisiddu/
""")
33 changes: 0 additions & 33 deletions banner.py.save

This file was deleted.

Binary file not shown.
2 changes: 1 addition & 1 deletion utils.py
Original file line number Diff line number Diff line change
@@ -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)
Expand Down