]> Cypherpunks.ru repositories - pygost.git/blob - www.texi
Raise copyright years
[pygost.git] / www.texi
1 \input texinfo
2 @documentencoding UTF-8
3 @settitle PyGOST
4
5 @copying
6 Copyright @copyright{} 2015-2017 @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.cypherpunks.ru/gost/, 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.10-2001
34     (@url{https://tools.ietf.org/html/rfc5832.html, RFC 5832})
35     public key signature function
36 @item GOST R 34.10-2012
37     (@url{https://tools.ietf.org/html/rfc7091.html, RFC 7091})
38     public key signature function
39 @item various 34.10 curve parameters included
40 @item VKO GOST R 34.10-2001 key agreement function
41     (@url{https://tools.ietf.org/html/rfc4357.html, RFC 4357})
42 @item VKO GOST R 34.10-2012 key agreement function
43     (@url{https://tools.ietf.org/html/rfc7836.html, RFC 7836})
44 @item 28147-89 and CryptoPro key wrapping
45     (@url{https://tools.ietf.org/html/rfc4357.html, RFC 4357})
46 @item 28147-89 CryptoPro key meshing for CFB mode
47     (@url{https://tools.ietf.org/html/rfc4357.html, RFC 4357})
48 @item @url{https://tools.ietf.org/html/rfc4491.html, RFC 4491}
49     (using GOST algorithms with X.509) compatibility helpers
50 @item GOST R 34.12-2015 128-bit block cipher Кузнечик (Kuznechik)
51     (@url{https://tools.ietf.org/html/rfc7801.html, RFC 7801})
52 @item GOST R 34.13-2015 padding methods
53 @item PEP247-compatible hash/MAC functions
54 @end itemize
55
56 Example 34.10-2012 keypair generation, signing and verifying:
57
58 @verbatim
59 >>> from pygost.gost3410 import CURVE_PARAMS
60 >>> from pygost.gost3410 import GOST3410Curve
61 >>> curve = GOST3410Curve(*CURVE_PARAMS["GostR3410_2012_TC26_ParamSetA"])
62 >>> from os import urandom
63 >>> prv_raw = urandom(32)
64 >>> from pygost.gost3410 import prv_unmarshal
65 >>> prv = prv_unmarshal(prv_raw)
66 >>> from pygost.gost3410 import public_key
67 >>> pub = public_key(curve, prv)
68 >>> from pygost.gost3410 import pub_marshal
69 >>> from pygost.utils import hexenc
70 >>> print "Public key is:", hexenc(pub_marshal(pub))
71 >>> from pygost import gost34112012256
72 >>> data_for_signing = b"some data"
73 >>> dgst = gost34112012256.new(data_for_signing).digest()
74 >>> from pygost.gost3410 import sign
75 >>> signature = sign(curve, prv, dgst, mode=2012)
76 >>> from pygost.gost3410 import verify
77 >>> verify(curve, pub, dgst, signature, mode=2012)
78 True
79 @end verbatim
80
81 Please send questions, bug reports and patches to
82 @url{https://lists.cypherpunks.ru/mailman/listinfo/gost, gost}
83 mailing list. Announcements also go to this mailing list.
84
85 @insertcopying
86
87 @node News
88 @unnumbered News
89
90 @table @strong
91 @item 3.1
92 Fixed mypy stubs related to PEP247-successors.
93
94 @item 3.0
95     @itemize
96     @item @code{gost3411_94} renamed to @code{gost341194}
97     @item @code{gost3411_2012} renamed and split to
98         @code{gost34112012256}, @code{gost34112012512}
99     @item @code{GOST34112012} split to
100         @code{GOST34112012256}, @code{GOST34112012512}
101     @item @code{gost3410.kek} moved to separate
102         @code{gost3410_vko.kek_34102001}
103     @item VKO GOST R 34.10-2012 appeared in @code{gost3410_vko},
104         with test vectors
105     @item 34.11-94 digest is reversed, to be compatible with HMAC and
106         PBKDF2 test vectors describe in TC26 documents
107     @item 34.11-94 PBKDF2 test vectors added
108     @item @code{gost3410.prv_unmarshal},
109         @code{gost3410.pub_marshal},
110         @code{gost3410.pub_unmarshal}
111         helpers added, removing the need of @code{x509} module at all
112     @item @code{gost3410.verify} requires @code{(pubX, pubY)} tuple,
113         instead of two separate @code{pubX}, @code{pubY} arguments
114     @item 34.11-94 based PBKDF2 function added
115     @end itemize
116
117 @item 2.4
118 Fixed 34.13 mypy stub.
119
120 @item 2.3
121 Typo and pylint fixes.
122
123 @item 2.2
124 GOST R 34.13-2015 padding methods
125
126 @item 2.1
127 Documentation and supplementary files refactoring.
128
129 @item 2.0
130 PEP-0247 compatible hashers and MAC.
131
132 @item 1.0
133     @itemize
134     @item Ability to specify curve in pygost.x509 module
135     @item Ability to use 34.10-2012 in pygost.x509 functions
136     @end itemize
137
138     Renamed classes and modules:
139
140     @itemize
141     @item pygost.gost3410.SIZE_34100 -> pygost.gost3410.SIZE_3410_2001
142     @item pygost.gost3410.SIZE_34112 -> pygost.gost3410.SIZE_3410_2012
143     @item pygost.gost3411_12.GOST341112 -> pygost.gost3411_2012.GOST34112012
144     @end itemize
145
146 @item 0.16
147 34.10-2012 TC26 curve parameters.
148
149 @item 0.15
150 PEP-0484 static typing hints.
151
152 @item 0.14
153 34.10-2012 workability fix.
154
155 @item 0.13
156 Python3 compatibility.
157
158 @item 0.11
159 GOST R 34.12-2015 Кузнечик (Kuznechik) implementation.
160
161 @item 0.10
162 CryptoPro and GOST key wrapping, CryptoPro key meshing.
163 @end table
164
165 @node Download
166 @unnumbered Download
167
168 No additional dependencies except Python 2.7/3.x interpreter are required.
169
170 Preferable way is to download tarball with the signature:
171
172 @verbatim
173 % wget http://www.cypherpunks.ru/pygost/pygost-2.3.tar.xz
174 % wget http://www.cypherpunks.ru/pygost/pygost-2.3.tar.xz.sig
175 % gpg --verify pygost-2.3.tar.xz.sig pygost-2.3.tar.xz
176 % xz -d < pygost-2.3.tar.xz | tar xf -
177 % cd pygost-2.3
178 % python setup.py install
179 @end verbatim
180
181 @multitable {XXXXX} {XXXX KiB} {link sign} {xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx} {xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx}
182 @headitem Version @tab Size @tab Tarball @tab SHA256 checksum @tab Streebog-256 checksum
183
184 @item 3.1 @tab 39 KiB
185 @tab @url{pygost-3.1.tar.xz, link} @url{pygost-3.1.tar.xz.sig, sign}
186 @tab @code{ACCCF1A9 F4B345FF 01595248 5B793DAC FCF71D1F 32A6ABCF 32042DDB 20897BC5}
187 @tab @code{823961b6c2a1abe83f6d828397002e68d711a08ce115f21ddff81a294882cd46}
188
189 @item 3.0 @tab 39 KiB
190 @tab @url{pygost-3.0.tar.xz, link} @url{pygost-3.0.tar.xz.sig, sign}
191 @tab @code{0AB10703 6960962D 30BD1646 ACC8D44B E9CBD8A8 4F25DF25 91F26383 DE28875F}
192 @tab @code{ef4729df62b4f615a154a9c35ccffaf6bb614a23067f4dd49d2993ec93bb6665}
193
194 @item 2.4 @tab 37 KiB
195 @tab @url{pygost-2.4.tar.xz, link} @url{pygost-2.4.tar.xz.sig, sign}
196 @tab @code{94D14E99 3CF63973 6C8E78D0 5EBD0838 09A47624 C05A9878 11136301 C0A07264}
197 @tab @code{b107b5ba043a2e4c30d9348e222b92218b8dff9d672964ffd04259c5261bc5a7}
198
199 @item 2.3 @tab 37 KiB
200 @tab @url{pygost-2.3.tar.xz, link} @url{pygost-2.3.tar.xz.sig, sign}
201 @tab @code{FF2C7E78 F3677B45 EB472DC6 1837C72C 0BD72387 AB0A9DC7 AD88AD11 59589732}
202 @tab @code{42cfd0cdf357997a909a9114ca14391b4c5e8b62e298675f899b80a8a26d690f}
203
204 @end multitable
205
206 But also you can use PIP (@strong{no} authentication is performed!):
207
208 @verbatim
209 % pip install pygost==2.3
210 @end verbatim
211
212 You @strong{have to} verify downloaded tarballs integrity and
213 authenticity to be sure that you retrieved trusted and untampered
214 software. @url{https://www.gnupg.org/, The GNU Privacy Guard} is used
215 for that purpose.
216
217 For the very first time it it necessary to get signing public key and
218 import it. It is provided below, but you should check alternative
219 resources.
220
221 @verbatim
222 pub   rsa2048/0xE6FD1269CD0C009E 2016-09-13
223       F55A 7619 3A0C 323A A031  0E6B E6FD 1269 CD0C 009E
224 uid   PyGOST releases <pygost at cypherpunks dot ru>
225 @end verbatim
226
227 @itemize
228
229 @item @url{https://lists.cypherpunks.ru/mailman/listinfo/gost, gost} maillist
230
231 @item
232 @verbatim
233 % gpg --keyserver hkp://keys.gnupg.net/ --recv-keys 0xE6FD1269CD0C009E
234 % gpg --auto-key-locate dane --locate-keys pygost at cypherpunks dot ru
235 % gpg --auto-key-locate wkd --locate-keys pygost at cypherpunks dot ru
236 % gpg --auto-key-locate pka --locate-keys pygost at cypherpunks dot ru
237 @end verbatim
238
239 @item
240 @verbatiminclude PUBKEY.asc
241
242 @end itemize
243
244 You can obtain development source code by cloning
245 @url{http://git-scm.com/, Git}
246 @url{https://git.cypherpunks.ru/cgit.cgi/pygost.git/}.
247
248 @bye