0% found this document useful (0 votes)
0 views

Cryptography And Cryptanalysis In Matlab Creating And Programming Advanced Algorithms 1st Edition Marius Iulian Mihailescu instant download

The document is about the book 'Cryptography and Cryptanalysis in MATLAB: Creating and Programming Advanced Algorithms' by Marius Iulian Mihailescu and Stefania Loredana Nita, which covers various topics in cryptography and cryptanalysis using MATLAB. It includes chapters on cryptographic functions, number theory, classic cryptography, pseudo-random number generators, hash functions, and block ciphers like DES and AES. The book aims to provide readers with practical implementations and a comprehensive understanding of advanced algorithms in cryptography.

Uploaded by

salkinsalhen
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
0 views

Cryptography And Cryptanalysis In Matlab Creating And Programming Advanced Algorithms 1st Edition Marius Iulian Mihailescu instant download

The document is about the book 'Cryptography and Cryptanalysis in MATLAB: Creating and Programming Advanced Algorithms' by Marius Iulian Mihailescu and Stefania Loredana Nita, which covers various topics in cryptography and cryptanalysis using MATLAB. It includes chapters on cryptographic functions, number theory, classic cryptography, pseudo-random number generators, hash functions, and block ciphers like DES and AES. The book aims to provide readers with practical implementations and a comprehensive understanding of advanced algorithms in cryptography.

Uploaded by

salkinsalhen
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 81

Cryptography And Cryptanalysis In Matlab

Creating And Programming Advanced Algorithms 1st


Edition Marius Iulian Mihailescu download

https://ebookbell.com/product/cryptography-and-cryptanalysis-in-
matlab-creating-and-programming-advanced-algorithms-1st-edition-
marius-iulian-mihailescu-34607982

Explore and download more ebooks at ebookbell.com


Here are some recommended products that we believe you will be
interested in. You can click the link to download.

Cryptography And Cryptanalysis In Java 2nd Edition 2nd Edition


Stefania Loredana Nita

https://ebookbell.com/product/cryptography-and-cryptanalysis-in-
java-2nd-edition-2nd-edition-stefania-loredana-nita-58449812

Cryptography And Cryptanalysis In Java Creating And Programming


Advanced Algorithms With Java Se 17 Lts And Jakarta Ee 10 1st Edition
Stefania Loredana Nita

https://ebookbell.com/product/cryptography-and-cryptanalysis-in-java-
creating-and-programming-advanced-algorithms-with-java-se-17-lts-and-
jakarta-ee-10-1st-edition-stefania-loredana-nita-42712576

Pro Cryptography And Cryptanalysis With C20 Marius Iulian Mihailescu

https://ebookbell.com/product/pro-cryptography-and-cryptanalysis-
with-c20-marius-iulian-mihailescu-46619890

Pro Cryptography And Cryptanalysis With C23 Creating And Programming


Advanced Algorithms 2nd Edition Marius Iulian Mihailescu

https://ebookbell.com/product/pro-cryptography-and-cryptanalysis-
with-c23-creating-and-programming-advanced-algorithms-2nd-edition-
marius-iulian-mihailescu-50581684
Pro Cryptography And Cryptanalysis Creating Advanced Algorithms With C
And Net 1st Edition Marius Iulian Mihailescu

https://ebookbell.com/product/pro-cryptography-and-cryptanalysis-
creating-advanced-algorithms-with-c-and-net-1st-edition-marius-iulian-
mihailescu-52878520

Pro Cryptography And Cryptanalysis Creating Advanced Algorithms With C


And Net 1st Edition Marius Iulian Mihailescu Stefania Loredana Nita

https://ebookbell.com/product/pro-cryptography-and-cryptanalysis-
creating-advanced-algorithms-with-c-and-net-1st-edition-marius-iulian-
mihailescu-stefania-loredana-nita-15202074

Pro Cryptography And Cryptanalysis With C23 Creating And Programming


Advanced Algorithms 2nd Edition Marius Iulian Mihailescu

https://ebookbell.com/product/pro-cryptography-and-cryptanalysis-
with-c23-creating-and-programming-advanced-algorithms-2nd-edition-
marius-iulian-mihailescu-50594372

Pro Cryptography And Cryptanalysis With C23 Creating And Programming


Advanced Algorithms 2nd Edition 2nd Edition Marius Iulian Mihailescu

https://ebookbell.com/product/pro-cryptography-and-cryptanalysis-
with-c23-creating-and-programming-advanced-algorithms-2nd-edition-2nd-
edition-marius-iulian-mihailescu-50569844

History Of Cryptography And Cryptanalysis Codes Ciphers And Their


Algorithms 1st Edition John F Dooley

https://ebookbell.com/product/history-of-cryptography-and-
cryptanalysis-codes-ciphers-and-their-algorithms-1st-edition-john-f-
dooley-7322434
Cryptography
and Cryptanalysis
in MATLAB
Creating and Programming
Advanced Algorithms

Marius Iulian Mihailescu
Stefania Loredana Nita
Cryptography and
Cryptanalysis in MATLAB
Creating and Programming
Advanced Algorithms

Marius Iulian Mihailescu


Stefania Loredana Nita
Cryptography and Cryptanalysis in MATLAB: Creating and Programming
Advanced Algorithms
Marius Iulian Mihailescu Stefania Loredana Nita
Bucharest, Romania Bucharest, Romania

ISBN-13 (pbk): 978-1-4842-7333-3 ISBN-13 (electronic): 978-1-4842-7334-0


https://doi.org/10.1007/978-1-4842-7334-0

Copyright © 2021 Marius Iulian Mihailescu and Stefania Loredana Nita


This work is subject to copyright. All rights are reserved by the Publisher, whether the whole or part of the
material is concerned, specifically the rights of translation, reprinting, reuse of illustrations, recitation,
broadcasting, reproduction on microfilms or in any other physical way, and transmission or information
storage and retrieval, electronic adaptation, computer software, or by similar or dissimilar methodology now
known or hereafter developed.
Trademarked names, logos, and images may appear in this book. Rather than use a trademark symbol with
every occurrence of a trademarked name, logo, or image we use the names, logos, and images only in an
editorial fashion and to the benefit of the trademark owner, with no intention of infringement of the
trademark.
The use in this publication of trade names, trademarks, service marks, and similar terms, even if they are not
identified as such, is not to be taken as an expression of opinion as to whether or not they are subject to
proprietary rights.
While the advice and information in this book are believed to be true and accurate at the date of publication,
neither the authors nor the editors nor the publisher can accept any legal responsibility for any errors or
omissions that may be made. The publisher makes no warranty, express or implied, with respect to the
material contained herein.
Managing Director, Apress Media LLC: Welmoed Spahr
Acquisitions Editor: Steve Anglin
Development Editor: Matthew Moodie
Editorial Operations Manager: Mark Powers
Cover designed by eStudioCalamar
Cover image by Devin Avery on Unsplash (www.unsplash.com)
Distributed to the book trade worldwide by Apress Media, LLC, 1 New York Plaza, New York, NY 10004,
U.S.A. Phone 1-800-SPRINGER, fax (201) 348-4505, e-mail orders-ny@springer-sbm.com, or visit www.
springeronline.com. Apress Media, LLC is a California LLC and the sole member (owner) is Springer
Science + Business Media Finance Inc (SSBM Finance Inc). SSBM Finance Inc is a Delaware corporation.
For information on translations, please e-mail booktranslations@springernature.com; for reprint,
paperback, or audio rights, please e-mail bookpermissions@springernature.com.
Apress titles may be purchased in bulk for academic, corporate, or promotional use. eBook versions and
licenses are also available for most titles. For more information, reference our Print and eBook Bulk Sales
web page at http://www.apress.com/bulk-sales.
Any source code or other supplementary material referenced by the author in this book is available to
readers on GitHub via the book’s product page, located at www.apress.com/9781484273333. For more
detailed information, please visit http://www.apress.com/source-­code.
Printed on acid-free paper
To our families and wonderful readers. May this book be a true
inspiration for everyone…and remember: “If you think technology can
solve your security problems, then you don’t understand the problems
and you don’t understand technology.” – Bruce Schneier
Table of Contents
About the Authors���������������������������������������������������������������������������������������������������� xi

About the Technical Reviewer������������������������������������������������������������������������������� xiii

Chapter 1: Getting Started in Cryptography and Cryptanalysis�������������������������������� 1


Cryptography and Cryptanalysis��������������������������������������������������������������������������������������������������� 2
Book Structure������������������������������������������������������������������������������������������������������������������������������ 3
Conclusion������������������������������������������������������������������������������������������������������������������������������������ 5
References������������������������������������������������������������������������������������������������������������������������������������ 6

Chapter 2: MATLAB Cryptography Functions������������������������������������������������������������ 7


Conclusion���������������������������������������������������������������������������������������������������������������������������������� 15
References���������������������������������������������������������������������������������������������������������������������������������� 16

Chapter 3: Conversions Used in MATLAB for Cryptography������������������������������������ 17


Conclusion���������������������������������������������������������������������������������������������������������������������������������� 23
References���������������������������������������������������������������������������������������������������������������������������������� 23

Chapter 4: Basic Arithmetic Foundations��������������������������������������������������������������� 25


Euclid’s Division Lemma������������������������������������������������������������������������������������������������������������� 26
Greatest Common Divisor (gcd)�������������������������������������������������������������������������������������������������� 27
Euclid’s Algorithm����������������������������������������������������������������������������������������������������������������������� 27
The Extended Euclidean Algorithm��������������������������������������������������������������������������������������������� 28
Practical Implementations���������������������������������������������������������������������������������������������������������� 28
The Extended Euclidean Algorithm���������������������������������������������������������������������������������������� 28
Prime Factors in MATLAB������������������������������������������������������������������������������������������������������ 30
Computing the Modular Inverse�������������������������������������������������������������������������������������������� 31
Conclusion���������������������������������������������������������������������������������������������������������������������������������� 32
References���������������������������������������������������������������������������������������������������������������������������������� 32

v
Table of Contents

Chapter 5: Number Theory�������������������������������������������������������������������������������������� 35


Primality and Factorization��������������������������������������������������������������������������������������������������������� 35
Prime Numbers���������������������������������������������������������������������������������������������������������������������� 35
The Prime Number Theorem�������������������������������������������������������������������������������������������������� 38
Congruency��������������������������������������������������������������������������������������������������������������������������� 39
Inverse����������������������������������������������������������������������������������������������������������������������������������� 39
Chinese Remainder Theorem������������������������������������������������������������������������������������������������ 39
Primality Tests����������������������������������������������������������������������������������������������������������������������������� 40
The Wilson Primality Test������������������������������������������������������������������������������������������������������� 40
The Little Fermat Primality Test��������������������������������������������������������������������������������������������� 42
The Miller-Rabin Primality Test���������������������������������������������������������������������������������������������� 47
Algebraic Structures������������������������������������������������������������������������������������������������������������������� 47
Conclusion���������������������������������������������������������������������������������������������������������������������������������� 49
References���������������������������������������������������������������������������������������������������������������������������������� 49

Chapter 6: Classic Cryptography���������������������������������������������������������������������������� 51


Symmetric Cryptography������������������������������������������������������������������������������������������������������������ 51
Classic Ciphers��������������������������������������������������������������������������������������������������������������������������� 52
The Caesar Cipher����������������������������������������������������������������������������������������������������������������� 53
The Vigenère Cipher�������������������������������������������������������������������������������������������������������������� 57
The Hill Cipher����������������������������������������������������������������������������������������������������������������������� 63
Conclusion���������������������������������������������������������������������������������������������������������������������������������� 66
References���������������������������������������������������������������������������������������������������������������������������������� 67

Chapter 7: Pseudo-Random Number Generators���������������������������������������������������� 69


Simple PRNGs����������������������������������������������������������������������������������������������������������������������������� 71
Linear Congruential Generators��������������������������������������������������������������������������������������������� 71
Ranrot Generators����������������������������������������������������������������������������������������������������������������� 72
Blum-Blum-Shub Generator�������������������������������������������������������������������������������������������������� 73
Linear Circuit PRNGs������������������������������������������������������������������������������������������������������������������� 74
Other PRNGs������������������������������������������������������������������������������������������������������������������������������� 75
Practical Implementations���������������������������������������������������������������������������������������������������������� 75

vi
Table of Contents

Conclusion���������������������������������������������������������������������������������������������������������������������������������� 80
References���������������������������������������������������������������������������������������������������������������������������������� 80

Chapter 8: Hash Functions�������������������������������������������������������������������������������������� 83


Security of Hash Functions��������������������������������������������������������������������������������������������������������� 84
Cryptographic Hash Functions���������������������������������������������������������������������������������������������� 84
Birthday Attack���������������������������������������������������������������������������������������������������������������������� 85
MD4 Function������������������������������������������������������������������������������������������������������������������������������ 89
MD4 Function Description����������������������������������������������������������������������������������������������������� 89
Cryptanalysis of MD4������������������������������������������������������������������������������������������������������������ 93
MD5 Function������������������������������������������������������������������������������������������������������������������������������ 94
SHA1 Function���������������������������������������������������������������������������������������������������������������������������� 95
Implementing Hash Functions���������������������������������������������������������������������������������������������������� 96
Implementing SHA-1/256/368/512, MD2, and MD5�������������������������������������������������������������� 97
Conclusion�������������������������������������������������������������������������������������������������������������������������������� 101
References�������������������������������������������������������������������������������������������������������������������������������� 101

