]> Cypherpunks.ru repositories - pygost.git/blob - www.texi
CTR-ACPKM, OMAC-ACPKM-Master modes of operation
[pygost.git] / www.texi
1 \input texinfo
2 @documentencoding UTF-8
3 @settitle PyGOST
4
5 @copying
6 Copyright @copyright{} 2015-2020 @email{stargrave@@stargrave.org, Sergey Matveev}
7 @end copying
8
9 @node Top
10 @top PyGOST
11
12 PyGOST is pure Python 2.7/3.x GOST cryptographic functions library.
13 GOST is GOvernment STandard of Russian Federation (and Soviet Union).
14 It is
15 @url{https://www.gnu.org/philosophy/pragmatic.html, copylefted}
16 @url{https://www.gnu.org/philosophy/free-sw.html, free software}:
17 licenced under @url{https://www.gnu.org/licenses/gpl-3.0.html, GPLv3}.
18 You can read about GOST algorithms @url{http://www.gost.cypherpunks.ru/, more}.
19
20 Currently supported algorithms are:
21
22 @itemize
23 @item GOST 28147-89 (@url{https://tools.ietf.org/html/rfc5830.html, RFC 5830})
24     block cipher with ECB, CNT (CTR), CFB, MAC,
25     CBC (@url{https://tools.ietf.org/html/rfc4357.html, RFC 4357})
26     modes of operation
27 @item various 28147-89-related S-boxes included
28 @item GOST R 34.11-94 hash function
29     (@url{https://tools.ietf.org/html/rfc5831.html, RFC 5831})
30 @item GOST R 34.11-94 based @url{https://en.wikipedia.org/wiki/PBKDF2, PBKDF2} function
31 @item GOST R 34.11-2012 Стрибог (Streebog) hash function
32     (@url{https://tools.ietf.org/html/rfc6986.html, RFC 6986})
33 @item GOST R 34.11-2012 based PBKDF2 function (Р 50.1.111-2016)
34 @item GOST R 34.10-2001
35     (@url{https://tools.ietf.org/html/rfc5832.html, RFC 5832})
36     public key signature function
37 @item GOST R 34.10-2012
38     (@url{https://tools.ietf.org/html/rfc7091.html, RFC 7091})
39     public key signature function
40 @item various 34.10 curve parameters included
41 @item Coordinates conversion from twisted Edwards to Weierstrass
42     form and vice versa
43 @item VKO GOST R 34.10-2001 key agreement function
44     (@url{https://tools.ietf.org/html/rfc4357.html, RFC 4357})
45 @item VKO GOST R 34.10-2012 key agreement function
46     (@url{https://tools.ietf.org/html/rfc7836.html, RFC 7836})
47 @item 28147-89 and CryptoPro key wrapping
48     (@url{https://tools.ietf.org/html/rfc4357.html, RFC 4357})
49 @item 28147-89 CryptoPro key meshing for CFB and CBC modes
50     (@url{https://tools.ietf.org/html/rfc4357.html, RFC 4357})
51 @item @url{https://tools.ietf.org/html/rfc4491.html, RFC 4491}
52     (using GOST algorithms with X.509) compatibility helpers
53 @item GOST R 34.12-2015 128-bit block cipher Кузнечик (Kuznechik)
54     (@url{https://tools.ietf.org/html/rfc7801.html, RFC 7801})
55 @item GOST R 34.12-2015 64-bit block cipher Магма (Magma)
56 @item GOST R 34.13-2015 padding methods and block cipher modes of operation
57       (ECB, CTR, OFB, CBC, CFB, MAC)
58 @item MGM AEAD mode for 64 and 128 bit ciphers (Р 1323565.1.026–2019)
59 @item CTR-ACPKM, OMAC-ACPKM-Master modes of operation (Р 1323565.1.017-2018)
60 @item PEP247-compatible hash/MAC functions
61 @end itemize
62
63 Example 34.10-2012 keypair generation, signing and verifying:
64
65 @example
66 >>> from pygost.gost3410 import CURVES
67 >>> curve = CURVES["id-tc26-gost-3410-12-512-paramSetA"]
68 >>> from os import urandom
69 >>> prv_raw = urandom(32)
70 >>> from pygost.gost3410 import prv_unmarshal
71 >>> prv = prv_unmarshal(prv_raw)
72 >>> from pygost.gost3410 import public_key
73 >>> pub = public_key(curve, prv)
74 >>> from pygost.gost3410 import pub_marshal
75 >>> from pygost.utils import hexenc
76 >>> print "Public key is:", hexenc(pub_marshal(pub))
77 >>> from pygost import gost34112012256
78 >>> data_for_signing = b"some data"
79 >>> dgst = gost34112012256.new(data_for_signing).digest()[::-1]
80 >>> from pygost.gost3410 import sign
81 >>> signature = sign(curve, prv, dgst, mode=2012)
82 >>> from pygost.gost3410 import verify
83 >>> verify(curve, pub, dgst, signature, mode=2012)
84 True
85 @end example
86
87 Please send questions, bug reports and patches to
88 @url{https://lists.cypherpunks.ru/mailman/listinfo/gost, gost}
89 mailing list. Announcements also go to this mailing list.
90
91 @insertcopying
92
93 @include faq.texi
94 @include news.texi
95 @include install.texi
96
97 @bye