2015 Nsucrypto Article
2015 Nsucrypto Article
2015 Nsucrypto Article
http://dx.doi.org/10.1080/01611194.2016.1260666
ABSTRACT KEYWORDS
A detailed overview of the mathematical problems and their Boolean functions;
solutions for the Second International Students’ Olympiad in competition; NSUCRYPTO;
Cryptography (NSUCRYPTO’2015) is given. The authors Olympiad
consider mathematical problems related to the construction
of special discrete structures associated with cryptographic
applications, highly nonlinear functions, points on an elliptic
curve, crypto machines, solving the Diffie-Hellman problem,
performing any bijective mapping on a binary tape,
modifications of ciphers, and so forth. Some unsolved
problems are also discussed.
1. Introduction
Mathematical problems occupy a special place in cryptography. It is
well-known that mathematical ideas and results often serve as a stimulus
for the creation of modern cryptographic systems. Here, one can mention
concepts of public-key cryptography, algebraic foundations of many
symmetric ciphers, applications of cryptographic Boolean functions,
and so on. It is worth mentioning that the language of cryptography is
rather mathematical.
In this article, we discuss mathematical problems from the Second
International Students’ Olympiad in Cryptography (NSUCRYPTO’2015)
(www.nsucrypto.nsu.ru). It is an annual event devoted to mathematics in
cryptography without restrictions: It is held via the Internet, is comprised
of unsolved mathematical problems, and is open to professionals as well as
for students and senior pupils.
One should note that there are several school competitions in cryptography
such as the Interregional Olympiad in Mathematics and Cryptography for
high school students (www.cryptolymp.ru), the Olympiad in Mathematics
The second round was composed of ten problems; they were common to all
the participants. Two of the problems presented in the second round were
marked as unsolved (and to be awarded special prizes from the Program
Committee).
CRYPTOLOGIA 5
4. Problems
4.1. Problem “Key sharing”
A bank safe can be opened with nine keys inserted in its keyholes in the right
order. The keyholes are arranged in a circle. The order of keys is right if the
sum of the keys (each key is associated with a natural number) in every three
consecutive keyholes is divisible by 3.
The safe has two special features: If you insert a key in a keyhole, you
cannot get it back until all nine keys are inserted; if the order of the nine
inserted keys is wrong, the safe sends the “SOS signal” and blocks itself.
The keys are shared by three people: Alice, Bob, and Caroline. All together
they can insert their keys in the right order and then open the bank safe. Their
keys are the following:
– Alice: {4,14,24};
– Bob: {34,44,54};
– Caroline: {64,74,84}.
Today, Alice, Bob, and Caroline are going to open the safe. One of them for-
got the rule of the right order for the keys and has already inserted two of his
keys into consecutive keyholes, when he was stopped by his friends. Prove that
Alice, Bob, and Caroline still are able to open the safe in this situation.
The question is the following. You know that Alice has sent the following
message to Bob
THE MEETING WILL TAKE PLACE AT THREE IN EEYORE EAGLE BEE CREEK INN
The message has been intercepted by Eve. She has repeated iterations of
destruction until only one bigram remained. Could it be a bigram consisting
of one vowel and one consonant?
For the message R S A , the ciphertext could be (3,1) (3,2) (2,1) or (3,1) (3,2) (4,3).
Mary has encrypted a sentence using this cipher. As a result, she got the
following ciphertext, where all spaces in the text are preserved unchanged:
ð8; 1Þ ð7; 8Þ ð1; 1Þ ð2; 6Þ ð5; 5Þ ð7; 5Þ ð11; 7Þ ð7; 8Þ ð5; 7Þ ð8; 11Þ ð9; 1Þ ð3; 1Þ
ð6; 1Þ ð7; 5Þ ð7; 6Þ ð7; 5Þ ð1; 10Þ ð2; 5Þ ð7; 5Þ ð7; 4Þ ð2; 7Þ ð11; 2Þ ð3; 9Þ ð1; 11Þ
ð6; 3Þ ð7; 8Þ ð7; 5Þ ð11; 6Þ ð7; 9Þ ð1; 5Þ ð9; 8Þ ð1; 4Þ ð7; 5Þ
ð3; 1Þ ð5; 9Þ ð6; 4Þ ð8; 8Þ ð5; 10Þ ð7; 5Þ ð3; 11Þ ð9; 1Þ ð1; 8Þ ð7; 8Þ ð7; 5Þ ð9; 10Þ
Try to read it given that the codeword was 11 letters in length, the encryption
table contained all English letters, and its fragment was the following:
M N O
S T U
R S T
2. Let m be 3 and S(x, y, z) ¼ (x, y, x � z); applying S to the first three symbols:
1 1 1 0 0 0 1 1 1 …
i 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
P(i) 0 16 32 48 1 17 33 49 2 18 34 50 3 19 35 51
i 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
P(i) 4 20 36 52 5 21 37 53 6 22 38 54 7 23 39 55
i 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47
P(i) 8 24 40 56 9 25 41 57 10 26 42 58 11 27 43 59
i 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63
P(i) 12 28 44 60 13 29 45 61 14 30 46 62 15 31 47 63
The key schedule. The user-supplied key is stored in a key register K and
represented as k 79k 78 … k 0. At round i, the 64-bit round key Ki ¼ k63k62 … k0
consists of the 64 leftmost bits of the current contents of register K . Thus, at
round i, we have Ki ¼ k63k62 … k0 ¼ k 79k 78…k 16. After extracting the round
key Ki, the key register K ¼ k 79k 78…k 0 is updated as follows. The key register
is rotated by 61 bit positions to the left, then the left-most four bits
k 79k 78k 77k 76 are passed through the P R E S E N T S-box, and finally the
r o u n d - c o u n t e r value i is XORed with bits k 19k 18k 17k 16k 15 of K with
the least significant bit of r o u n d - c o u n t e r on the right.
CRYPTOLOGIA 11
Peter states that his modification is rather good, but his friend Mark does
not think so. He claims that it is enough to get only two pairs �plaintext–
ciphertext � (P1, C1), (P2, C2), where Ci ¼ P e t e r - P R E S E N T (Pi, K), i ¼ 1,
2, and K is the unknown key, for reading any message C encrypted with this
key K in the ECB mode.
Peter decides to argue with Mark and presents the following pairs, where P1
and P2 form the message ! N S U C R Y P T O - 2 0 1 5 ! (ASCII codes of letters and
little-endian order of bytes are used to form 64-bit integers as the inputs
b63b62 … b0):
!NSUCRYP ! P1 ¼ 5059524355534e21 ! C1 ¼ 2ddbf038b201448f
TO 2015! ! P2 ¼ 21353130322d4f54 ! C2 ¼ d4bf134bd57f4df2
He asks Mark to read the secret message whose ciphertext C is
C ¼37aa471c953defe1 91aa595c0236edc9 80f10a020c33e5cb
ddf14e15923df8dc 8cf8470d027af1db 9caa061e9537ead1
92e10a1e072ea2c0 d1f1501e9b27f2c3 94e750140134e386
92f6595b093de3d2 99ec435b0235ebdc 83ef4b099b37f886
9eef461e4f76eecf 9eaa4912093df8d2 ddf15e129231f8c7
89ec45184f3ee4cf 94e25e5b9c36eddc 87e55a0b9221a2d2
ddae471d0e36a2d2 9aec4b159533efca 98e5495b0b34eb86
9cf643180e34ffc3 89aa4c124f21e4c9 ddf6594ad57aefce
dbfb500e9b34efc5
Can Mark win the argument?
12 S. AGIEVICH ET AL.
The parity of the sum Bigrams I and Bigrams III is invariant, because if
B1 ¼ Bigram I, B2 ¼ Bigram III, their sum is reduced by 2 and the parity is
not changed, if B1 or B2 ¼ Bigram II, the sum is not changed. In the
beginning, this sum is even, so if the number of Bigrams III is equal to
1, then the number of Bigrams I is not equal to 0, so the answer is
negative.
Nineteen participants completely coped with this problem, and some of
them wrote the code, which allows one to obtain the final state (one vowel
and one consonant) from the initial state.
E F G H I J K L M N O
K L M N O P Q R S T U
J K L M N O P Q R S T
The only suitable part seems to be I O N , and it is likely to be the end of the
codeword. Thus, we know rows 9 to 11 of the encryption table. If we suppose
that letter T is before I O N , then the first word of the ciphertext could be T H . .
that corresponds to the codeword …… A T I O N . It allows us to recover the
eighth ciphertext word S I . P . E to S I MP L E and get the first letter I of the
codeword. Step by step, we easily decrypt the whole ciphertext T H I S ME T H O D
18 S. AGIEVICH ET AL.
coincide with each other. So, we must consider only three nontrivial
exponents. As a result, we get that Roman’s public key is 11, and Stephan’s
public key is 5. The chat was the following:
Stephan to Roman: WH A T I S Y O U R F A V O R I T E A D V E N T U R E N O V E L ?
Roman to Stephan: A R O U N D T H E WO R L D I N 8 0 D A Y S .
Anton to Stephan: T H E A D V E N T U R E S O F T O M S A WY E R
The problem was solved by eight students, but none of them used the
solution described above; they found the answer by applying frequency
analysis only. They said that different substitution ciphers were used without
explaining why there were no secret keys exchanges. The most detailed
solution was provided by Evgeniy Strepetov (Saratov State University). It is
interesting to mention the favorite books of the participants: Treasure Island,
The Mysterious Island, The Children of Captain Grant, The Inhabited Island,
and The Adventures of Tintin.
Since the machine now has two primitive functions NOT and AND, every
Boolean function can be computed and any vectorial Boolean function as well.
Therefore, the necessary and sufficient conditions are (1) S(0m) ≠ 0m; (2) S is
not affine.
Other full solutions were proposed by Alexey Miloserdov, Nikita Odinokih,
Saveliy Skresanov (Novosibirsk State University), and Samir Godzhaev, Ravil
Khisamov (Lomonosov Moscow State University).
Their method was based on the fact that Peter’s modification of the key sched-
ule is weak. Namely, we can form four groups of 20 secret key bits that are
independently used to encrypt/decipher four groups of corresponding 16 bits
of plaintext/ciphertext. Thus, given a pair of plaintext and ciphertext, we can
separately solve four tasks with complexity 220 to recover all bits of the
unknown secret key instead of the complexity 280 of brute force.
since for the given element it puts into correspondence the multiplicative
inverse element in GF(2n). The classic result related to our problem can be
found in Nyberg (1994). It is proven there that the nonlinearity of this func-
tion has the following lower bound: nlF ≥ 2n−1 − 2n/2. The answer is positive
since all of the conditions are fulfilled.
From an arbitrary y � L, we can take (uniquely) the vector z such that it has
zeros in the first k coordinates, because the first k columns of the matrix M0
form a nonsingular square matrix. Moreover, the arbitrary vector z with zeros
in the first k coordinates lies in z � L. We can limit our search from Fn2 to
L� ¼ fz 2 Fn2 : z1 ¼ z2 ¼ � � � ¼ zk ¼ 0g.
Let y be a vector from Fn2 . We can express it as y ¼ (y1|y2), where
y1 ; y2 2 Fk2 . Then, all vectors from L* are of the form z ¼ (0|z2). Consider
the following procedure (P*)
1. s: ¼ 1, K ¼ h;
2. If the s-th and (s + 1)-th coordinates of z2 are both 1, then z : ¼ z � es, add s
and s + 1 to K (if s ¼ k then (s + 1) → 1);
3. s : ¼ s + 1;
4. If s is greater than k, then STOP; otherwise, go to step 2.
Applying this to any vector z 2 L* we get some vector a ¼ z � x, x 2 L.
Obviously, a2 has no consecutive 1s, because what the algorithm does is
eliminate them (here a2 is viewed as a cyclic vector). Assume that l basis vec-
tors were added to z during the procedure. Then, wt(a1) ¼ l.
Consider the vector a�2 of length k − 2l obtained from a2 by deleting coor-
dinates that are in the set K (a2 has zeros in these coordinates). If there are two
consecutive 1s in the vector a�2 , (here a�2 is not viewed as a cyclic vector), then
they were either consecutive in vector a2, or they were not. The first is imposs-
ible, as has already been mentioned earlier. The second means that in the vec-
tor a2 there is 1 in position s that precedes position (s + 1) from the set K. This
is also impossible, because in this case the algorithm would have eliminated
the 1 in position s first. There are no consecutive 1s in the vector a�2 , and
therefore not more than dk 22le ones in the vector a�2 (and also in a2). There-
fore, the weight of a is not greater than dk 22le þ l ¼ dk2e. In other words,
� �
k
dðLÞ � dðz; LÞ � dðz; xÞ ¼ wtðaÞ �
2
Now let us show that this is the exact value. Let z* ¼ (0|1). Addition of
any basis vector adds one 1 to the first half of z* and removes not more than
two from the second. Therefore, for any x from L we have d(x, z*) ¼ wt(x �
z*) ≥ wt(z*) + l − 2l ¼ k − l, where l is the number of basis vectors in the
decomposition of x. If l is not greater than bk2c, then through the obtained
inequality we get that dðx; z� Þ � dk2e. If l is not less than dk2e, then the weight
of the first half of x � z* alone is not less than d2ke, and d(x, z*) is also not
less than that. For any x 2 L, we have dðx; z� Þ � d2ke, which proves that d(L)
is equal to d2ke.
If k is odd, then this is the only vector from L* that is in the metric
complement. Let z be any other vector from L*. Permute the last k coordinates
cyclically so that the last coordinate of z is zero (the second half of the matrix
24 S. AGIEVICH ET AL.
stays the same until the permutation of the rows). After applying (P*), we get the
vector a such that wt(a1) ¼ l and wtða2 Þ � bk 22lc, because a�2 is of odd length,
has zero at the end, and has no two consecutive 1s. So dðz; LÞ � wtðaÞ � b2kc.
Let k be even, z 2 L*, z ≠ z*. Let z2 (as a cyclic vector) have a group of con-
secutive 1s of even size 2j. We can add j basis vectors to z so that this group is
eliminated, getting the vector a. Now we have a group of at least 2j + 2 zeros
in a2 (to the left and right from that group of 1s, there were zeros, too).
Excluding this group from a2 and applying (P*) to the resulting (this time
not cyclic) vector a02 of length k − 2j − 2, we add l basis vectors, and the result-
ing b2 has not more than k 2j 2 2 2l ¼ 2k j l 1 ones, because b�2 cannot
have more than two consecutive 1s (it can have two because of that removed
coordinates breaking cyclicity). If we put everything together, the resulting
vector has weight not greater than j þ l þ 2k j l 1 ¼ 2k 1. So, z can
not be in the metric complement.
This argument can be applied to vectors z so that z2 has two consecutive
zeros by assuming there is a group of 0 ones between those two zeros.
Now let us assume that the second half of z 2 L* does not have two con-
secutive zeros and all groups of consecutive ones are of odd size. Let x 2 L
be the closest vector to z. If the decomposition of x has two consecutive basis
vectors, then they add 2 to the weight of (z � x)1 and subtract no more than 2
from the weight of (z � x)2, so we can remove them. So without loss of
generality the decomposition of x does not have two consecutive basis vectors.
Due to this, if the s-th and (s + 1)-th coordinates of z2 are (01), (00), or (10),
then es is also not in x, because it would only add to the distance. With that in
mind, every group of ones (of odd size) is independent from others in the
sense that if es is in x, then all two 1s of the second half of es are in the same
group. Every group of size 2j − 1 contributes exactly j to the distance (as
proved for z*), and has one zero after it, so the vector z2 can be split in groups
of even size 2j of the form (111…0), each adding j to the distance. Thus, the
distance from x to z is equal to 2k.
All in all, d(X) is equal to d2ke, the metric complement consists of
– z* � L, whereSz* ¼ (0|1), if k is odd;
– z* � L and z � L, where Lodd is the set of vectors from L* such that
z2Lodd
their second half does not have two consecutive zeros, and all groups of
consecutive ones are of odd size, if k is even.
and g0 (x) has a common factor x − a over Fp, where g(x) ¼ x3 + 56x + 6 and g0
(x) ¼ 3x2 + 56. Since 3g(x) − xg0 (x) ¼ 2(56x + 9), we know that x − a is also a
factor of 2(56x + 9).
Note that p must be odd, since for any b 2 2Z, b2 mod 4 ¼ 0, and a3 + 56a
+ 6 mod 4 ¼ a3 + 2 mod 4 will never be 0. Then, a3 + 56a + 6 ¼ 1 mod 8,
which gives a mod 8 ¼ 3. Similarly, we know that p ≠ 3; 7. Polynomials x − a
and 2(56x + 9) are of the same degree, we know a ¼ −9·(56)−1 mod p.
Note that g0 (a) ¼ 0. Then we have 3·81 + 563 ¼ 0 mod p, which is
175859 ¼ 0 mod p. Since 175859 is a prime, we know that p ¼ 175859.
However, x3 + 56x + 6 ¼ 0 mod p has no solution over Fp, which means that
there are no integer points on the curve y2 ¼ x3 + 56x + 6.
Many participants obtained partial results. The majority of them used
modular arithmetic and tried to find restrictions on possible values of
variables.
ciphertext by trying out the dates in inverse order from the date of the
Olympiad start 16.11.2015.
The key 0 1 1 1 2 0 1 5 4 2 9 3 0 2 0 1 decrypts the ciphertext as:
Q u o t e o f t h e d a y : �Mo s t p e o p l e s a y t h a t i t i s t h e
i n t e l l e c t wh i c h ma k e s a g r e a t s c i e n t i s t . T h e y a r e
wr o n g : i t i s c h a r a c t e r . A l b e r t E i n s t e i n �
Winners of the first round in the student section B (in the category
“professionals”)
and Mechanics at Novosibirsk State University. Her research interests include Boolean func-
tions in cryptography, bent functions, block and stream ciphers, cryptanalysis, coding theory,
combinatorics, and algebra.
Acknowledgments
We are very grateful to Gennadiy Agibalov, Svetla Nikova, Irina Pankratova, Bart Preneel,
and Vincent Rijmen for their valuable contribution to this article: ideas for the problems
and all-out support. We thank Alexey Oblaukhov for his kind help during the Olympiad
and in the process of writing this article. We thank Novosibirsk State University for the
financial support of the Olympiad and invite you to take part in NSUCRYPTO-2017 that starts
on 22 October 2017. Your ideas on the unsolved problems are also very welcome and can be
sent to [email protected].
Funding
The article was financially supported by RFBR (grants 15-07-01328, 15-31-20635), by the Min-
istry of Education and Science of the Russian Federation and grant N 0314-2015-0011.
References
Agibalov, G. 2007. Normal reccurent sequences, Bulletin of Tomsk State University.
Supplement. 23:4–11 (in Russian).
Agievich, S., Gorodilova, A., Kolomeec, N., Nikova, S., Preneel, B., Rijmen, V., Shushuev, G.,
Tokareva, N., Vitkup, V. 2015. Problems, solutions and experience of the First International
Students’ Olympiad in Cryptography. Applied Discrete Mathematics (Prikl. Diskret.
Matemat.). 3:41–62.
Bell, C. 2013. The internet mystery that has the world baffled. The Telegraph, 25 November,
www.telegraph.co.uk/technology/internet/10468112/The-internet-mystery-that-has-the-world-
baffled.html.
Bogdanov, A., Knudsen, L. R., Leander, G., Paar, C., Poschmann, A., Robshaw, M. J. B., Seurin,
Y., Vikkelsoe, C. 2007. PRESENT: An ultra-lightweight block cipher. In Cryptographic
Hardware and Embedded Systems — CHES. LNCS 4727:450–466. Berlin: Springer.
Burton, B. A. 2008. Breaking the routine: Events to complement Informatics Olympiad training.
Olympiads in Informatics. 2:5–15.
Diffie, W., Hellman, M. E. 1976. New Directions in Cryptography. IEEE Transactions on
Information Theory, IT-22(6):644–654.
National Bureau of Standards. 1977. Data Encryption Standard. FIPS publication, N. 46, U. S.
Department of Commerce.
Nyberg, K. 1994. Differentially uniform mappings for cryptography. In Advances in Cryptology
– EUROCRYPT’93 LNCS 765:55–64. Berlin: Springer.
Schneier, B. 1994. Description of a new variable-length key, 64-bit block cipher (Blowfish).
Fast Software Encryption, LNCS 809:191–204. Berlin: Springer.