]> Cypherpunks.ru repositories - gost-www.git/blobdiff - en/meshing.texi
Key meshing example
[gost-www.git] / en / meshing.texi
index 6bf3c5fc785bd1b84b759433b3ea08ee2d3d06d7..2521f7147a8e078105b8ab64dd5d233fa2e04620 100644 (file)
@@ -3,13 +3,21 @@
 
 There is no key meshing western algorithm analogue. That algorithm
 changes cipherkey each kilobyte of data processed. It is used together
-with @ref{en2814789, Magma} and is defined in
+with @ref{en2814789, GOST 28147-89} and is defined in
 @url{https://tools.ietf.org/html/rfc4357.html, RFC 4357}. CryptoPro
 developers tell that it is intended to resist side-channel attacks.
 
 Implementation is rather simple and uses two crypt/decrypt operations
 over the key and initialization vector.
 
+@verbatim
+# for each KiB of data
+def mesh(old_key, old_iv):
+    new_key = ecb_decrypt(old_key, MESH_CONST)
+    new_iv = ecb_encrypt(old_key, old_iv)
+    return new_key, new_iv
+@end verbatim
+
 It has already showed usefulness: there is @url{https://sweet32.info/,
 Sweet32} attack on all 64-bit blockciphers, that is not applicable to
-Magma with key meshing used.
+when key meshing used.