from Encrypt import *
from Decrypt import *
from IVsKeys import *
import threading

def HybridCrypt(path):
	iv1,iv2=generateIV(path)
	key1,key2=generateKey(path)
	key = HybridCryptKeys(path)
	t1 = threading.Thread(target=AES, args=(path,key1,iv1,))
	t2 = threading.Thread(target=BlowFish, args=(path,key1,iv2,))
	t3 = threading.Thread(target=TrippleDES, args=(path,key1,iv2,))
	t4 = threading.Thread(target=IDEA, args=(path,key1,iv2,))
	t5 = threading.Thread(target=EFernet, args=(path,key2,))

    #Starting the Encription Process	
	t1.start() 
	t2.start() 
	t3.start()
	t4.start()
	t5.start()

    #Thread Sync.
	t1.join() 
	t2.join() 
	t3.join()   
	t4.join()
	t5.join()
	return key

 
def HybridDeCrypt(key,path,filename):
	HybridDeCryptKeys(key,path,filename)
	iv=FetchIV(path)
	key1,key2=FetchKey(path)
	t1 = threading.Thread(target=DAES, args=(path,key1,iv[0],))
	t2 = threading.Thread(target=DBlowFish, args=(path,key1,iv[1],))
	t3 = threading.Thread(target=DTrippleDES, args=(path,key1,iv[1],))
	t4 = threading.Thread(target=DIDEA, args=(path,key1,iv[1],))
	t5 = threading.Thread(target=DFernet, args=(path,key2,))

    #Starting the Encription Process
	t1.start() 
	t2.start() 
	t3.start()
	t4.start()
	t5.start()

    #Thread Sync.
	t1.join() 
	t2.join() 
	t3.join()
	t4.join()
	t5.join()
	
