def selectFile(self): dialog = QtGui.QFileDialog fileDialog = dialog.getOpenFileName(Form) filePathP = self.filePath.setText(fileDialog) f = open(fileDialog, 'r') now = time.time() with f: data = f.read() l = len(data) for i in data: key = SimpleXOR.rand(l) xor = SimpleXOR.xor_en(data, ke=key) self.Original_text.setText(data) self.Key_text.setText(key) self.encrypted_text.setText(xor) nowTime = 'Process took %s s' % str(time.time() - now) self.time.setText(nowTime) charCount = "There are %s characters in the original file" % l self.originalCharCount.setText(charCount) f.close()
def getAction(): print """ __ _ __ _ __ ____ ___ / / (_)/ /__ __ | |/_// __ \ / _ \ / /__ / // // // /_> < / /_/ // , _/ /____//_//_/ \_, //_/|_| \____//_/|_| /___/ 0.0.1 beta\n Original(LilyMail) by: Xiaolong Cheng \n """ filess() print 'Only encrypts outgoing emails' print '\n[OPTIONS: login, quit, sxor...]\n' action=ask('command: ') if action=='quit': sys.exit(0) elif action=='login': print 'Please verify your identity ' login() elif action=='help': print '[login] start a login session\n [quit] exit program\n [sxor] SimpleXOR' elif action=='sxor': SimpleXOR.action() else: print 'invalid command...back to sxor'
def getAction(): print """ __ _ __ _ __ ____ ___ / / (_)/ /__ __ | |/_// __ \ / _ \ / /__ / // // // /_> < / /_/ // , _/ /____//_//_/ \_, //_/|_| \____//_/|_| /___/ 0.0.1 beta\n Original(LilyMail) by: Xiaolong Cheng \n """ filess() print 'Only encrypts outgoing emails' print '\n[OPTIONS: login, quit, sxor...]\n' action = ask('command: ') if action == 'quit': sys.exit(0) elif action == 'login': print 'Please verify your identity ' login() elif action == 'help': print '[login] start a login session\n [quit] exit program\n [sxor] SimpleXOR' elif action == 'sxor': SimpleXOR.action() else: print 'invalid command...back to sxor'
def selectFile(self): dialog = QtGui.QFileDialog fileDialog = dialog.getOpenFileName(Form) filePathP = self.filePath.setText(fileDialog) f = open(fileDialog, "r") now = time.time() with f: data = f.read() l = len(data) for i in data: key = SimpleXOR.rand(l) xor = SimpleXOR.xor_en(data, ke=key) self.Original_text.setText(data) self.Key_text.setText(key) self.encrypted_text.setText(xor) nowTime = "Process took %s s" % str(time.time() - now) self.time.setText(nowTime) charCount = "There are %s characters in the original file" % l self.originalCharCount.setText(charCount) f.close()