Exemplo n.º 1
0
 def __init__(self, pkenc, key_len=16, mode=AES): 
     PKEnc.__init__(self)
     # check that pkenc satisfies properties of a pkenc scheme
     if hasattr(pkenc, 'keygen') and hasattr(pkenc, 'encrypt') and hasattr(pkenc, 'decrypt'):
         self.pkenc = pkenc
         self.key_len = key_len # 128-bit session key by default
         self.alg = mode
         if debug: print("PKEnc satisfied.")
Exemplo n.º 2
0
 def __init__(self,
              padding=SAEPEncryptionPadding(),
              redundancy=InMessageRedundancy(),
              params=None):
     Rabin.__init__(self)
     PKEnc.__init__(self)
     self.paddingscheme = padding
     self.redundancyscheme = redundancy
 def __init__(self, groupObj, p=0, q=0):
     PKEnc.__init__(self)
     global group
     global lt
     global lk
     lt=lk=160
     group = groupObj
     group.p, group.q, group.r = p, q, 2
Exemplo n.º 4
0
 def __init__(self, par, p=0):
     '''
     initializes an ElGamal object with the number of parameters and the pairing group
     '''
     PKEnc.__init__(self)
     global group
     self.params = par
     group = PairingGroup('BN254')
Exemplo n.º 5
0
 def __init__(self, pkenc, key_len=16, mode=AES):
     PKEnc.__init__(self)
     # check that pkenc satisfies properties of a pkenc scheme
     if hasattr(pkenc, 'keygen') and hasattr(pkenc, 'encrypt') and hasattr(
             pkenc, 'decrypt'):
         self.pkenc = pkenc
         self.key_len = key_len  # 128-bit session key by default
         self.alg = mode
         if debug: print("PKEnc satisfied.")
Exemplo n.º 6
0
 def __init__(self, groupObj):
     PKEnc.__init__(self)
     global group
     group = groupObj
Exemplo n.º 7
0
 def __init__(self, groupObj, p=0, q=0):
     PKEnc.__init__(self)
     global group
     group = groupObj
     if group.groupSetting() == 'integer':
         group.p, group.q, group.r = p, q, 2
Exemplo n.º 8
0
 def __init__(self, padding=OAEPEncryptionPadding(), params=None):
     RSA.__init__(self)
     PKEnc.__init__(self)
     self.paddingscheme = padding
Exemplo n.º 9
0
 def __init__(self, groupObj):
     PKEnc.__init__(self)
     global group
     group = groupObj
 def __init__(self, groupObj, p=0, q=0):
     PKEnc.__init__(self)
     global group
     group = groupObj
     if group.groupSetting() == 'integer':
         group.p, group.q, group.r = p, q, 2
 def __init__(self, groupObj, p=0, q=0):
     PKEnc.__init__(self)
     global group
     group = groupObj
     group.p, group.q, group.r = p, q, 2
Exemplo n.º 12
0
 def __init__(self):
     PKEnc.__init__(self)
     self.k = None
Exemplo n.º 13
0
 def __init__(self, padding=SAEPEncryptionPadding(), redundancy=InMessageRedundancy(), params=None):
     Rabin.__init__(self)
     PKEnc.__init__(self)
     self.paddingscheme = padding 
     self.redundancyscheme = redundancy
Exemplo n.º 14
0
 def __init__(self, padding=OAEPEncryptionPadding(), params=None):
     RSA.__init__(self)
     PKEnc.__init__(self)
     self.paddingscheme = padding 
Exemplo n.º 15
0
Arquivo: HIKE.py Projeto: Pica4x6/HIKE
 def __init__(self, groupObj):
     PKEnc.__init__(self)
     global group
     group = groupObj
     self.isbyte = True
     self.pp = self.setup()
Exemplo n.º 16
0
 def __init__(self):
     PKEnc.__init__(self)
     self.group = RSAGroup()