]> Cypherpunks.ru repositories - pygost.git/blob - www.texi
More URL fixes
[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 PEP247-compatible hash/MAC functions
59 @end itemize
60
61 Example 34.10-2012 keypair generation, signing and verifying:
62
63 @example
64 >>> from pygost.gost3410 import CURVES
65 >>> curve = CURVES["id-tc26-gost-3410-12-512-paramSetA"]
66 >>> from os import urandom
67 >>> prv_raw = urandom(32)
68 >>> from pygost.gost3410 import prv_unmarshal
69 >>> prv = prv_unmarshal(prv_raw)
70 >>> from pygost.gost3410 import public_key
71 >>> pub = public_key(curve, prv)
72 >>> from pygost.gost3410 import pub_marshal
73 >>> from pygost.utils import hexenc
74 >>> print "Public key is:", hexenc(pub_marshal(pub))
75 >>> from pygost import gost34112012256
76 >>> data_for_signing = b"some data"
77 >>> dgst = gost34112012256.new(data_for_signing).digest()[::-1]
78 >>> from pygost.gost3410 import sign
79 >>> signature = sign(curve, prv, dgst, mode=2012)
80 >>> from pygost.gost3410 import verify
81 >>> verify(curve, pub, dgst, signature, mode=2012)
82 True
83 @end example
84
85 Please send questions, bug reports and patches to
86 @url{https://lists.cypherpunks.ru/mailman/listinfo/gost, gost}
87 mailing list. Announcements also go to this mailing list.
88
89 @insertcopying
90
91 @include faq.texi
92 @include news.texi
93 @include install.texi
94
95 @bye