@@ -87,6 +87,11 @@ However, I have not implemented AES itself, instead I import this from `pycrypto
87
87
88
88
To install dependencies, run ` pip -r install requirements ` .
89
89
90
+ The support for reading and writing the keys into PKCS formats requires
91
+ the python-ecdsa package. It can be installed using ` pip install ecdsa ` ,
92
+ or by installing this package with the ` pip install 'kyber-py[pkcs]' `
93
+ command.
94
+
90
95
## Using kyber-py
91
96
92
97
### ML-KEM
@@ -100,6 +105,18 @@ use:
100
105
- ` ML_KEM.encaps(ek) ` : generate a key and ciphertext pair ` (key, ct) `
101
106
- ` ML_KEM.decaps(dk, ct) ` : generate the shared key ` key `
102
107
108
+ Additionally there are few methods for reading and writing both types of keys
109
+ in the ` ml_kem.pkcs ` module:
110
+
111
+ - ` ek_to_der ` : for serialising the encapsulation key to a DER byte string
112
+ - ` ek_to_pem ` : for serialising the encapsulation key to a PEM string
113
+ - ` ek_from_der ` : for extracting the encapsulation key from a DER encoding
114
+ - ` ek_from_pem ` : for extracting the encapsulation key from a PEM encoding
115
+ - ` dk_to_der ` : for serialising the decapsulation key to a DER byte string
116
+ - ` dk_to_pem ` : for serialising the decapsulation key to a PEM string
117
+ - ` dk_from_der ` : for extracting the decapsulation key from a DER encoding
118
+ - ` dk_from_pem ` : for extracting the decapsulation key from a PEM encoding
119
+
103
120
Those, together with the ` ML_KEM_512 ` , ` ML_KEM_768 ` , and ` ML_KEM_1024 `
104
121
objects comprise the kyber-py library stable API.
105
122
0 commit comments