Пример #1
0
class lite_socket(object):
  def __init__(self, key):
    self.keys=KeyManager()
    self.key=key
    self.cipherIn=DustCipher(key, "\x00")
    self.cipherOut=DustCipher(key, "\x00")

  @_o
  def encrypt(self, data):
    data=self.cipherOut.encrypt(data)
    yield Return(data)

  @_o
  def decrypt(self, data):
    data=self.cipherIn.decrypt(data)
    yield Return(data)

  def createEphemeralKeypair(self):
    return self.keys.createKeypair()
Пример #2
0
 def __init__(self, key):
   self.keys=KeyManager()
   self.key=key
   self.cipherIn=DustCipher(key, "\x00")
   self.cipherOut=DustCipher(key, "\x00")