From 1af1e63e4b6ec30d922c1d693ec9ee80c7467a38 Mon Sep 17 00:00:00 2001 From: tsunamaru Date: Mon, 17 Oct 2022 10:11:59 +0300 Subject: [PATCH] Python >=3.9 fix --- gost2012.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gost2012.py b/gost2012.py index f005b83..426b0ef 100644 --- a/gost2012.py +++ b/gost2012.py @@ -61,7 +61,7 @@ def encodeKey(key, oids, algo="1.2.643.7.1.1.1.1"): seq2, pyasn1.type.univ.OctetString(bytes.fromhex(key)) ) - return '-----BEGIN PRIVATE KEY-----\n{}-----END PRIVATE KEY-----\n'.format(base64.encodestring(encode(seq3)).decode("ascii")) + return '-----BEGIN PRIVATE KEY-----\n{}-----END PRIVATE KEY-----\n'.format(base64.encodebytes(encode(seq3)).decode("ascii")) def unwrap_gost(kek, data, sbox=DEFAULT_SBOX): if len(data) != 44: