NTRUEncrypt module in Python3
pip3 install pycryptodome
-
Polynomial
-
_coeff
-
_N
-
-
NTRUKey
-
_P
parameter set
-
_h
public key
-
_f
private key
-
_g
private key
-
_fp
-
_fq
-
-
NTRUEncrypt.generate_key(params)
-
return NTRUKey entity , default params are Standard_Security
-
params support
-
NTRUEncrypt.Moderate_Security()
-
NTRUEncrypt.Standard_Security()
-
NTRUEncrypt.Highest_Security()
-
-
-
NTRUEncrypt.import_key(file)
- return NTRUKey entity according to file
-
NTRUKey.encrypt(m)
-
return ciphertext (Type bytes)
-
type of m should be bytes
-
-
NTRUKey.encrypt_to_poly(m)
-
return ciphertext (Type list)
-
type of m should be bytes
-
-
NTRUKey.decrypt(e)
-
return plaintext (Type bytes)
-
type of e should be bytes
-
-
NTRUKey.decrypt_from_poly(e)
-
return plaintext (Type bytes)
-
type of e should be list
-
-
NTRUKey.export_public_key(file)
- export Parameters and polynomial h to file
-
NTRUKey.export_private_key(file)
- export Parameters , polynomial h , polynomial f and polynomial g to file