Ejemplo n.º 1
0
    def quitwin(self, event=None):
        '''function that will destroy the present window and then create a new
            window that will give the credits'''

        self.reinitialise()

        self.frame.destroy()

        self.initFrameForTableDisplay()

        self.frame.grid_propagate(1)

        self.big = tkFont.Font(family='helvetica', size=24)

        r = self.frame

        c = 0

        Label(r, text='Created by Siddharth Kannan',
              font=self.big).grid(row=c, column=0)
        c += 1
        Label(r, text='Written on Python 2.7 and Tkinter 8.5',
              font=self.big).grid(row=c, column=0)
        c += 1
        Label(r, text='OS: LINUX MINT 14 NADIA', font=self.big).grid(row=c,
                                                                     column=0)
        c += 1
        Label(r,
              text='This software is licensed under the WTFPL license.',
              font=self.big).grid(row=c, column=0)
        c += 1
        Label(r, text='See the copying file for more details.',
              font=self.big).grid(row=c, column=0)
        c += 1
        Label(r, text='Application will quit in 8 seconds.',
              font=self.big).grid(row=c, column=0)
        c += 1

        ##Do the essential before the asthetics!

        os.rename(fileName, 'viper')

        global flag

        flag = True

        encryption.encryptAll()

        self.window.after(8000, self.window.destroy)
Ejemplo n.º 2
0
    def unauthorised(self, ev=None):
        '''will be called if the user enters the wrong master password'''

        self.frame.destroy()

        ##Do the essential before the asthetics!

        global flag
        flag = True

        os.rename(fileName, 'viper')

        encryption.encryptAll()

        self.reinitialise()

        self.initFrameForTableDisplay()

        self.frame.grid_propagate(1)

        self.big = tkFont.Font(family='helvetica', size=24)

        r = self.frame

        c = 0

        Label(r, text='Unauthorised access detected. Goodbye',
              font=self.big).grid(row=c, column=0)
        c += 1
        Label(r, text='Created by Siddharth Kannan',
              font=self.big).grid(row=c, column=0)
        c += 1
        Label(r, text='Written on Python 2.7 and Tkinter 8.5',
              font=self.big).grid(row=c, column=0)
        c += 1
        Label(r, text='OS: LINUX MINT 14 NADIA', font=self.big).grid(row=c,
                                                                     column=0)
        c += 1
        Label(r,
              text='This software is licensed under the WTFPL license.',
              font=self.big).grid(row=c, column=0)
        c += 1
        Label(r, text='See the copying file for more details.',
              font=self.big).grid(row=c, column=0)
        c += 1
Ejemplo n.º 3
0
    def quitwin(self,event=None):

        '''function that will destroy the present window and then create a new
            window that will give the credits'''

        self.reinitialise()

        self.frame.destroy()

        self.initFrameForTableDisplay()

        self.frame.grid_propagate(1)

        self.big  = tkFont.Font(family='helvetica',size=24)

        r = self.frame

        c = 0

        Label(r,text='Created by Siddharth Kannan',font=self.big).grid(row=c,column=0)
        c+=1
        Label(r,text='Written on Python 2.7 and Tkinter 8.5',font=self.big).grid(row=c,column=0)
        c+=1
        Label(r,text='OS: LINUX MINT 14 NADIA',font=self.big).grid(row=c,column=0)
        c+=1
        Label(r,text='This software is licensed under the WTFPL license.',font=self.big).grid(row=c,column=0)
        c+=1
        Label(r,text='See the copying file for more details.',font=self.big).grid(row=c,column=0)
        c+=1
        Label(r,text='Application will quit in 8 seconds.',font=self.big).grid(row=c,column=0)
        c+=1
        
        ##Do the essential before the asthetics!
        
        os.rename(fileName,'viper')

        global flag
        
        flag = True

        encryption.encryptAll()

        self.window.after(8000,self.window.destroy)
Ejemplo n.º 4
0
    def unauthorised(self,ev=None):

        '''will be called if the user enters the wrong master password'''

        self.frame.destroy()
        
        ##Do the essential before the asthetics!

        global flag
        flag = True
        
        os.rename(fileName,'viper')

        encryption.encryptAll()

        self.reinitialise()

        self.initFrameForTableDisplay()

        self.frame.grid_propagate(1)

        self.big  = tkFont.Font(family='helvetica',size=24)

        r = self.frame

        c = 0
        
        Label(r,text='Unauthorised access detected. Goodbye',font=self.big).grid(row=c,column=0)
        c+=1
        Label(r,text='Created by Siddharth Kannan',font=self.big).grid(row=c,column=0)
        c+=1
        Label(r,text='Written on Python 2.7 and Tkinter 8.5',font=self.big).grid(row=c,column=0)
        c+=1
        Label(r,text='OS: LINUX MINT 14 NADIA',font=self.big).grid(row=c,column=0)
        c+=1
        Label(r,text='This software is licensed under the WTFPL license.',font=self.big).grid(row=c,column=0)
        c+=1
        Label(r,text='See the copying file for more details.',font=self.big).grid(row=c,column=0)
        c+=1
Ejemplo n.º 5
0
def main():

    ##checking to see if the file is there. If not create a new empty file.

    try:

        filin = open('viper', 'r')

    except IOError:

        filin = open('viper', 'w')

    filin.close()

    ##now encrypt the file. We ensure that the file is there. Even though it may be empty.

    filin = open('viper', 'r')

    line = filin.readline()

    if not (line.find('username')
            == -1):  ##if word "username" is there in the line

        filin.close()

        encryption.encryptAll()

    encryption.decryptAll()

    ##Renaming the file for better safety. Using a '.' before
    ##the filename ensures that it remains hidden in unix systems.

    import time
    import hashlib

    newFileName = '.' + hashlib.sha1(str(time.time())).hexdigest()

    os.rename('viper', newFileName)

    global fileName

    fileName = newFileName

    ##there is a possiblity that the user may close the application without
    ##pressing the quit button, but by pressin the close button in the top
    ##right corner. To handle this we need a flag:

    global flag

    flag = False  ##if encryption is done then this will be made to True.

    ##Inintialising the application

    app = VIPER()

    mainloop()

    if not flag:

        os.rename(fileName, 'viper')

        encryption.encryptAll()
Ejemplo n.º 6
0
def main():

	##checking to see if the file is there. If not create a new empty file.


	try:

	    filin = open('viper','r')

	except IOError:

	    filin = open('viper','w')

	filin.close()

	##now encrypt the file. We ensure that the file is there. Even though it may be empty.

	filin = open('viper','r')

	line = filin.readline()

	if not (line.find('username') == -1):  ##if word "username" is there in the line

	    filin.close()

	    encryption.encryptAll()

	encryption.decryptAll()

	##Renaming the file for better safety. Using a '.' before
	##the filename ensures that it remains hidden in unix systems.

	import time
	import hashlib        

	newFileName = '.' + hashlib.sha1(str(time.time())).hexdigest()

	os.rename('viper',newFileName)	
	
	global fileName

	fileName = newFileName

	##there is a possiblity that the user may close the application without
	##pressing the quit button, but by pressin the close button in the top
	##right corner. To handle this we need a flag:	
	
	global flag

	flag = False  ##if encryption is done then this will be made to True.

	##Inintialising the application
		      
	app = VIPER()

	mainloop()

	if not flag:

	    os.rename(fileName,'viper')

	    encryption.encryptAll()