コード例 #1
0
 def encrypt(self):
     self.data = XiaoTea.XiaoTea().encrypt(self.data)
コード例 #2
0
 def encrypt(self):
     cry = XiaoTea()
     self.data = cry.encrypt(self.data)
コード例 #3
0
#!/usr/bin/python
from sys import argv, exit
from os.path import getsize
from xiaotea import XiaoTea

if len(argv) != 3:
    exit('Usage: ' + argv[0] + ' <infile> <outfile>')

fsize = getsize(argv[1])

if fsize % 8:
    exit('Wrong input file size !')

cry = XiaoTea()

hfi = open(argv[1], 'rb')
hfo = open(argv[2], 'wb')

hfo.write(cry.decrypt(hfi.read()))

hfo.close()
hfi.close()
コード例 #4
0
 def decrypt(self):
     self.data = XiaoTea.XiaoTea().decrypt(self.data)