Chapter 9: Block Ciphers: DES and AES���������������������������������������������������������������� 103


Preliminaries����������������������������������������������������������������������������������������������������������������������������� 103
Networks Based on Substitution and Permutation������������������������������������������������������������������� 105
Attacks Based on Linear Cryptanalysis������������������������������������������������������������������������������������� 106
Attacks Based on Differential Cryptanalysis����������������������������������������������������������������������������� 107
The Data Encryption Standard (DES)����������������������������������������������������������������������������������������� 108
DES Description������������������������������������������������������������������������������������������������������������������� 109
Implementation of DES�������������������������������������������������������������������������������������������������������� 110
The Advanced Encryption System (AES)����������������������������������������������������������������������������������� 114
SubBytes Operations����������������������������������������������������������������������������������������������������������� 116
The ShiftRows Operation����������������������������������������������������������������������������������������������������� 117
The MixColumn Operation��������������������������������������������������������������������������������������������������� 117
The AddRoundKey Operation����������������������������������������������������������������������������������������������� 118
Key Expansion��������������������������������������������������������������������������������������������������������������������� 118
InvSubBytes Operation�������������������������������������������������������������������������������������������������������� 119

vii
Table of Contents

InvShiftRows Operation������������������������������������������������������������������������������������������������������� 119


InvMixColumns Operation���������������������������������������������������������������������������������������������������� 119
Conclusion�������������������������������������������������������������������������������������������������������������������������������� 120
References�������������������������������������������������������������������������������������������������������������������������������� 120

Chapter 10: Asymmetric Encryption Schemes����������������������������������������������������� 125


RSA������������������������������������������������������������������������������������������������������������������������������������������� 127
ElGamal������������������������������������������������������������������������������������������������������������������������������������� 132
Merkle-Hellman������������������������������������������������������������������������������������������������������������������������ 138
Knapsack Approach������������������������������������������������������������������������������������������������������������� 138
The Algorithms�������������������������������������������������������������������������������������������������������������������� 138
Conclusion�������������������������������������������������������������������������������������������������������������������������������� 139
References�������������������������������������������������������������������������������������������������������������������������������� 140

Chapter 11: Formal Techniques for Cryptography������������������������������������������������ 143


Probability Theory��������������������������������������������������������������������������������������������������������������������� 143
Random Variables���������������������������������������������������������������������������������������������������������������� 145
Birthday Problem����������������������������������������������������������������������������������������������������������������� 145
Entropy�������������������������������������������������������������������������������������������������������������������������������� 147
Randomness in Cryptography��������������������������������������������������������������������������������������������������� 148
Conclusion�������������������������������������������������������������������������������������������������������������������������������� 151
References�������������������������������������������������������������������������������������������������������������������������������� 151

Chapter 12: Visual Cryptography�������������������������������������������������������������������������� 153


Conclusion�������������������������������������������������������������������������������������������������������������������������������� 158
References�������������������������������������������������������������������������������������������������������������������������������� 158

Chapter 13: Chaos-Based Cryptography��������������������������������������������������������������� 159


Chaos Maps and Functions������������������������������������������������������������������������������������������������������� 160
Logistic Map������������������������������������������������������������������������������������������������������������������������ 161
Chaos Theory in Cryptography�������������������������������������������������������������������������������������������������� 162
Sensitivity to Initial Conditions�������������������������������������������������������������������������������������������� 172
Conclusion�������������������������������������������������������������������������������������������������������������������������������� 173
References�������������������������������������������������������������������������������������������������������������������������������� 174
viii
Table of Contents

Chapter 14: Steganography���������������������������������������������������������������������������������� 179


Algorithms and Methods for Different Steganography Types���������������������������������������������������� 180
Steganography for Image Files�������������������������������������������������������������������������������������������� 180
Steganography for Audio Files��������������������������������������������������������������������������������������������� 180
Steganography for Video Files��������������������������������������������������������������������������������������������� 181
Practical Implementation���������������������������������������������������������������������������������������������������������� 181
Implementing the Least Significant Bit (LSB) Method��������������������������������������������������������� 181
Implementing the Histogram Analysis Method�������������������������������������������������������������������� 187
Conclusion�������������������������������������������������������������������������������������������������������������������������������� 189
References�������������������������������������������������������������������������������������������������������������������������������� 190

Index��������������������������������������������������������������������������������������������������������������������� 191

ix
About the Authors
Marius Iulian Mihailescu, PhD is an Associate Professor (Senior Lecturer) at the
Spiru Haret University of Bucharest, Romania. He is also the CEO of Dapyx Solution
Ltd., a company based in Bucharest, Romania that is focused on information security-
and cryptography-related research projects. He is a lead guest editor for applied
cryptography journals and a reviewer of multiple publications with information
security and cryptography profiles. He has authored and co-authored more than 30
articles in conference proceedings, 25 articles in journals, and four books. For more
than six years, he has served as a lecturer at well-known national and international
universities (University of Bucharest, Titu Maiorescu University, Kadir Has University,
Istanbul, Turkey). He has taught courses on programming languages (C#, Java, C++, and
Haskell) and object-oriented system analysis and design with UML, graphs, databases,
cryptography, and information security. He served for three years as an IT Officer at
Royal Caribbean Cruises Ltd., where he dealt with IT infrastructure, data security, and
satellite communications systems. He earned his PhD in 2014 with a thesis on applied
cryptography over biometrics data. He holds two MSc degrees, in information security
and software engineering.

Stefania Loredana Nita, PhD is a software developer and researcher at the Institute for
Computers of the Romanian Academy. She earned her PhD with a thesis on advanced
cryptographic schemes using searchable encryption and homomorphic encryption.
At the Institute for Computers, she focuses on research and development projects that
involve searchable encryption, homomorphic encryption, cloud computing security, the
Internet of Things, and big data. She has served for more than two years as an assistant
lecturer at the University of Bucharest, where she teaches advanced programming
techniques, simulation methods, and operating systems. She has authored and co-
authored more than 25 papers for conferences and journals and has co-­authored four
books. She holds an MSc in software engineering and two BSc degrees in computer
science and mathematics.

xi
About the Technical Reviewer
Irfan Turk, PhD, is a math and computer programming
instructor and has worked at universities, high schools, and
educational institutions for about 15 years. He concentrated
on applied mathematics while earning his PhD degree. Dr.
Turk finished the computer science track requirements of
his MSc degree while a student at the University of Texas
at Arlington. He is the author of the Python Programming:
for Engineers and Scientists and MATLAB Programming:
for Beginners and Professionals books. Dr. Turk’s research
interests include, but are not limited to, numerical solutions
of differential equations, scientific computing, mathematical
modeling, and programming in MATLAB and Python.

xiii
CHAPTER 1

Getting Started in
Cryptography and
Cryptanalysis
Due to the most recent attacks, the electronic communications and transaction require to
strengthen their practical security techniques related to digital signature in such way that
law enforcement agencies are able to recognize and trust them.
In the last few months alone, as we were writing this book, there were countless
news stories detailing attacks that compromised the private data of millions of users
on the Internet or dark web. Advanced technologies—such as the Internet of Things,
fog computing, edge computing, smart vehicles, drones, smart houses, and many other
complex software applications (desktop/web/mobile)—are evolving so fast that it is a
challenge to keep up with their security requirements. For example, looking at the CVE
platform1, we can see a total of 152,984 records (vulnerabilities) and exposed users. By
examining how these vulnerabilities occurred, developers can identify efficient ways to
protect users and customers against malicious hackers.
A security solution is successful when a user’s machine (computer or other
electronic device) and the networks with which it communicates do not expose the data
flowing between them. Because of the increasing speed and complexity of computing
technology (e.g., quantum computers), the mission of modern cryptography (and we are
not referring to quantum cryptography) is at a very challenging point in time.

1
CVE - https://cve.mitre.org/

1
© Marius Iulian Mihailescu and Stefania Loredana Nita 2021
M. I. Mihailescu and S. L. Nita, Cryptography and Cryptanalysis in MATLAB,
https://doi.org/10.1007/978-1-4842-7334-0_1
Chapter 1 Getting Started in Cryptography and Cryptanalysis

Keeping knowledge secure is one of the most important aspects to consider when
designing and implementing complex systems. Information falling into the wrong hands
can result in huge financial losses or, in extreme cases, even loss of lives. Cryptography can
be used to encode private information in such a way that nobody should be able to decode
it without the necessary privileges. However, cryptography algorithms, have been broken
after hackers found a flaw in their design. When enough computing power is applied (for
example quantum computers) to break an encoded message or cryptography algorithm
(such as RSA), it is only a matter of time until the encryption or algorithm will be broken.
The current work represents a continuation of previous works, such as [2] and [3],
dedicated to applied cryptography using MATLAB environment for developing
cryptography algorithms in a more related scientific manner. The book represents
an advanced work. It provides a comprehensive view of the most important topics in
information security, cryptography, and cryptanalysis. The book can be used in many areas
by multiple professionals, including security experts, military experts and researchers,
ethical hackers, teachers in academia, researchers, software developers, and software
engineers. If you need security and cryptographic solutions in a real business software
environment, this book represents a very good starting point, together with [1] and [2]. The
book will serve very useful for students (undergraduate- and graduate-level, master degree,
professional, and academic doctoral degree students), business analysts, and many others.

C
 ryptography and Cryptanalysis
There are three main concepts to keep in mind when dealing with information security
and data protection. Those concepts are cryptology, cryptography, and cryptanalysis.
• “Cryptology is defined as the science or art of secret writings; the
main goal is to protect and defend the secrecy and confidentiality of
the information with the help of cryptographic algorithms.” [2, 3].

• “Cryptography represents the defensive side of the cryptology; the


main objective is to create and design the cryptographic systems and
their rules. When we are dealing with cryptography, we can observe a
special kind of art; an art that is based on protecting the information
by transforming it into an unreadable format, called ciphertext.” [2, 3].

2
Chapter 1 Getting Started in Cryptography and Cryptanalysis

• “Cryptanalysis is the offensive side of the cryptology; its main


objective is to study the cryptographic systems with the scope to
provide the necessary characteristics in such a way as to fulfill the
function for which they have been designed. Cryptanalysis can
analyze the cryptographic systems of third parties through the
cryptograms realized with them, in such a way that breaks them to
obtain useful information for their business purposes. Cryptanalysts,
code breakers, or ethical hackers are the people who are dealing with
the field of cryptanalysis.” [2, 3].

• “Cryptographic primitive represents a well-established or low-level


cryptographic algorithm used to build cryptographic protocols.
Examples of such routines include hash functions and encryption
functions.” [2, 3].

The book provides a deep examination of all three concepts from the practical side
to the theoretical side. It illustrates how a theoretical algorithm should be analyzed for
implementation.

B
 ook Structure
The book is divided into 14 chapters meant to cover the most important practical
and theoretical aspects of modern cryptography and cryptanalysis. The chapters
are structured in such a manner that they cover the key elements, from theoretical
cryptography to applied cryptography, especially when implementing the algorithms
in MATLAB.
Each chapter is structured into two main parts—the mathematical background,
which provides the notions required in the implementation process, and the
implementation, which contains examples of how it should be done. The chapter goals
are as follows:

• Chapter 1. This chapter’s goal is to highlight the importance of


cryptography and cryptanalysis, justifying the importance of applied
cryptography in a continuously evolving period of technology and
requirements.

3
Chapter 1 Getting Started in Cryptography and Cryptanalysis

• Chapter 2. This chapter gives a short introduction to the built-­


in functions from MATLAB that are used to implement the
cryptographic algorithms.

• Chapter 3. This chapter explains the different procedures for


converting text (messages/plaintext) from lowercase to uppercase,
from ASCII codes to characters, etc. These conversions are very
useful in cryptography for some special algorithms.

• Chapter 4. This chapter covers the main arithmetic operations that


are dedicated to cryptography algorithms. Every arithmetic operation
is justified through an example, with the goal to make it clear as it
how it should be done correctly in MATALB.

• Chapter 5. In cryptography, especially in theoretical cryptography,


number theory represents an important part of the research when
designing and proposing new cryptography algorithms. Number
theory is a fascinating and complex field. Without a proper
understanding of its theoretical concepts, developers cannot
perform a correct and reliable implementation of a cryptography
algorithm. The purpose of this chapter is to give important highlights
of important aspects that are useful to those who want to write
cryptography algorithms from scratch.

• Chapter 6. This chapter contains the implementation of well-known


algorithms (e.g., Caesar, Vigenère, and Hill) in order to provide
the readers with a strong foundation of the main operations from
MATLAB that are used to implement the cryptography algorithms.
Each algorithm is done with respect to the two main operations,
encryption and decryption.

• Chapter 7. This chapter covers the most important aspects of


generating random numbers. This chapter is dedicated to those
cryptography algorithms in which generating high random numbers
is an important part of the security of the cryptography algorithm.

• Chapter 8. This chapter presents an implementation of hash


functions, such as MD4/MD5, SHA1/256/368/512. It explores the
fascinating processes behind generating hashes for different types of
data, such as text.
4
Chapter 1 Getting Started in Cryptography and Cryptanalysis

• Chapter 9. This chapter presents the main implementation procedure


based on the proposed standards by NIST for DES (Data Encryption
Standard) and AES (Advanced Encryption System). Designing
s-boxes is an important concept in DES and AES [1]. The chapter will
examine the construction of S-boxes and underline their importance
in implementing cryptographic algorithms.

• Chapter 10. This chapter is dedicated to one of the most important


types of cryptography, AES. This chapter presents advanced notions
and concepts for public-key cryptography that are very useful in
designing and implementing advanced, complex systems.

• Chapter 11. This chapter goes through a series of advanced, powerful


algorithms, such as RSA and ElGamal. They are used every day in
many applications (e.g., Internet browsers).

• Chapter 12. This chapter provides techniques for allowing visual


information, such as pictures, to be encrypted in such way that the
decrypted information is shown as a visual image.

• Chapter 13. This chapter represents encryption and decryption


methods using chaos theory and chaos algorithms proposed at the
theoretical level. Chaos-based cryptography is a controversial topic
due to the complexity of the operations and the field itself.

• Chapter 14. This chapter provides different implementations of


methods and algorithms for steganography, which is the art of hiding
different types of data (text and files) in another type of media file
(pictures files, text files, etc.).

C
 onclusion
In this first chapter, we discussed the objectives of this book, based on addressing
the practical aspects of cryptography and information security. Due to the increasing
number of requirements for developing secure software applications and using
advanced information technologies, they have a deep impact on our lives every day.
The goal of this book is translate the most important theoretical cryptography
algorithms and mechanism to practice using one of the most powerful technologies in
research, MATLAB.
5
Chapter 1 Getting Started in Cryptography and Cryptanalysis

In this chapter you learned about:

• The mission and goals of this book.

• The differences between cryptography, cryptanalysis, and cryptology.

• The goal of each chapter and the algorithms presented.

References
[1] Modern Cryptography Applied Mathematics for Encryption and
Information Security, William Easttom, Springer, 2021.

[2] Mihailescu, Marius Iulian, and Stefania Loredana Nita. Pro


Cryptography and Cryptanalysis: Creating Advanced Algorithms
with C# and .NET. Apress, 2021. DOI: 10.1007/978-1-4842-6367-9.

[3] Mihailescu, Marius Iulian, and Stefania Loredana Nita. Pro


Cryptography and Cryptanalysis with C++20: Creating and
Programming Advanced Algorithms. Apress, 2021.
DOI: 10.1007/978-1-4842-6586-4.

6
CHAPTER 2

MATLAB Cryptography
Functions
One of the most important elements in cryptography is the bit, the foundation of
digital information. Working with bits requires different logical operations, such as OR,
AND, or XOR. MATLAB implements these operators automatically, as well as some
types of conversions to bits, as you will see in this chapter. Other important aspects of
cryptography are arrays or matrices. These have many applications. For example, the
elements of a finite group are stored in an array, and the key of an encryption system
uses matrices to be generated. In this chapter, you will see some of the most important
functions that work with bits and matrices.
In MATLAB, there are several functions already implemented that work directly
with bits to implement the main operations on bits (bitwise operations). Examples of
such functions are bitset, bitget, bitshift, bitcmp, bitor, bitand, bitxor,
and swapbytes [1]. They all take numeric values as input. These functions are defined as
follows:

• Bitset: Sets a bit value on a given location.

• Bitget: Gets the bit value from a given location.

• Bitshift: Shifts the bits with a specific number of locations. The


sense of shifting (left or right) and the bits that fill the initial places
are given by the signs of the bits that need to be shifted and the
number of locations to be shifted.

• Bitcmp: Returns the complement of the bit(s) given as input.


• Bitor: Returns the result of the OR operation between the bits.

• Bitand: Returns the result of the AND operation between the bits.

7
© Marius Iulian Mihailescu and Stefania Loredana Nita 2021
M. I. Mihailescu and S. L. Nita, Cryptography and Cryptanalysis in MATLAB,
https://doi.org/10.1007/978-1-4842-7334-0_2
Chapter 2 MATLAB Cryptography Functions

• Bitxor: Returns the result of the XOR operation between the bits.

• Swapbytes: Swaps of the order of the bytes.

Listing 2-1 presents the applications of these functions; the result is shown in
Figure 2-­1.

Listing 2-1. Using a Bitwise Function from MATLAB

1
2   clc;
3   clear all;
4
5   no1 = 25;
6   bin1 = dec2bin(no1);
7   fprintf("The binary value of %d is: %s. \n", no1, bin1);
8   no2 = -65;
9   bin1 = dec2bin(no2);
10   fprintf("The binary value of %d is: %s. \n", no2, bin1);
11   fprintf("\n");
12
13   no3 = 1739;
14   set_res = bitset(no3, 5);
15   fprintf("Changing the second bit of %d to 1 results in: %d. \n", no3,
16   set_res);
17   fprintf("\n");
18
19   get_res = bitget(no3,3);
20   fprintf("The binary value of %d is %s and the 3rd bit is %d. \n", no3,
21   dec2bin(no1), get_res);
22   fprintf("\n");
23
24   no4 = round(2000 +(10000-2000)*rand(1,1));
25   shift_res = bitshift(no4, 5);
26   fprintf("Shifting 5 bits to left of %d (%s) results in %d (%s). \n",
27   no4, dec2bin(no4), shift_res, dec2bin(shift_res));
28   shift_res2 = bitshift(no4, -5);

8
Chapter 2 MATLAB Cryptography Functions

29   fprintf("Shifting 5 bits to right of %d (%s) results in %d (%s). \n",


30   no4, dec2bin(no4), shift_res2, dec2bin(shift_res2));
31   shift_res = bitshift(0-no4, 5, 'int64');
32   fprintf("Shifting 5 bits to left of %d (%s) results in %d (%s). \n",
33   no4, dec2bin(no4), shift_res, dec2bin(shift_res));
34   shift_res2 = bitshift(0-no4, -5, 'int64');
35   fprintf("Shifting 5 bits to right of %d (%s) results in %d (%s). \n",
36   no4, dec2bin(no4), shift_res2, dec2bin(shift_res2));
37   fprintf("\n");
38
39   cmp_res = bitcmp(no4, 'int64');
40   fprintf("The bit-wise complement of %d (%s) is %d (%s). \n", no4,
41   dec2bin(no4), cmp_res, dec2bin(cmp_res));
42   fprintf("\n");
43
44   no5 = round(2000 +(10000-2000)*rand(1,1));
45   fprintf("%d (%s) OR %d (%s) = %d (%s) \n", no4, dec2bin(no4), no5,
46   dec2bin(no5), bitor(no4,no5), dec2bin(bitor(no4,no5)));
47   fprintf("%d (%s) AND %d (%s) = %d (%s) \n", no4, dec2bin(no4), no5,
48   dec2bin(no5), bitand(no4,no5), dec2bin(bitand(no4,no5)));
49   fprintf("%d (%s) XOR %d (%s) = %d (%s) \n", no4, dec2bin(no4), no5,
     dec2bin(no5), bitxor(no4,no5), dec2bin(bitxor(no4,no5)));
50   fprintf("\n");
51
52   no6 = 0x134DF5ED;
53   swap_res = swapbytes(no6);
     fprintf("Number  %d (%s) swapped is %d (%s). \n", no6, dec2hex(no6),
     swap_res, dec2hex(swap_res));

9
Chapter 2 MATLAB Cryptography Functions

Figure 2-1. The results obtained using bitwise functions

We started with the clc; and clear all; commands, which are used to clear the
Command Window, in order to remove all items from the workspace and release the
corresponding occupied memory. MATLAB provides different types of conversion
functions. One of these functions is dec2bin, which converts a decimal number into
its corresponding binary representation. Another example of a conversion function
is dec2hex, which converts a decimal number into its hexadecimal representation. A
complete list of conversion functions can be found at [2].
Note that the code in Listing 2-1 uses the rand function for no4 and no5, so every time
the program runs, different results will be obtained. This function, without parameters,
generates a random number in the (0, 1) interval. However, Listing 2-1 uses rand(1,1),
which generates a 1 × 1 matrix , which actually means one element. In general,
rand(a,b) generates a a × b matrix, with elements in the (0, 1) interval. Note also that
no4 and no5 are not in the interval (0, 1) and we used a formula to generate them. The
general formula is

x   y  x   rand 1, 1

to generate a number in the interval (x, y). As we used x = 2000 and y = 10000, no4
and no5 were generated in this interval. The values for no4 and no5 are integer values
because we used the round function to round the result.

10
Chapter 2 MATLAB Cryptography Functions

Next, we provide some examples that involve matrices and arrays. These are very
useful in different kinds of cryptography applications, for example, to generate keys or to
test different properties of the key, such as its length. Listing 2-2 presents some examples
implemented in MATLAB.

Listing 2-2. Working with Matrices

1
2   clc;
3   clear all;
4
5   fprintf("Generating matrix... \n");
6   min_lim = 100;
7   max_lim = 1000;
8   v = round(min_lim +(max_lim-
9   min_lim)*rand(2,10));
10   disp(v);
11
12   fprintf("The length of v is %d. \n",
13   length(v));
14   fprintf("The size of v is %d. \n",
15   size(v));
16
17   fprintf("v has %d elements. \n", numel(v));
18   fprintf("\n");
19   fprintf("Sorting v... \n");
20   disp(sort(v));
21
22   fprintf("Sorting rows of v... \n");
23   disp(sortrows(v));
24
25   fprintf("Flipping v... \n");
26   disp(flip(v));
27
28   fprintf("Reshaping v... \n");
29   v2 = reshape(v, [5,4]);

11
Chapter 2 MATLAB Cryptography Functions

30   disp(v2);
     fprintf("Replicating v...\n");
     v3 = repmat(v,2);
     disp(v3);

The result of Listing 2-2 is presented in Figure 2-2.

Figure 2-2. The results of functions that work with matrices

In line 7 of Listing 2-2, we generated a matrix with 2 rows and 10 columns, with
random integer numbers in the [100, 1000] interval. In line 10, we printed the length of
the matrix. The length is given by the longest sub-array in an array. As a matrix can be
seen as an array of arrays, the result of this example is 10, because each line contains
10 elements. Therefore, the size of the matrix is 10. If v would have been composed of
sub-­arrays with different lengths, the length of v would have been equal to the number of
elements of the longest sub-array. Next, the size of the matrix gives the number of rows
and columns, while the numel function gives the total number of elements in the matrix.
The sort function sorts the elements of each column of the matrix, while sortrows sorts

12
Chapter 2 MATLAB Cryptography Functions

the elements of each row of the matrix. The flip function flips the elements between
the columns of the matrix. Next, reshape generates another matrix with a total number
of elements that’s the same as the original matrix, but with a different number of rows
and columns. Finally, repmat replicates the matrix by the given number of times, in our
example, two times. Note that all these functions can be applied on arrays too.
The following functions are representative of different operations in cryptography,
including functions such as eig (see Figure 2-3), poly (see Figure 2-4), and roots (see
Figure 2-5).

Figure 2-3. Computing eigen values using the eig function

13
Chapter 2 MATLAB Cryptography Functions

Figure 2-4. Computing the characteristic polynomial from the eigen_value values

14
Chapter 2 MATLAB Cryptography Functions

Figure 2-5. Computing the roots using the roots function

Conclusion
This chapter presented the main functions that work directly on bits and explained how
to work with characteristics of matrices and arrays. These functions, matrices, and arrays
are very useful in implementing cryptographic algorithms.

15
Chapter 2 MATLAB Cryptography Functions

R
 eferences
[1] Bitwise Operations – Functions: https://www.
mathworks.com/help/matlab/referencelist.
html?type=function&category=bit-­wise-­operations&s_
tid=CRUX_topnav

[2] Data Type Conversion — Functions: https://www.


mathworks.com/help/matlab/referencelist.
html?type=function&category=data-­type-­conversion&s_
tid=CRUX_topnav

16
CHAPTER 3

Conversions Used in
MATLAB for Cryptography
The goal of this chapter is to provide a quick overview of the main conversion
mechanisms for numbers and strings that are specific to the cryptography field.
Representing numbers and binary strings in different bases is one of the most critical
steps in cryptography. This chapter covers the main steps and discusses how they are
done properly in MATLAB.
A common example used in cryptographic operations is the process of converting
integers into lowercase and uppercase strings. Listing 3-1 and Figure 3-1 show an
example of converting integers into lowercase strings.
In Line 1 of Listing 3-1, we define the signature of the function. The call of the
function receives an integer array with a length between 0 and 25 (see Line 2). If the size
is not between those values, an error is thrown, informing the user about the size that
should be provided (see Line 3). Line 6 shows the conversion process provided by the
char function, which is a built-in MATLAB function.

Listing 3-1. Converting Integers Into Lowercase Strings

1   function converted_output_string = Listing3_1(integer_array)


2   while  (max((integer_array < 0) | (integer_array > 25))) > 0
3      error('The integer value provided has to be situated between 0
and 25.');
4   end
5
6   converted_output_string = char(integer_array + 'a');

17
© Marius Iulian Mihailescu and Stefania Loredana Nita 2021
M. I. Mihailescu and S. L. Nita, Cryptography and Cryptanalysis in MATLAB,
https://doi.org/10.1007/978-1-4842-7334-0_3
Chapter 3 Conversions Used in MATLAB for Cryptography

Figure 3-1. Result of converting an integer into a lowercase string

In Listing 3-2 and Figure 3-2 we have a similar example; the difference is that the
integers are converted into uppercase letters.

Listing 3-2. Converting Integers Into Uppercase Strings

1   function converted_output_string = Listing3_2(integer_array)


2
3   while  (max((integer_array < 0) | (integer_array > 25))) > 0
4      error('The integer value provided has to be situated between 0
and 25.');
5   end
6
7   converted_output_string = char(integer_array + 'A');

Figure 3-2. Result of converting an integer into an uppercase string

Listing 3-3 and Figure 3-3 show another example. This time the process is reversed—
the program converts from letters to integers. The process is similar and the signature of
the function is declared in the same way as in the examples in Listings 3-1 and 3-2.

18
Chapter 3 Conversions Used in MATLAB for Cryptography

In Line 3 of Listing 3-3, there is the condition that the string array characters must be
situated between a and z. If another character is encountered within the string, an error
message is thrown (see Line 4). In Line 7, the conversion is performed and returned to
the user.

Listing 3-3. Converting Lowercase Strings Into Integers

1   function output_array = Listing3_3(string_array)


2
3   while (max((string_array < 'a') + (string_array > 'z'))) > 0
4      error('Integer value provided has to be lower-case letter.');
5   end
6
7   output_array = string_array - 'a';

Figure 3-3. Output of integer conversion to uppercase strings

In Listing 3-4 and Figure 3-4, we have another example of converting a lowercase
string (including the spaces between words) to an array of integers. In Line 1, we have
the signature of the function; the parameter is represented by the string that the user will

19
Chapter 3 Conversions Used in MATLAB for Cryptography

enter (see Figure 3-4). In Line 3, we loop through each character of the string and run the
tests provided for each character, then convert them properly (see Lines 4, 5, and 7).

Listing 3-4. Converting a Lowercase String That Contains Spaces to an Array of


Integers
1   function output_array = Listing3_4(string_array)
2
3   for i=1:length(string_array)
4      if  double(string_array(i)) > 32
5          output_array(i) = double(string_array(i))-97;
6      else
7          output_array(i) = 26;
8      end
9   end

Figure 3-4. Output of converting a lowercase string with spaces to an array of


integers

20
Chapter 3 Conversions Used in MATLAB for Cryptography

The example in Listing 3-5 is an implementation of converting a string with


uppercase letters to an integer array (see Figure 3-5 for the output). The implementation
is similar to the implementations provided in Listings 3-1 and 3-2.

Listing 3-5. Converting an Uppercase String to an Integer Array

1   function output_array = Listing3_5(string_array)


2
3   while (max((string_array < 'A') + (string_array > 'Z'))) > 0
4      error('The text provided must be only capital letters');
5   end
6
7   output_array = string_array - 'A';

Figure 3-5. Output of converting an uppercase string to an integer array

The example in Listing 3-6 generates random numbers. This example can be used to
implement pseudo-random number generators. The implementation provided in
Listing 3-6 is quite straightforward and simple to follow. The signature of the function
receives three parameters—the minimum and maximum values represent the number of
digits, and the length determines how long the random number will be (see Figure 3-6).
21
Chapter 3 Conversions Used in MATLAB for Cryptography

Listing 3-6. Generating Random Numbers

1   function array_output = Listing3_6(minimum, maximum, length)


2   f = floor(maximum +1- minimum);
3   r = rand(1,length);
4   array_output = minimum + (f * r);

Figure 3-6. Output of generating random numbers


22
Chapter 3 Conversions Used in MATLAB for Cryptography

C
 onclusion
This chapter discussed several basic examples that illustrate different conversion
scenarios. These examples are very useful for implementing cryptographic algorithms.
They are one of the simplest and most reliable ways of implementing such conversion
methods.

R
 eferences
[1] Turk, Irfan. Practical MATLAB: With Modeling, Simulation,
and Processing Projects. Apress, 2019. DOI.org (Crossref ),
doi:10.1007/978-1-4842-5281-9.

[2] Eshkabilov, Sulaymon. Beginning MATLAB and Simulink: From


Novice to Professional. 2019. Open WorldCat, https://search.
ebscohost.com/login.aspx?direct=true&scope=site&db=nlebk
&db=nlabk&AN=2320660.

[3] Hunt, Brian R., et al. A Guide to MATLAB: For Beginners and
Experienced Users. Cambridge University Press, 2001.

[4] Gander, Walter. Learning MATLAB. Springer International


Publishing, 2015. DOI.org (Crossref ), doi:10.1007/978-3-319-
25327-5.

[5] Gustafsson, Fredrik, and Niclas Bergman. MATLAB for


Engineers Explained. Springer London, 2003. DOI.org (Crossref ),
doi:10.1007/978-1-4471-0029-4.

23
CHAPTER 4

Basic Arithmetic
Foundations
In cryptography, the Integer Factorization Problem (IFP) has significant importance
because many cryptosystems with public keys ground their security on the hardness
assumption of it. For example, RSA Laboratories launched many competitions that
targeted IFPs [1]. The IFP problem consists of writing an arbitrary integer as a product of
powers of prime numbers. Note that every integer number can be written as a product of
prime numbers and that product is unique. At the same time, IFP is interesting because
it combines elements of number theory with elements of complexity theory.
However, to factorize an integer number, it is enough to find an algorithm that
defines the given integer as a product of two integers (greater than one). This problem
is known as splitting and if such an algorithm existed, it would be applied recursively
until the complete factorization of any integer is found. This is of interest for odd integers
only, because factoring an even integer leads to dividing by two until an odd integer is
obtained, which is then split on its turn.
The purpose of this chapter is to provide a quick overview of the main tools used to
deal with numbers and their basic operations in cryptography.
Another important tool in cryptography are big integers, which are numbers with
hundreds or thousands of digits. For these, the IFP becomes interesting, because there
are no efficient solutions, except for the following situations [2]:

• n = p. The integer n is actually a prime number. For this, primality


tests can be applied, which are much more efficient than
factorization algorithms.

25
© Marius Iulian Mihailescu and Stefania Loredana Nita 2021
M. I. Mihailescu and S. L. Nita, Cryptography and Cryptanalysis in MATLAB,
https://doi.org/10.1007/978-1-4842-7334-0_4
Chapter 4 Basic Arithmetic Foundations

• n = pa. The integer n is a power of a prime number p, so it can be


extracted recursively by the root of order i. It verifies that the root of
order i is an integer number. The time complexity of this algorithm is
logarithmic (a binary search can be used).

• Special integers. The integer contains factors that have properties that
enable efficient use.

The factorization problem is approached differently depending on the case used.


In cryptography, the case whereby n = p · q, where p and q are prime numbers, is very
important. There are two main categories for factorization algorithms:

• Dedicated algorithms (applied for special cases of integers): These


algorithms are used to compute factors smaller than a given
threshold, which, in practice, is established based on computational
resources. Examples of such algorithms are Exhaustive Search,
the Euclidean algorithm, the Fermat algorithm, the Pollard p-1
algorithm, the Pollard Rho algorithm, Elliptic Curves, etc.

• General algorithms: These algorithms are used to factorize integers


with large factors. Examples of such algorithms are Quadratic Sieve
Factoring, the Number Field Sieve, etc.

The Exhaustive Search, which is the most inefficient algorithm, divides n into
successive integer values in the interval 2, n  with the purpose of finding a factor. The

 
complexity for the Exhaustive Search is O n , which is unpractical for big integers with
hundreds or thousands of bits.
This chapter presents the Euclid algorithm and the Extended Euclidean algorithm.
First, let’s establish some guidelines. Note that we briefly present the main ideas that
will be used in this chapter, similarly with [2] and [6]. A comprehensive source about the
number theory used in cryptography is [2]. [3]-[5] are also good references.

Euclid’s Division Lemma


Let a ∈ ℕ∗, b ∈ ℤ. Then unique q, r ∈ ℤ exist with the following properties:

(a) a = b · q + r

(b) 0 ≤ r < b

26
Chapter 4 Basic Arithmetic Foundations

We say “b divides a” (denoted b ∣ a) or “a is multiple of b” or “b is a divisor of a” when


the remainder of the division of a into b is zero (r = 0). For two numbers m, n ∈ ℤ, a
common divisor is a natural number d that divides m and n simultaneously.

Greatest Common Divisor (gcd)


Let a, b ∈ ℤ∗. The gcd between two integers a and b is the unique number g ∈ ℕ with the
following properties:
(a) g ∣ a and g ∣ b

(b) For any c ∈ ℕ: if c ∣ a and c ∣ b, then c ∣ g

The notation for g is g = gcd (a, b), or simply, g = (a, b). If (a, b) = 1, then a and b are
called coprime numbers. Note that coprime numbers are also called relatively prime
numbers.
A notion related to the gcd is the least common multiple between to integer numbers
a and b. It is denoted as lcm(a, b), or simply [a, b] and represents the least natural
number that is divisible with a and b.

Euclid’s Algorithm
Let a, b ∈ ℤ, a ≥ b > 0 and the initialization notation a = r−1, b = r0. By applying Euclid’s
division lemma repeatedly, this will be achieved

rj 1  rj  q j 1  rj 1 ,0  rj 1  rj

for all values 0 ≤ j < n, where n is the first prime number with the property rn + 1 = 0. Then
(a, b) = rn.
The factorization based on Euclid’s algorithm supposes to construct the product
k
Pk  pi of the first k prime numbers and then compute gcd(n, Pk), where n is
i 1
the numbers that should be factorized. This solution is not more efficient than the
Exhaustive Search, and also requires memory space for storing the products—space
that is not available when working with big integers. However, Euclid’s algorithm has an
advantage that allows it to be used in practice. Tables with products of the above form
can be computed for reasonable values apriori knowing the number n, which can be
used to compute the small factors of any integer that is desired to be factored.

27
Chapter 4 Basic Arithmetic Foundations

The Extended Euclidean Algorithm


Let a, b ∈ ℕ and qi, 1 ≤ i ≤ n + 1 be the quotients obtained by applying Euclid’s Algorithm
for computing g = (a, b) (n is the first positive index with rn + 1 = 0). If s1 = 1 and s0 = 0 and

si  si  2  qn i  2  si 1 ,1  i  n  1,

then g = sn + 1a + snb.
Another important topic used in cryptography is the congruence in the ring (ℤn, + , ·),
where ℤn = {0, …, n − 1}. Let a, b ∈ ℤ, n ∈ ℕ∗; a is congruent with b modulo n if n divides
(a − b), and it is denoted a ≡ b (mod n). Recall that all number theory used in cryptography
is explained in detail in [2]; of interest here is how the modular inverse is computed.
Let a ∈ ℤ, n ∈ ℕ∗. The multiplicative (or modular) inverse of a (modulo n) is the
positive integer x < n with ax ≡ 1(mod n) and it is denoted x = a−1. The inverse of a
number in ℤn can be computed using the Extended Euclidean algorithm. Considering
n prime and b ∈ ℤn, the Extended Euclidean algorithm is applied for the pair (b, n) and
it is found in the value g = sp + 1b + spn, where p is the first positive index with rp + 1 = 0. But
g = 1, because n is prime, and if this relation is taken as a congruence modulo n, then it is
achieved 1 ≡ sp + 1 · b (mod n). Therefore, sp + 1 = b−1(mod n).

P
 ractical Implementations
This section covers the importance of arithmetic foundations in cryptography. We point
out some of the most useful algorithms, such as the Extended Euclidean algorithm and
Exhaustive Search.

The Extended Euclidean Algorithm


In Listing 4-1 and Figure 4-1, we can see an implementation of the Extended Euclidean
algorithm, which is one of the most basic and simplest algorithms used in cryptography.
In Lines 2 and 3, we are reading two numbers from the user as input. In Lines 5 and 17,
we are validating the data entered by the user. In Line 20, the remainder is computed
by following the theoretical notions presented previously. Between Lines 23 and 27, we
are computing the remainder if it is different from zero. In Line 30, we are showing the
output (see Figure 4-1). Of course, for the implementation in Listing 4-1, MATLAB offers
the function GCD(a,b), which does the same thing. The purpose here is to understand
28
Chapter 4 Basic Arithmetic Foundations

the main mechanisms behind the functions and to provide a starting point for readers,
with the goal of developing personal functions or improving them for their projects.

Listing 4-1. The Extended Euclidean Algorithm

1   % positive numbers should be entered by the user


2   x = input('Enter number X = ');
3   y = input('Enter number Y = ');
4
5   % validation of X number
6   if isempty(x)
7       error 'Number X -> You need to enter a value. Non-empty values are
not allowed';
8   else
9       x = abs(x);
10   end
11
12   % validation of Y number
13   if isempty(y)
14       error 'Number Y -> You need to enter a value. Non-empty values are
not allowed';
15   else
16       y = abs(y);
17   end
18
19   % computing the remainder
20   remainder = x - y*floor(x/y);
21
22   % we will perform untill
23   while remainder ~= 0
24       x = y;
25       y = remainder ;
26       remainder = x - y*floor(x/y);
27   end
28
29   % show the result
30   GreatCommonDivisor = y
29
Chapter 4 Basic Arithmetic Foundations

Figure 4-1. Output of the Extended Euclidian algorithm from Listing 4-1

Prime Factors in MATLAB


Working in cryptography with prime factors is the core of many cryptographic
algorithms. Comparing other programming languages (e.g., C++, Java, Python, C#, etc.)
with MATLAB, computing prime factors is a very easy task. This section provides a few
examples of how to use the factor function from MATLAB.
The factor function has the prime_ factor = factor(n) syntax, according to [7]. The
purpose of this function is to return a row array in which its elements are the prime
factors of n. The prime_ factor array has the same data type as n.
In order to compute the prime factors, it is enough to invoke the following command
in the Command Window (see Figure 4-2):

prime_ factor=factor(500)

If, for example, we need to compute the product of the prime factors from the prime_
factor array, we can use the prod(prime_factor) function. See Figure 4-3 for the output.

30
Chapter 4 Basic Arithmetic Foundations

Figure 4-2. Computing prime factors using the factor function

Figure 4-3. Computing the product of prime factors

Computing the Modular Inverse


In Listing 4-2, we provide a very simple implementation on how to compute the modulo
inverse of a number. It is quite straightforward and simple to use. See Figure 4-4 for the
output. In Line 2, the gcd function can be replaced with the function that we provided in
Listing 4-1. In Line 3, the MATLAB built-in function mod is used to compute the inverse
of x.

31
Chapter 4 Basic Arithmetic Foundations

Listing 4-2. Computing the Modular Inverse

1   function computingInverse = Listing4_3(w,moduloN)


2       [d, x, y]             = gcd(w,moduloN);
3       computingInverse      = mod(x,moduloN);
4   end

Figure 4-4. Output of computing the modular inverse

C
 onclusion
This chapter covered some of the most important tools for dealing with basic arithmetic
operations, such as the Extended Euclidean algorithm, Exhaustive Search, computing
prime factors and their products, and computing the modular inverse of a number. We
provide the main theoretical concepts as a starting point in the field of number theory.
The set of references can be used to complete your knowledge about number theory.

R
 eferences
[1] RSA Factoring Challenge, https://wikimili.com/en/
RSA_Factoring_Challenge

[2] Kraft, J. S., & Washington, L. C. (2018). An introduction to number


theory with cryptography. CRC Press, ISBN: 78-1-1380-6347-1.

32
Chapter 4 Basic Arithmetic Foundations

[3] Shparlinski, I. (2013). Finite Fields: Theory and Computation:


The Meeting Point of Number Theory, Computer Science, Coding
Theory and Cryptography (Vol. 477). Springer Science & Business
Media, ISBN: 978-90-481-5203-2.

[4] Koblitz, N. (2000). A survey of number theory and cryptography. In


Number Theory (pp. 217-239). Hindustan Book Agency, Gurgaon.

[5] Yan, S. Y. (2013). Computational Number Theory and Modern


Cryptography. John Wiley & Sons, ISBN: 978-1-118-18858-3.

[6] Atanasiu, A. (2015). Matematici in criptografie. US Publishing


House, Editor: Universul Stiintific, ISBN: 978-973-1944-48-7.

[7] Factor Function. Available online: ­https://www.mathworks.com/


help/matlab/ref/factor.html

33
CHAPTER 5

Number Theory
In Chapter 4, we applied number theory to cryptography. Many techniques and tools
in cryptography are based on primality, factorization, and radomness, and we have
already seen how Euclid’s algorithm works. In this chapter, we present in more depth the
concepts and ideas behind them, as well as more advanced techniques that deal with
characteristics of integer numbers.
This chapter is more technical and contains more mathematics. The definitions and
results presented in this chapter are compiled from resources [1]-[5].

P
 rimality and Factorization
We have mentioned the term “prime number” or “prime” a lot in this book. Recall that
a prime number is a positive integer that has no divisors except for 1 and the number
itself. But how can this be “translated” into a mathematical definition? Mathematically,
the definition of a prime number can be one of the following two, discussed next.

P
 rime Numbers
Let p ∈ ℕ, p > 1. The number p is called prime if:

(a) (∀)n ∈ ℕ, n ∣ p ⇒ n = 1 or n = p.

(b) (∀)a, b ∈ ℕ, p|ab ⇒ p|a or p ∣ b.

These definitions are equivalent. The first definition (a) says that for any positive
integer n that divides p, n is 1 or p. In other words, the only divisors of a prime number
are 1 and the number itself. The second definition (b) says that a prime number divides
a product of two positive integers, and the prime number is one of the two numbers.
This is a little more difficult to understand, and it can be seen as related to integer

35
© Marius Iulian Mihailescu and Stefania Loredana Nita 2021
M. I. Mihailescu and S. L. Nita, Cryptography and Cryptanalysis in MATLAB,
https://doi.org/10.1007/978-1-4842-7334-0_5
Chapter 5 Number Theory

factorization. The lowest prime number and the only even prime number is p = 2.
Two integers a, b for which gcd(a, b) = 1 (where gcd is the greatest common divisor) are
called coprime or relatively primes.
A naïve verification for the primality of a positive integer p is to test whether p is
 
divisible by one of the integers 2,, p . If one number from this set is a divisor of p,
then p is not a prime. Listing 5-1 presents this implementation in MATLAB; the result
can be seen in Figure 5-1.

Listing 5-1. Checking for Primality

1   fprintf('\nTesting the primality of a positive integer...');


2   clear all; close all;
3
4   number = input('\nEnter the number to be tested: ');
5   if number<2
6       disp('The number should be greater than 2. \n');
7       return;
8   end
9
10   if number ~= round(number)
11       disp('The number should be a positive integer. \n');
12       return;
13   end
14
15   if is_prime(number) == 1
16       fprintf('The number %d is prime. \n\n', number);
17   else
18       fprintf('The number %d is not prime. \n\n', number);
19   end
20
21   function check=is_prime(x)
22       check=1;
23       for i = 2:sqrt(x)
24           if mod(x,i) == 0
25               check=0;
26               return;

36
Chapter 5 Number Theory

27           end
28       end
29   end

In the code in Listing 5-1, the user is asked to enter a number (Line 4). The number
is verified in certain ways, because it has to meet certain requirements: to be greater
than 2 and to be an integer (see Lines 5-13). Checking the primality of a real number, for
example, does not make sense. If everything is alright, the is_prime function is called
on the number. It is very simple. It just verifies whether the number has divisors in the
interval [2, sqrt(number)]. If a divisor is found, the for loop is interrupted and we can say
for sure that the number is not a prime. Otherwise, if the for loop reaches sqrt(number)
and no divisor is found, the number is a prime.

Figure 5-1. Testing for primality

Indeed, 789532547 is not prime, because its first divisor (greater than 2) is 17. On the
other hand, the primality for the number 2147483647 was proved by Euler in 1772 [9].
This number has the following form:

2147483647  2 31  1

It also is a special number called a Mersenne prime. AMersenne prime has the form
Mn = 2n − 1, n ∈ ℕ, n > 1.

37
Chapter 5 Number Theory

There are other, faster techniques for testing the primality, which we will discuss in
this chapter. However, there is no known function (and therefore algorithm) that can
construct distinct prime numbers.
Regarding prime numbers, there are several conjectures formulated:

• Goldbach: Any even number can be written as a sum of two prime


numbers.

• De Polignac: For any natural number, there exists an infinity number


of pairs of prime numbers, such that it is written as the difference
between the two primes, i.e., for (∀)b ∈ ℕ there exists an infinity
number of pairs (p, q) such that b = p − q.

Further, we try to find how dense the set of prime numbers is within the set of natural
numbers, or, in other words, the prime number distribution. To do this, we need to
define the function π(x):

 :    ,  x   #p  |p prime and p  x

In other words, the function counts the number of primes less than or equal to a
given number x.

The Prime Number Theorem


The following relationship is true:

x
 x 
ln  x 

 x
lim  1.
x  x / ln  x 
i.e.

In other words, the theorem says that π(x) is approximated by the number x/ ln (x),
where ln(x) is the natural logarithm, and the approximation becomes more accurate as
x increases and approaches ∞. This is also known as the de la Vallee Poussin/Hadamard
Theorem (1896), or the conjecture Gauss/Legendre (approx. 1790). Therefore, the prime
numbers are distributed asymptotically. This is useful in applications in which we want
to know the number of primes lower than a given value.
Next, we discuss congruences and begin by providing the definition of congruency.
38
Chapter 5 Number Theory

C
 ongruency
Let n, a, b ∈ ℤ and n ≥ 2. We say that a is congruent to b modulo n if n ∣ (a − b).
This definition says that a is congruent to b modulo n if the remainders from the
Euclidean algorithm (see Chapter 4) for the division between (a and n) and (b and n) are
the same. This is denoted with a ≡ b(mod n). Sometimes this relationship can be stated
as b is a residue of a modulo n. This gives the famous sets denoted with ℤn, which are
congruence classes. The set ℤn is defined as ℤn = {0, 1, …, n − 1}. It can be shown that

n =  / n ,

where nℤ = {…, −1 ⋅ n, 0 ⋅ n, 1 ⋅ n, …}
The tuple (ℤn, + , ⋅) forms a ring structure, called the ring of integers modulo n.

I nverse
In the previous chapter, we computed the modular inverse of a number modulo another
number. Here is the formal definition for the inverse of an element modulo n:
Let n ∈ ℕ, n ≥ 2 and an element a ∈ ℤn. The inverse of a modulo n is the element
b ∈ ℤn such that ab ≡ 1(mod n).
Note that it exists, the inverse is unique, and it is usually denoted with a−1. A very
useful relation is given by the following theorem:
Let n ∈ ℤ and a ∈ ℤn. We say that a is an invertible element in ℤn iff gcd(a, n) = 1.
Based on this theorem, we computed the modular inverse in the previous chapter.

Chinese Remainder Theorem


Another important theorem that is used often in primitives for cryptography is the
Chinese Remainder Theorem, which states the following:
Let m, n ∈ ℕ∗, a, b ∈ ℤ. If m, n are coprime, then (∃)x ∈ ℤ such that:

x  a  mod m  , x  b  mod n .

Moreover, x is unique when 0 ≤ x < mn.

39
Chapter 5 Number Theory

P
 rimality Tests
We have already seen that in cryptography, prime numbers play a crucial role. Now that
we’ve had a brief introduction to elements of the number theory, we can check whether
a number is a prime or a composite. Besides the naïve verification that we implemented
previously, there are many more primality tests. If the number is a composite, the next
interesting information is its factorization form in prime factors. Primality can be tested
using one of the following primality tests:

• Wilson

• Quadratic congruences

• Little Fermat

• Converse Fermat

• Miller-Rabin

• Frobenius

• AKS (Agrawal-Kayal-Saxena)

• Baillie-PSW

• Pollar Rho Test

These tests verify whether the number is a composite rather than verifying its
primality 100%. The most commonly used tests are Fermat, Miller-Rabin, and Solovay–
Strassen, which we will implement later.

The Wilson Primality Test


This is a very simple test: if p is prime then (p − 1) ! ≡ − 1 (mod p). The opposite—if
(p − 1) ! ≡ − 1 (mod p) then p is prime—is true for p ≥ 5. Although it is very simple,
it is extremely inefficient, slower even than naïve verification. The implementation in
MATLAB is given in Listing 5-2 and the result is shown in Figure 5-2.

40
Chapter 5 Number Theory

Listing 5-2. Implementation of the Wilson Primality Test

1   fprintf('\nTesting the primality of a positive integer...');


2   clear all; close all;
3
4   number = input('\nEnter the number to be tested: ');
5   if number<2
6       disp('The number should be greater than 2. \n');
7       return;
8   end
9
10   if number ~= round(number)
11       disp('The number should be a positive integer. \n');
12       return;
13   end
14
15   if is_prime(number) == 1
16       fprintf('The number %d is prime. \n\n', number);
17   else
18       fprintf('The number %d is not prime. \n\n', number);
19   end
20
21   function check=is_prime(x)
22       check=0;
23       fact=factorial(sym((x-1)));
24       if mod(fact+1,x) == 0
25           check=1;
26       end
27   end

In the code in Listing 5-2, we made the same verifications for the number that the
user introduced. The is_prime function tests whether the number is a prime. This time
we initialize the variable check with 0 because we begin with the presumption that
the number is not a prime. If the condition is met, check becomes 1 and the number
is a prime. Note in this function that we used sym, because the result becomes quite

41
Discovering Diverse Content Through
Random Scribd Documents
“Sure!” said Chas. “And when the coach and the captain didn’t
give a dinner in your honour and ask you to accept a place on the
team and give them the benefit of your advice as to running same
you got peeved. That’s just what I’d have done if I’d been you, you
see, so I know. If it was me I’d have either gone to the coach and
made a big kick and told him how good I was or else I’d have gone
out and played so hard that they’d have either had to take me on or
chuck me to save the lives of the others! But you, being Haughty
Harold, just froze them with a glance—which same they didn’t
happen to see—and went your way. And it’s a rotten way, too.
Because it won’t get you anywhere. Driscoll won’t fall for you until
you show something and you won’t show anything until Driscoll pats
you on the back. Say, I’m talking a whole lot! What time is it? And
you’ve got some digging to do! I’ll beat it. Think over my words of
wisdom, Foster, and drop around tonight and hear more. I’ve got a
plan, old chap. I’m in 16 Goss; first floor, on the right. Bye-bye!”
And before Myron could agree or refuse the invitation Cummins
had hurried to the door and was clattering downstairs. Myron went
to the window and, in somewhat of a daze, watched Cummins
emerge below and disappear under the trees. Then he sat himself
down on the window-seat, plunged both hands into trousers pockets
and frowned intently at his shoes. He didn’t get much studying done
that hour.
CHAPTER XV
THE PLAN

There was hard practice that afternoon in preparation for the


Musket Hill Academy game, and the second squad, in process of
becoming the second team, with a coach and signals of its own, was
sent against the first for three long periods. Myron found himself
with the third squad, as usual, however, and ended practice with a
half-hour scrimmage against the substitutes. Perhaps Cummins’
words had made an impression, for he certainly played good, hard
ball today and ran rings around the opposing ends and backs. As
they played on the second team gridiron, while the first team was
battling, his performance was not noted by the coach. But Keene, an
end who was off with a bad ankle and who refereed the scrimmage,
saw and casually made mention of Myron’s work to Jud Mellen later.
“That chap Foster played a nifty game today,” said Keene. “He
might bear watching, Jud.”
“Foster? Yes, he’s not half bad. If we didn’t have so many good
halves he might be useful. Best we can do for him, though, is to
carry him over for next year, I guess.”
“Well, he’s a pretty player. It seems too bad to waste him. How
would he fit at end?”
“Looking for a chance to retire?” laughed Jud. “What would we do
with another end, Larry? Have a heart, man!”
“Well, but he ought to be tried somewhere, just the same, Jud. He
plays so blamed smooth!”
“I wonder if he’d make a quarter.” Jud paused in the act of lacing
a shoe and stared speculatively at a grated and dusty window. Then
he shook his head. “I guess we’re good enough at quarter. We’ll
know better after Saturday’s game, though. How’s the foot getting
on? Going to be able to play a bit?”
“Sure! It’s coming on fine. I’ll be good for the whole game.”
“Yes, you will, son! A couple of quarters is about your stunt, I
guess. Driscoll wants to give O’Curry a show, anyway. Know what I
think? Well, I think Musket Hill’s going to give us a tough old tussle.
They’ve got almost every lineman they had last year and the same
quarter; and you know what the score was last time.”
“Twelve to ten, wasn’t it?”
“Yes, and it ought to have been turned around, for they played us
to a standstill in the second half. Driscoll’s firm for starting with a
second-string line, but I don’t like it. That Musket Hill coach is a fox.
If they get a score on us in the first quarter we’ll be lucky to pass
them.”
“They play hard ball, and that’s no joke,” agreed Keene. “I hope
he pulls me out before Grafton gets in.”
“What’s the matter with Graf?”
“I don’t know, but I can’t seem to get on with him. I think he
plays too much for the centre of the line. There’s always a hole there
and I get about two yards more of territory to look after. You keep
your place, but Grafton sort of wanders in.”
“Glad you spoke of it,” answered Jud. “I’ll watch him. Going over?”
Up to a half-hour after supper Myron was convinced that he had
no intention of visiting Cummins that evening. Cummins was a lot
more decent than he had thought him, in fact a rather likable fellow,
but he had a disagreeable way of saying things that—well, didn’t
need to be said. Besides, there was something almost indecent in
telling another that you liked him and asking him to be pals! Even if
Cummins had taken a fancy to him, as he declared, at least he might
have kept it to himself. But when supper was over and Myron had
turned on the steam in Number 17—the evenings were getting
decidedly chilly now—and settled himself to write a letter home,
Cummins’ freckled countenance insisted on obtruding itself between
him and the sheet of grey, yellow-monogrammed paper. Joe had not
returned to the room and, when the letter was written and he had
brushed up on Latin and math., he would be pretty well bored, he
supposed. He got as far as “Dear Mother and Father: I didn’t get this
letter written yesterday because I was very busy——” Then, after
trying to recall what he had been busy with and fiddling with the
self-filling device on his pen for a good ten minutes, he gave it up.
He guessed he’d walk over and hear what Cummins’ plan was. Not
that it interested him any, but he didn’t feel like writing just now.
Cummins himself answered Myron’s knock, although the battered
door of Number 16 bore not only his card but that of “Guy Henry
Brown,” to the end of which name some facetious person had added
the letters “D.D.” Brown, who played right half on the first team, was
not at home, however, and Cummins, stretched out along the
window-seat, was the sole occupant of the room. The room served
as study and chamber both, and a narrow, white-enamelled bed
stood against the wall on each side. The rest of the furnishings were
nondescript and had evidently seen long service. A few posters
adorned the painted walls and the carpet was so threadbare in
places that one had to guess at the original pattern and hue.
Nevertheless, there was a comfortable and home-like look to
Number 16 which Myron acknowledged. Cummins tore himself from
the book he was reading with unflattering deliberateness and
indicated a shabby automatic rocking-chair.
“Try the Nerve Dispeller,” he invited. “So called because when used
your own nerves leave you and go to the other chap, who has to
watch you rock. It’s all right; it won’t go over; that’s just its playful
way.”
“What were you reading?” asked Myron, by way of conversation.
Chas held the book up and the visitor was surprised to see that it
was what he mentally called “a kid’s story.”
“Oh,” he murmured.
Chas grinned. “I know, but I like them. They’re easy to
understand and there’s generally something doing all through; and
you can’t say that for these novels some of the fellows pretend to
read. I tried to wade through one last summer. Nothing happened
until I got to page 112, and then the hero changed his shoes. Maybe
he changed back again later, but I ducked. Well, how are you
tonight?”
“Me? All right, thanks.” Myron wondered why he had said “Me,”
and then realised that he had caught the trick from Joe. “I had a
letter to write, but I couldn’t seem to get at it, and so I thought I’d
drop over and see—hear——”
“That plan? Well, it’s a good one. Put your feet up here, will you,
and keep that thing still? Do you mind? It pretty nearly sets me
crazy to talk to any one who’s bobbing back and forth like one of
those china mandarins! I’d have chucked that chair long ago, only
Guy hates it worse than I do. Do you know him, by the way? Guy
Brown: plays right half on the first.”
“Only to speak to. I’m not well acquainted amongst the ministry.”
“Oh, that? Some fresh youth wrote that and a couple of days
afterwards Hale called—Do you have him in physics? He lives down
the hall—and said it was sacrilegious. But I told him it stood for
‘Decent Dub’ and he calmed down. Say, Foster, can you keep a
secret?”
“Yes, of course.”
“There’s no ‘of course’ about it,” said Chas. “Lot’s of fellows can’t.
I’m not very good at it myself. But I guess you’re one of the kind
who can. Well, here it is. I’m going to be captain next year.”
“Are you? Captain of what?” asked Myron politely.
“Football, you chump! What did you think, the Tennis Team?”
“Oh!” Myron stared, wondering whether the other was joking. But
Chas appeared to be quite in earnest and returned Myron’s gaze
with an expression of bland inquiry.
“Does that interest you?” he asked.
“It interests me to know how you know you are,” said Myron.
“Of course. Remember that it’s a secret. If you ever tell any one
what I’ve just said I’ll draw and quarter you and frizzle you crisp in
boiling oil. I know it, old chap, because I’m after the job, and what I
go after I get. Unless some dark horse develops between now and
the Kenwood game I’m certain to get it. So we’ll call that settled,
shall we?”
“Just as you say,” laughed Myron. “If you want it, though, I hope
you get it.”
“Thanks. Of course, I realise that it isn’t usual to mention such
matters. You’re not supposed to know that there is such a thing as a
captaincy. When you get it you nearly die of surprise. Well, that’s not
me. I’m after it. Mean to get it, too. I wouldn’t say this to every
fellow because most of them would be so shocked at my—my
indelicacy they’d never get over it. Besides which, they’d probably
vote against me.” Chas chuckled. “So can you if you like, Foster. I’m
not making a bid for your vote.”
“I’m not likely to have one,” replied Myron drily.
“You will have if my plan works out. Now you listen. If I’m going
to captain next year’s team—and I am, old chap; don’t you doubt it!
—I want some players around me. I don’t want to run up against
Kenwood and get licked. That might do when some other fellow’s
running things, but not when I am. No, I want some real players
with me, Foster. So I’m building my team this fall.”
Myron laughed. “Honest, Cummins, you’re the craziest chump I
ever met! Are you—are you in earnest?”
“Why not? Good, practical scheme, isn’t it? What’s wrong with it?”
“Well, but—you’re not captain! And how can you build up a team
when you’re not?”
“How? You watch me. Take your case, old chap. Maybe you won’t
make good this year. Mind, I say maybe. I think you will. But if you
don’t, what?” Myron shook his head helplessly, signifying he gave it
up and that no matter what the answer proved to be he was beyond
surprise! “Why, you’ll be A1 material for next—if you keep your head
up. That’s my game, to see that you keep going and learn all the
football you can and don’t drop out of training after the season’s
over. I think basket-ball will be a good thing for you to take up,
Foster. Or you might go in for the gymnastic team. But I won’t have
you playing baseball, so don’t get that bug in your bonnet. Baseball’s
spoiled a lot of good football chaps. Track’s all right if you don’t
overdo it. We’ll settle all that later, though.”
“Very well,” agreed Myron docilely. “Don’t mind me.”
Chas grinned. “Not going to—much. But you see the idea, don’t
you? What do you think of it?”
“I think,” returned Myron deliberately, “that it’s one of the craziest
schemes I ever heard of.”
Chas looked much pleased. “All right. And then what?”
“And I think it may work out beautifully.”
“Sure it will! So that’s why I went after you, old chap. You’re a
‘prospect.’”
“Oh,” said Myron demurely, “I thought it was because you had
taken a violent fancy to me.”
“That too! Don’t make any mistake, old chap. I want fellows of the
right sort, and I want fellows that I like and who like me. I can do
things with that sort: they’ll work for me. And I’ll work for them:
work my fingers off if necessary. Now for the plan.”
“I’m listening,” said Myron.
“How’d you like to get on the first this fall, Foster?”
“Well, seeing that I’m black-and-blue pretty nearly all over, that
seems sort of—of idle!”
“Just getting black-and-blue isn’t enough, old chap. Lots of dubs
are purple-and-green that’ll be dropped next week. Now, look here.
Who told you you were a born half-back?”
“No one, of course. I’ve played that position, though, and know it.
I played end for a while too, but half seemed to be my place.”
“Yes. Well, we’ve got exactly five good to middling half-backs this
year, Foster, and you’re no better than about two of them and not
nearly so good as two more, Brown and Meldrum. So, you see,
you’re sort of up against it. See that, don’t you?”
“I suppose so. Just the same, if I had a chance I might beat
Brounker and Vance, and then, if Brown or Meldrum——”
“Broke his neck you’d get in?” asked Chas impatiently. “What’s the
good of that sort of figuring? What you want to do, old chap, is to
go after something that shows a chance of success. That other
game’s too much like waiting for dead men’s shoes, as they say. You
might get into the big game for five minutes, or you might not. And
I’m not so dead sure that you could beat out those fellows. And,
anyway, there’s still Robbins against you. Yes, I know he isn’t such a
wonder now, but suppose he starts to come while you’re coming?
How do you know he won’t come just as fast, or a little bit faster?
No, that’s rotten planning, Foster. You’re all wrong. Forget that
you’re a half and go hard after a job that’s open to you.”
“Where’ll I find it?” asked Myron. “What other position is there?”
“Full-back,” said Chas.
CHAPTER XVI
CONSPIRACY

“Full-back!” exclaimed Myron. “Why, I never played it! I don’t


know it! I——”
“Piffle! What’s the difference? Any chap who can play half well can
play full-back decently. Besides, I’ve got a strong hunch that you’d
make a good one, Foster. You aren’t as heavy as I’d like you, but
you’re fast and you start quick and you hit ’em hard. When it comes
right down to it, I’m not sure I wouldn’t as soon have a lighter man
who can jump off quick as a heavier one who gets going slow. But
the big idea about turning you into a full-back is that you’ll have a
fair show for that position. I like Steve Kearns, but he ought never to
have been taken back from the line. He was a mighty promising
tackle last year until Desmond got damaged and we had to have a
full-back in a hurry. As for Williams and Bob Houghton, they aren’t
more than fair. There’s a nice job waiting for a smart, steady full-
back who’ll live on the premises and be kind to the dogs, Foster. And
I nominate you.”
Myron made no answer for a moment. This thing of having some
one else arrange his affairs was a bit startling. Finally he said,
doubtfully: “Aren’t we forgetting that Driscoll and Mellen have
something to say, Cummins?”
“Not a bit of it. What we’ve got to do is show them that you are
the fellow they want there. Then they’ll simply have to have you.”
“It would be learning a new game, though.”
“Rot! The positions aren’t very different. Just think a minute.”
Myron thought. Then:
“How about punting?” he asked dubiously.
“I’ve seen you do thirty,” answered Chas.
“You seem to have made a life study of me,” laughed Myron. “Yes,
I can do thirty, and better, too, I guess, but I’ve never had much of
it to do and I don’t believe that I can place my kicks, and I don’t
know how I’d get along if a bunch of wild Indians was tearing down
on me. I’d probably get frightfully rattled and try to put the ball
down my neck, or something.”
“You’d need practice, of course,” Chas granted. “I could show you
a few things myself, and if you went after the position Driscoll would
see that you got plenty of punting work. Don’t let that worry you.
The thing to do, and it may not be so easy, is to persuade Driscoll
that you have the making of a good full-back.”
“Ye-es.” Myron was silent a minute. “I’d like to ask you something,
Cummins,” he said at last.
“Shoot!”
“What other changes are you considering on the team?”
Chas chuckled. “None, just now. I had thought—but never mind
that. You see, what I want to do, Foster, is to fix things so that when
next September rolls around I’ll have the making of a good team. A
lot of this year’s bunch will graduate, you know. I’ve got to make
sure that there’ll be other chaps to take their places. For instance,
Steve Kearns, even if he was a corking good full-back, wouldn’t do
me any good next fall because he won’t be here. Don’t get it into
your bean that I’m queering this year’s team for the sake of next
year’s, though, because that’s not the idea. I wouldn’t do that if I
could.”
“I begin to believe you could, all right,” said Myron. “I have a
notion that if you thought it would be better to have some one else
captain you’d talk Mellen into resigning!”
“Well, I dare say I’d try it,” laughed Chas. “Now what do you say?”
“About this full-back business? Why, I’m willing, Cummins. I’m not
getting anywhere as a half-back, and I guess I wouldn’t do much
worse at the other stunt. But what I don’t see is how I’m to
persuade the coach to let me change.”
“I know. I haven’t got that quite doped out yet. I don’t believe just
asking for a chance to play full-back would do. He might fall for it,
and he might not. You let me mull that over until tomorrow and I’ll
see if I can’t hit on some scheme. Meanwhile, if I were you I’d sort
of put myself through an exam and see how much I knew about
playing full. You might take a book that I have along with you and
read what it says about it. It’s not a very new book, but it’s the best
that’s ever been written, and there isn’t much difference in a full-
back’s job then and now. I’ll see you at the field tomorrow. By the
way, are you going with the team Saturday?”
“To North Lebron? I don’t know. I don’t suppose Driscoll will take
me with the squad, but I might go along and see the game.”
“You’d better. It doesn’t hurt a fellow to see all the football he can,
even if he sees it from the stand. Got to beat it? Well, here’s the
book, old chap. And mind, not a word to any one about this
business. It’s between you and me, Foster.”
Myron found Joe and Andrew Merriman in the room when he got
back, and he took his part in the talk for a half-hour or so. When
Andrew went he pushed his school books aside and opened the little
blue-bound volume that Cummins had loaned him. Joe, across the
table, half-hidden by the drop-light, knotted his fingers in his hair
and groaned at intervals. At ten both boys yawned and went to bed.
Myron was not a sparkling success in Latin class the next forenoon.
A three o’clock recitation made him somewhat late for practice
and Cummins was trotting about the gridiron in signal work when he
arrived at the field. Mr. Driscoll sent him over to the second team
gridiron to join the third squad and so, after all, he didn’t learn from
Cummins whether the latter had found a solution to their problem.
Nor did he run across Cummins again that day. The first team was
let off early, all save the punters and goal-kickers, and Cummins had
left the gymnasium when Myron got there at half-past five. He
considered looking him up at his room after supper, but he had
rather more than half promised Joe to go over to Merriman’s and so
decided not to.
There was no practice for the first the next afternoon, but the
other squads were put through a full day’s work. To Myron’s
surprise, Cummins took command when scrimmage time came,
Coach Driscoll disappearing from the field. Myron found himself at
left half on the second squad, with Houghton at full-back. In that
position he played for five minutes. Then Cummins, who was
evidently very hard to please today, called a halt.
“That’ll do, Bob,” he told Houghton. “O Billy! Got a full-back
there?”
“I have not,” answered the trainer. “I’ve got a half here. Want
him?”
“Wait a minute.” Cummins ran his eye over the second squad
backs. “Foster, have you ever played full?” he growled.
“No,” answered Myron.
“Want to try it? All right, fall back here. Send your half in, Billy.”
Myron heartily wished that Cummins hadn’t shifted him, for while
he had a very fair notion of a full-back’s duties, he wasn’t at all keen
about displaying his knowledge under those circumstances. He was,
he felt, bound to make a hash of the job, and there were several
fellows within a few yards who would be tickled to death to have
him do so. He was glad he had discounted his failure by
acknowledging his inexperience. When Cummins had asked him, he
hadn’t known whether the temporary coach had expected him to say
yes or no. He didn’t know yet, but he felt that his reply had certainly
been the better one.
Cummins wasn’t gentle with him. Every mistake he made, and he
made many, was pointed out to him in emphatic language. Myron
wanted to pinch himself to make certain that he wasn’t dreaming.
Cummins had conspired with him to get him into the position of full-
back and now he was snarling and growling at him quite as though
Myron had forced himself into the place on false pretences. Myron
thought that in consideration of the circumstances Cummins might
have dealt a little less harshly with his shortcomings. But, on the
whole, Myron didn’t do so badly. He honestly believed that he was
playing as well as the deposed Houghton. Cummins didn’t let him
punt, for which he was grateful, and he encouraged Warren, who
was playing at quarter, to use many end plays. Outside of tackle,
Myron was usually successful whenever he received the pigskin, and
he once or twice made good on plunges at the centre of the line.
There, however, his lack of weight told somewhat. In the first
twelve-minute period the second squad got one touchdown and goal
and might have had a second score if Cummins had not put them
back from the eight yards to the eighteen on some whim of his own.
Third got the ball on downs six inches from the last white streak and
punted out of danger, and the second was mad enough to rend
Cummins limb from limb! When a five-minute rest came Cummins
called Myron from the bench and led him into the field. To those
watching it was perfectly evident that Chas was telling the green
full-back how absolutely rotten he was. They would have been
surprised had they heard the conversation out there.
“You weren’t half bad, old chap,” said Chas eagerly, yet scowling
ferociously still. “You slowed up once or twice when you hit the line,
though. Try to keep going hard. A good way to do is to think of the
other fellow’s goal line instead of his players. Sort of make yourself
think that’s where you’re going. You’ll get farther before you’re
stopped, if you are stopped. How do you like it?”
“All right,” answered Myron, a bit grumpily. “But considering that
I’ve never played it before it seems to me you might let up on me a
bit. You go on as if I’d murdered my grandmother!”
“Why, sure,” chuckled Chas. “You don’t want those fellows to think
I’m pulling for you, do you? It’s got to look like an accident, don’t
you see? I want to be able to tell Driscoll tonight that you went in at
full in an emergency and played a corking good game. Then, if he
has half the sense I think he has, he will put you in there himself the
first of the week and look you over. By the way, want to try a little
punting in the next period?”
“I don’t believe I’d better,” answer Myron. “I guess I’d rather not.”
“Maybe you’re right. If you made a mess of a punt it would sort of
take off a few good marks. All right. Now see if you can do a little
better still this half. And don’t mind my growls, old chap. You’re
getting no worse than any other fellow would get.”
Twelve more minutes of hard playing followed in which the third
turned the tables with a long run that netted a touchdown. But the
try-at-goal failed and, after the second had battered its way to the
enemy’s twelve yards, Warren’s attempt at a drop-kick went wide
and the referee, the assistant manager, blew his whistle. In that
second period Myron did a little better because he was learning his
duties, but it would be an exaggeration to say that he showed
phenomenal ability as a full-back. He made several good games,
gains, was strong in defensive play and got off one very pretty
forward pass to Mistley that netted twenty yards. In short, Chas had
to show a little more enthusiasm than he actually felt when he spoke
to Coach Driscoll that evening. There had been a final conference in
the coach’s room at half-past seven attended by the trainer, the
managers and seven of the players, and the last problem of the
morrow’s game had been solved more or less satisfactorily.
Afterwards, Chas remained behind with Jud Mellen and Farnsworth
and Harry Cater for a sociable chat. None of them meant to talk
football, and none of them did for a full quarter of an hour, but it is
difficult to keep the subject uppermost in the mind out of the
conversation, and presently Jud said thoughtfully:
“I wish we had about three more good plays, Coach.”
“We’ve got enough, Cap,” was the confident reply. “No use trying
to remember too many at this time of the season. Better know ten
or twelve well than half know twenty. It isn’t lack of plays that will
beat us tomorrow, if we are beaten——”
“Sure to be,” interpolated Katie cheerfully.
“Well, it’ll be because we haven’t got our attack working, then.
Musket Hill is well ahead of us in development, and that’s going to
count, fellows. However, we may show them something, at that.”
“By the way, Coach,” said Chas, “I ran out of full-backs this
afternoon and used that fellow Foster through most of two periods.
He wasn’t half rotten, if you ask me. He’d never played it in his life,
either.”
“Foster? What happened to Houghton?”
“It wasn’t his day,” said Chas. “So I had to find some one else for
the second squad.”
“Houghton hasn’t had a day for a good while,” murmured
Farnsworth drily.
“For the love of Mike,” exclaimed Jud Mellen, “if we can make a
full-back of Foster, let’s do it, Coach! It’s the weakest position on the
team right now.”
“I’ve been thinking that Kearns would come on,” said Mr. Driscoll,
“but he doesn’t seem to get the hang of it.”
“He works hard enough,” said Katie.
“How did you happen to choose Foster?” asked the Coach of Chas.
“You had Wiborg. He’s played full.”
“Don’t think he was there. I asked Billy and Billy only offered me a
half.”
“Wiborg wasn’t out today,” explained the manager. “He’s been
having some trouble with the Office. Nothing serious, I believe, but
he asked for a cut.”
“You say Foster showed up pretty well, Cummins?”
“He really did, Coach. Of course, I don’t know how he’d be at
punting, but he made some mighty good gains from kicking
formation and went into the third pretty hard from close in.”
“He could be taught enough punting to get by with,” suggested
Captain Mellen. “Maybe he’ll be a find, Coach. I’ve said right along
that he looked good.”
“No harm in trying him,” mused Mr. Driscoll. “If Kearns doesn’t
show something tomorrow we’ll need a good full-back. Much obliged
for the tip, Cummins. Well, good night, fellows. Get a good sleep and
be ready with the punch tomorrow. We want that game if we can
get it!”
CHAPTER XVII
A CHANCE ENCOUNTER

The team left for North Lebron at eleven o’clock the next
forenoon. The town that had the honour of containing Musket Hill
Academy was not so far away in distance, but those who had
arranged the train service had not consulted the Parkinson School
Football Team, and as a result of this oversight there was an hour
and a half to be spent at a junction that boasted, besides a decrepit
station, only a blacksmith’s shop, a general store and eight assorted
dwellings. Myron knew that there were eight dwellings because he
counted them twice. There wasn’t much of anything else to do.
He was not journeying to North Lebron in any official capacity, for
his name had not been amongst those announced yesterday by
Manager Farnsworth. He was going along, with some sixty other
“fans,” mostly because Chas Cummins had insisted on his doing so.
Privately, he had entertained the thought up to an hour after
breakfast that, not having been invited to attend the contest as a
member of the team, it would be the part of dignity to remain away.
But Chas wasn’t greatly concerned with dignity, and he had a
masterful way with him, and the result was that at a little before
nine o’clock Myron was in possession of the knowledge that he was
going to North Lebron at eleven-four.
At twelve he was seated on an edge of the platform at the
junction, juggling three pebbles in his hand and boredly wondering
what it would be like to have to live in the fifth dwelling; the one
with the blue-green blinds and the sagging porch and the discarded
wagon-seat serving as a porch settle. The day was positively hot for
October and few of the travellers had elected to remain inside the
coaches. Some of the school fellows were adorning the platform, like
Myron, others were strolling about the adjacent landscape in search
of adventures, and a merry handful were exercising the baggage
truck up and down the planks to the restrained displeasure of the
sad-looking station agent. Coming over, Myron had shared a seat
with a stranger, a lad of fourteen or so, and had managed to pass
the time in conversation on various subjects, but now the youngster
had disappeared and no one else appeared to care about taking his
place. Joe and Chas were with the football crowd in the forward car,
and Myron had seen neither of them to speak to since leaving
Warne. Andrew Merriman had not been able to come. In
consequence, Myron had no one to talk to and was fast reaching the
decision that he would have had more pleasure had he remained at
home. Even the assurance that he was irreproachably arrayed in a
suit of cool grey flannel, with a cap to match, a cream-coloured shirt
and patriotic brown tie and stockings didn’t mitigate his boredom. Of
late he had been deriving less satisfaction than of yore from his
attire. Somehow, whether his tie and stockings matched or whether
his trousers were smoothly pressed seemed of less consequence to
him. Several times of late he had forgotten his scarf-pin!
His discontented musings were interrupted by the arrival beside
him of a youth of perhaps nineteen. Myron had glimpsed him once
on the train and been struck by his good looks and by the good taste
of his attire. He wore blue serge, but it was serge of an excellent
quality and cut to perfection. And there was a knowing touch to the
paler blue scarf with its modest moonstone pin and something
pleasantly exceptional in the shape of the soft collar. Myron felt a
kindred interest in the tall, good-looking youth, and determined to
speak to him. But the stranger forestalled him, for, as soon as he
had seated himself nearby on the platform edge, he turned, glancing
at Myron and remarked: “Hot, isn’t it?”
The stranger’s tone held just the correct mixture of cordiality and
restraint. Myron, agreeing, felt flattered that the well-dressed youth
had singled him out. The weather, as a subject of conversation, soon
failed, but there were plenty of other things to discuss, and at the
end of ten minutes the two were getting on famously. The stranger
managed to inform Myron without appearing to do so that he was
interested in a sporting goods house in New Haven, that he had
been in Hartford on business and that, having nothing better to do
today, he had decided to run over to North Lebron and see the game
between Musket Hill and Parkinson. “I fancy you’re a Parkinson
fellow?” he said questioningly. And when Myron acknowledged the
fact: “A fine school, I’ve heard. I’ve never been there. Warne’s off
my territory. I’ve been thinking, though, that some day I’d run over
and see if I could do any business there. I suppose you chaps buy
most of your athletic supplies in New York.”
“I think so. There’s one store in Warne that carries a pretty fair
line of goods, though.”
“I think I’ll have to try your town. Parkinson’s rather a big place,
isn’t it?”
“We have over five hundred fellows this year.”
“Is that so? Why, there ought to be some business there for my
house. I suppose you chaps go in for most everything: football,
baseball, hockey, tennis? How about track athletics?”
“There’s a track team,” answered Myron, “but this is my first year
and I don’t know much about it yet.”
“I see.” The other looked appraisingly and, Myron thought, even
admiringly over his new acquaintance. “I say, you look as if you
ought to be playing football yourself, old man. Or is baseball your
game?”
“Football, but I’m not on the first. It’s hard work breaking in at
Parkinson.”
“Good guess of mine, wasn’t it?” laughed the other. “Thought you
had the build for a good football man. I meet a good many of them,
you see. How’s this team you’ve got ahead there? Going to lick
Musket Hill this afternoon?”
“I don’t know. I hope so. I have an idea that our coach rather
expects a hard game, though. I’ve heard that Musket Hill is further
along than we are.”
“Those fellows play good football,” said the stranger. “I’ve seen
them in action once or twice. I hope you chaps get away with the
game, but my opinion is that you’ll have to go some to do it. Got
some good men on your team?”
Myron was quite willing to sing the praises of Parkinson, and
during the ensuing half-hour the stranger was treated to quite a
fund of information regarding the school, the football team and
Myron Warrenton Foster. Football, though, seemed to interest the
tall youth most of all, and several times Myron was turned back to
that subject by polite questions. When the train from the south
pulled in the two were still conversing and it was but natural that
they should share a seat for the remainder of the journey. The
stranger could talk interestingly himself and the last part of the trip
was occupied with absorbing and even startling adventures met with
by him in his business trips. More than once Myron’s credulity was
severely taxed, but a glance at the narrator’s frank and pleasing
countenance dispelled all suspicions of mendacity. Myron found this
chance acquaintance so interesting that he rather hoped they might
witness the game together, but when North Lebron was reached the
stranger announced that he had one or two errands to attend to
before going up to the field.
The stranger was treated to quite a fund of
information

“Maybe I’ll run across you there—er—What’s the name, by the


way?”
“Foster.”
“Mine’s Millard. I haven’t a card with me. Wish I had. But, I say,
Foster, if you don’t mind I’d like to look you up if I get to Warne.
Those little towns are dull holes if you don’t know any one in them.”
“I wish you would!” said Myron. “You’ll find me in 17 Sohmer Hall.
Can you remember that?”
“Sohmer, you said? Number 17? I’ll remember, Foster. Awfully glad
to have met you. It’s jolly nice to run across a chap who’s—well, a
chap who has your own views on things, if you get me.” He shook
hands cordially, evidently regretfully. “I’ll try to find you at the game,
old man. If I don’t, look for me in your burg before long. I’m going
to have a go at that dealer you spoke of.”
“I’ll try and save a seat for you if you think you’re likely to find
me,” offered Myron.
But the other waved a hand. “Don’t bother. I can squeeze in. And
I may be rather late in getting there. Good-bye and good luck. Hope
you beat ’em!”
That encounter restored both Myron’s self-esteem and good
humour, and he enjoyed the sandwich and pie and milk which he ate
in company with half a hundred other youths at the little lunch-room
on the way uptown. Later, wandering by himself through the leaf-
strewn streets about the school campus, he came across Joe and
Paxton Cantrell, the latter a sturdy, wide-shouldered youth who was
playing his second—and last—season at centre. Cantrell left them a
minute or two later to speak to an acquaintance and Myron and Joe
walked on to the school gymnasium together.
“They fed us at a hotel down there by the station,” said Joe sadly,
“and I want to tell you that not one of us over-ate. Everything came
to us in bird baths and you needed a microscope to find the
contents. Norris lost his roast beef and didn’t find it until he was
through dinner, and where do you suppose it was?”
“In his lap, I guess.”
“No, sir, it had slipped under his thumb-nail!”
Myron told of the stranger encountered at the junction and was
quite full of his subject, but Joe didn’t seem to find it interesting and
soon interrupted to point out a building. “What do you suppose that
is?” he asked. “Looks like a factory of some sort, don’t it? Only it
ain’t—hasn’t got any chimneys, as far as I can see.”
“Maybe it’s a hospital or something,” replied Myron. “He says he’s
coming to Warne pretty soon and will look me up. I’d like to have
you meet him, Joe.”
“Who’s this?”
“Why, Millard, the chap I was speaking of,” answered Myron
disgustedly.
“Oh! Glad to know him. Which street do we take now?”
They parted at the gymnasium and Myron joined the throng
pressing toward the field, a short block away. He looked for Millard,
but didn’t see him. Later, during the intermission, he thought he
caught sight of him in the throng behind the Musket Hill bench, but
others intervened and he was not able to make certain.
The game started at half-past two, by which time the morning
heat had been somewhat abated by a fresh breeze that blew across
the oval field and fluttered the big maroon banner above the
covered stand that held the Musket Hill rooters. Parkinson’s sixty odd
supporters, grouped together on the other side of the field, did
valiant service with their voices, but to Myron it seemed that their
contribution to the din that prevailed as the two teams trotted on
together was very slight. He was wedged in between a stout youth
named Hollis, whom he instinctively disliked because of his high-
pitched voice, and a studious-appearing boy in spectacles whose
name he didn’t know. Hollis had vindicated Myron’s verdict before
the teams had finished warming up by showing himself to be one of
those cock-sure, opinionated and loud-talking youths of which every
school is possessed. His neighbour at his left elbow proved
inoffensive and only once during the game uttered any sound that
Myron could hear. Then, while every one else was on his feet,
shouting and gesticulating, the spectacled youth smiled raptly and
murmured, “Oh, bully indeed!”
Myron purchased a score-card from a boy with a maroon band
about his arm, exchanging a bright ten cent piece for a flimsy,
smoochy slip of paper that, so far as the visiting team was
concerned, was as untruthful as it was unlovely. The card declared
that “Mullen” would play left tackle for Parkinson, that “Sawtrell” was
her centre and that “Wildram” was the name of her left half-back.
Myron corrected these misstatements when Captain Mellen had
trotted his warriors out on the field, and some others besides, for
Coach Driscoll had sent five substitutes to the fray, four linemen and
a back. When Myron had got through making over his score-card it
looked like one of his corrected English compositions and read as
follows: Stearns, l.e.; Mellen, l.t.; Brodhead, l.g.; Cantrell, c.;
Dobbins, r.g.; Flay, r.t.; Grove, r.e.; Cater, q.b.; Brounker, l.h.; Brown,
r.h.; Kearns, f.b.
Myron was glad that Joe was to have his chance in a real game,
and for the first period watched his room-mate so closely that the
general aspect of the game was quite lost on him and he came to
with a start when the teams changed fields, realising that however
nicely Joe had played—and he had played well: there was no
question about that—the eleven as a whole had failed to show
anything resembling real football. While neither team had found its
gait, Musket Hill had already threatened the visitors’ goal and only a
sad fumble had held her away from it. And now, with the second
ten-minute period beginning, the ball was again in the Maroon’s
possession on Parkinson’s thirty-three yards. Myron sat up and took
notice, deciding to let Joe play his game unaided by telepathic waves
from the grandstand!
Musket Hill was a heavy team, although her players got their
weight from height rather than breadth. They were, almost without
exception, tall, rangey youths with an extremely knowing manner of
handling themselves. Myron’s brow clouded as he watched that first
play after the whistle. Musket Hill used an open formation, with her
backs side by side a full pace further distant than usual. From this
formation, with the quarter frequently joining the line of backs at left
or right, Musket Hill worked a variety of plays: straight plunges at
centre, delayed passes sliding off tackle, quarter-back runs, even
punts, the latter, thanks to a steady bunch of forwards, never
threatened with disaster. The Maroon played a shifty game, changing
her plays often, seldom attacking the same place twice no matter
what gains might result. Toward the end the latter rule did not hold
good, but for three full periods she observed it rigorously, even to
the impatience and protests of her supporters. Before that second
period was three minutes old she had settled down into her stride
and demonstrated the fact that, whatever favours of fortune might
occur, on the basis of ability alone she was more than a match for
her opponent.
The Maroon secured her first score less than three minutes from
the start of the second quarter as unexpectedly as deftly, and Myron
and his companions on the west stand had scarcely recovered from
their surprise by the time the goal was kicked! The ball had been on
Parkinson’s forty-two yards, after Musket Hill had punted, caught
again and carried the pigskin four yards in two downs. The Maroon’s
trick of punting from that three-man formation, and close to the line,
had got the enemy worried. The latter was never quite certain when
an unexpected kick would go over a back’s head, for Musket Hill
punted without rule or reason, it seemed. To keep two men up the
field at all times was impossible, and so Parkinson compromised and
put Brown midway between the line and Cater. As Musket Hill had
netted but four yards in two downs, it was fair to assume that she
was just as likely to kick on the third down as to rush, and Brown
edged further back at Cater’s call. But Musket Hill did the
unexpected. There was a quick, dazzling movement behind her line
and then the ball arched away to her left. Somehow an end was
under it when it came down and, although Stearns almost foiled
him, caught it and reached the five-yard line before he was seriously
challenged by Brodhead. He had kept close to the side-line, and
Brown, playing well back, was his nearest foe when the twenty-five-
yard line was reached. But Brown never had a chance, for a Musket
Hill youth brought him low, while a second effectively disposed of
Cater a moment after. Brodhead alone stood for an instant between
Welcome to our website – the perfect destination for book lovers and
knowledge seekers. We believe that every book holds a new world,
offering opportunities for learning, discovery, and personal growth.
That’s why we are dedicated to bringing you a diverse collection of
books, ranging from classic literature and specialized publications to
self-development guides and children's books.

More than just a book-buying platform, we strive to be a bridge


connecting you with timeless cultural and intellectual values. With an
elegant, user-friendly interface and a smart search system, you can
quickly find the books that best suit your interests. Additionally,
our special promotions and home delivery services help you save time
and fully enjoy the joy of reading.

Join us on a journey of knowledge exploration, passion nurturing, and


personal growth every day!

ebookbell.com

You might also like