]> Cypherpunks.ru repositories - pygost.git/blob - www.texi
pygost. and gost. homepages
[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://gost.cypherpunks.ru/, more}.
19
20 Site is also available as @url{http://ynvvto3unx63wbqmwg7mpdgy3ebven7ihhse6bh5yudwllugd6oa.b32.i2p/, I2P service}.
21
22 Currently supported algorithms are:
23
24 @itemize
25 @item GOST 28147-89 (@url{https://tools.ietf.org/html/rfc5830.html, RFC 5830})
26     block cipher with ECB, CNT (CTR), CFB, MAC,
27     CBC (@url{https://tools.ietf.org/html/rfc4357.html, RFC 4357})
28     modes of operation
29 @item various 28147-89-related S-boxes included
30 @item GOST R 34.11-94 hash function
31     (@url{https://tools.ietf.org/html/rfc5831.html, RFC 5831})
32 @item GOST R 34.11-94 based @url{https://en.wikipedia.org/wiki/PBKDF2, PBKDF2} function
33 @item GOST R 34.11-2012 Стрибог (Streebog) hash function
34     (@url{https://tools.ietf.org/html/rfc6986.html, RFC 6986})
35 @item GOST R 34.10-2001
36     (@url{https://tools.ietf.org/html/rfc5832.html, RFC 5832})
37     public key signature function
38 @item GOST R 34.10-2012
39     (@url{https://tools.ietf.org/html/rfc7091.html, RFC 7091})
40     public key signature function
41 @item various 34.10 curve parameters included
42 @item VKO GOST R 34.10-2001 key agreement function
43     (@url{https://tools.ietf.org/html/rfc4357.html, RFC 4357})
44 @item VKO GOST R 34.10-2012 key agreement function
45     (@url{https://tools.ietf.org/html/rfc7836.html, RFC 7836})
46 @item 28147-89 and CryptoPro key wrapping
47     (@url{https://tools.ietf.org/html/rfc4357.html, RFC 4357})
48 @item 28147-89 CryptoPro key meshing for CFB mode
49     (@url{https://tools.ietf.org/html/rfc4357.html, RFC 4357})
50 @item @url{https://tools.ietf.org/html/rfc4491.html, RFC 4491}
51     (using GOST algorithms with X.509) compatibility helpers
52 @item GOST R 34.12-2015 128-bit block cipher Кузнечик (Kuznechik)
53     (@url{https://tools.ietf.org/html/rfc7801.html, RFC 7801})
54 @item GOST R 34.12-2015 64-bit block cipher Магма (Magma)
55 @item GOST R 34.13-2015 padding methods and block cipher modes of operation
56       (ECB, CTR, OFB, CBC, CFB, MAC)
57 @item PEP247-compatible hash/MAC functions
58 @end itemize
59
60 Example 34.10-2012 keypair generation, signing and verifying:
61
62 @verbatim
63 >>> from pygost.gost3410 import CURVE_PARAMS
64 >>> from pygost.gost3410 import GOST3410Curve
65 >>> curve = GOST3410Curve(*CURVE_PARAMS["GostR3410_2012_TC26_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()
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 verbatim
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 @node News
92 @unnumbered News
93
94 @table @strong
95 @item 3.3
96     @itemize
97     @item @code{GOST3412Kuz} renamed to @code{GOST3412Kuznechik}
98     @item @code{GOST3412Magma} implements GOST R 34.12-2015 Magma 64-bit
99         block cipher
100     @end itemize
101
102 @item 3.2
103 34.13-2015 block cipher modes of operation implementations.
104
105 @item 3.1
106 Fixed mypy stubs related to PEP247-successors.
107
108 @item 3.0
109     @itemize
110     @item @code{gost3411_94} renamed to @code{gost341194}
111     @item @code{gost3411_2012} renamed and split to
112         @code{gost34112012256}, @code{gost34112012512}
113     @item @code{GOST34112012} split to
114         @code{GOST34112012256}, @code{GOST34112012512}
115     @item @code{gost3410.kek} moved to separate
116         @code{gost3410_vko.kek_34102001}
117     @item VKO GOST R 34.10-2012 appeared in @code{gost3410_vko},
118         with test vectors
119     @item 34.11-94 digest is reversed, to be compatible with HMAC and
120         PBKDF2 test vectors describe in TC26 documents
121     @item 34.11-94 PBKDF2 test vectors added
122     @item @code{gost3410.prv_unmarshal},
123         @code{gost3410.pub_marshal},
124         @code{gost3410.pub_unmarshal}
125         helpers added, removing the need of @code{x509} module at all
126     @item @code{gost3410.verify} requires @code{(pubX, pubY)} tuple,
127         instead of two separate @code{pubX}, @code{pubY} arguments
128     @item 34.11-94 based PBKDF2 function added
129     @end itemize
130
131 @item 2.4
132 Fixed 34.13 mypy stub.
133
134 @item 2.3
135 Typo and pylint fixes.
136
137 @item 2.2
138 GOST R 34.13-2015 padding methods
139
140 @item 2.1
141 Documentation and supplementary files refactoring.
142
143 @item 2.0
144 PEP-0247 compatible hashers and MAC.
145
146 @item 1.0
147     @itemize
148     @item Ability to specify curve in pygost.x509 module
149     @item Ability to use 34.10-2012 in pygost.x509 functions
150     @end itemize
151
152     Renamed classes and modules:
153
154     @itemize
155     @item pygost.gost3410.SIZE_34100 -> pygost.gost3410.SIZE_3410_2001
156     @item pygost.gost3410.SIZE_34112 -> pygost.gost3410.SIZE_3410_2012
157     @item pygost.gost3411_12.GOST341112 -> pygost.gost3411_2012.GOST34112012
158     @end itemize
159
160 @item 0.16
161 34.10-2012 TC26 curve parameters.
162
163 @item 0.15
164 PEP-0484 static typing hints.
165
166 @item 0.14
167 34.10-2012 workability fix.
168
169 @item 0.13
170 Python3 compatibility.
171
172 @item 0.11
173 GOST R 34.12-2015 Кузнечик (Kuznechik) implementation.
174
175 @item 0.10
176 CryptoPro and GOST key wrapping, CryptoPro key meshing.
177 @end table
178
179 @node Download
180 @unnumbered Download
181
182 No additional dependencies except Python 2.7/3.x interpreter are required.
183
184 Preferable way is to download tarball with the signature:
185
186 @verbatim
187 % wget http://pygost.cypherpunks.ru/pygost-2.3.tar.xz
188 % wget http://pygost.cypherpunks.ru/pygost-2.3.tar.xz.sig
189 % gpg --verify pygost-2.3.tar.xz.sig pygost-2.3.tar.xz
190 % xz -d < pygost-2.3.tar.xz | tar xf -
191 % cd pygost-2.3
192 % python setup.py install
193 @end verbatim
194
195 @multitable {XXXXX} {XXXX KiB} {link sign} {xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx} {xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx}
196 @headitem Version @tab Size @tab Tarball @tab SHA256 checksum @tab Streebog-256 checksum
197
198 @item 3.3 @tab 41 KiB
199 @tab @url{pygost-3.3.tar.xz, link} @url{pygost-3.3.tar.xz.sig, sign}
200 @tab @code{D118F539 537CCD5D 9CCE850E DD8EFD8E ACDA9D6E 0C113A0F C575574A F4BD452A}
201 @tab @code{8400a3714b70dddfef03f6fe96325e73ac25db814d052a44dbd8f2ce5ddb05bb}
202
203 @item 3.2 @tab 41 KiB
204 @tab @url{pygost-3.2.tar.xz, link} @url{pygost-3.2.tar.xz.sig, sign}
205 @tab @code{6779D1B1 A4E2B1C3 49CA39F8 425FC962 AF2ED133 BB495343 0F83764B E2624087}
206 @tab @code{0a39880ad00ca11d112fef096b81a42a85ce4e5b25c48d1f643858b1e0c520d6}
207
208 @item 3.1 @tab 39 KiB
209 @tab @url{pygost-3.1.tar.xz, link} @url{pygost-3.1.tar.xz.sig, sign}
210 @tab @code{ACCCF1A9 F4B345FF 01595248 5B793DAC FCF71D1F 32A6ABCF 32042DDB 20897BC5}
211 @tab @code{823961b6c2a1abe83f6d828397002e68d711a08ce115f21ddff81a294882cd46}
212
213 @item 3.0 @tab 39 KiB
214 @tab @url{pygost-3.0.tar.xz, link} @url{pygost-3.0.tar.xz.sig, sign}
215 @tab @code{0AB10703 6960962D 30BD1646 ACC8D44B E9CBD8A8 4F25DF25 91F26383 DE28875F}
216 @tab @code{ef4729df62b4f615a154a9c35ccffaf6bb614a23067f4dd49d2993ec93bb6665}
217
218 @item 2.4 @tab 37 KiB
219 @tab @url{pygost-2.4.tar.xz, link} @url{pygost-2.4.tar.xz.sig, sign}
220 @tab @code{94D14E99 3CF63973 6C8E78D0 5EBD0838 09A47624 C05A9878 11136301 C0A07264}
221 @tab @code{b107b5ba043a2e4c30d9348e222b92218b8dff9d672964ffd04259c5261bc5a7}
222
223 @item 2.3 @tab 37 KiB
224 @tab @url{pygost-2.3.tar.xz, link} @url{pygost-2.3.tar.xz.sig, sign}
225 @tab @code{FF2C7E78 F3677B45 EB472DC6 1837C72C 0BD72387 AB0A9DC7 AD88AD11 59589732}
226 @tab @code{42cfd0cdf357997a909a9114ca14391b4c5e8b62e298675f899b80a8a26d690f}
227
228 @end multitable
229
230 But also you can use PIP (@strong{no} authentication is performed!):
231
232 @verbatim
233 % pip install pygost==2.3
234 @end verbatim
235
236 You @strong{have to} verify downloaded tarballs integrity and
237 authenticity to be sure that you retrieved trusted and untampered
238 software. @url{https://www.gnupg.org/, The GNU Privacy Guard} is used
239 for that purpose.
240
241 For the very first time it it necessary to get signing public key and
242 import it. It is provided below, but you should check alternative
243 resources.
244
245 @verbatim
246 pub   rsa2048/0xE6FD1269CD0C009E 2016-09-13
247       F55A 7619 3A0C 323A A031  0E6B E6FD 1269 CD0C 009E
248 uid   PyGOST releases <pygost at cypherpunks dot ru>
249 @end verbatim
250
251 @itemize
252
253 @item @url{https://lists.cypherpunks.ru/mailman/listinfo/gost, gost} maillist
254
255 @item
256 @verbatim
257 % gpg --keyserver hkp://keys.gnupg.net/ --recv-keys 0xE6FD1269CD0C009E
258 % gpg --auto-key-locate dane --locate-keys pygost at cypherpunks dot ru
259 % gpg --auto-key-locate wkd --locate-keys pygost at cypherpunks dot ru
260 % gpg --auto-key-locate pka --locate-keys pygost at cypherpunks dot ru
261 @end verbatim
262
263 @item
264 @verbatiminclude PUBKEY.asc
265
266 @end itemize
267
268 You can obtain development source code by cloning
269 @url{http://git-scm.com/, Git}
270 @url{https://git.cypherpunks.ru/cgit.cgi/pygost.git/}.
271
272 @bye