Example #1
0
 def base64_calc_decode(self):
     try:
         base64_input = self.txtbase64_input.toPlainText()
         res = Util.newBase64(self.txtbase64_key.text(), base64_input, False)
         self.txtbase64_output.setPlainText(res)
         if self.chkHexOutput.isChecked():
             self.hex_toggled()
     except Exception as ex:
         self.appendLog(str(ex))
         self.txtbase64_output.setPlainText("")
Example #2
0
 def select_file(self):
     filename= QFileDialog.getOpenFileName()[0]
     if len(filename)<=0:
         return
     try:
         self.txtbase64file.setText(filename)
         with open(filename,"rb") as myfile:
             mydata= myfile.read()
             res = Util.newBase64(self.txtbase64_key.text(),mydata, self.rdobase64_encode.isChecked())
             if self.chkIsHex.isChecked():
                 outres = ""
                 for mych in res:
                     outres += "%02x " % mych
                 res = outres
             self.txtbase64_output.setPlainText(res)
     except Exception as ex:
         self.appendLog(str(ex))