Application of Linear Algebra in Cryptography - Judithlopez - S20216454W
Application of Linear Algebra in Cryptography - Judithlopez - S20216454W
Application of Linear Algebra in Cryptography - Judithlopez - S20216454W
FOUNDATION OF
MODERN MATHEMATICS
Final Essay
APPLICATIONS OF
LINEAR ALGEBRA
IN CRYPTOGRAPHY
Fall – Winter
2021 -2022
ABSTRACT
This paper in intended to provide some examples on the application of linear algebra in
cryptography. An introductory brief explanation on the concept of cryptography is presented,
followed by the explanation of some cryptography systems and examples with some algebraic
exercises, also a description on the current status of cryptography methods is offered.
Conclusion refers to the potential that algebra possess, allowing for more complex and secure
cryptography systems to be developed.
INTRODUCTION
Throughout this course, we have had the opportunity to review knowledge and concepts about
algebra. Within the area of mathematics, algebra serves as a method for the description of
operations, formulas, and equations in a concise and efficient way, thus becoming an ideal tool
for the definition and automation of processes, as is the case in its application. in cryptography.
The term cryptography from the Greek kryptos meaning "hidden" or "secret", is a concept that
is not unknown due to its popular use nowadays due to the practices of protecting and ensuring
from the interference of third parties, the data constantly shared to through the various media.
Cryptography nowadays has developed into a practice and study to secure communications in
many different fields. The main purpose of cryptography is that only the sender and the
intended recipient of the message can view and understand its content.
Cryptography has used algebra to define from basic operations to complex processes in the
encryption of information. Through this paper, we will proceed to break down what this
relationship between algebra and cryptography is like.
Cryptography can be described as the practice of enciphering and deciphering messages into
codes that can only be intelligible for the one who sends the message and the receiver. Due to
the necessity of protecting information from the attack of outsiders, principles of cryptography
are today applied to the encryption of multiple network communications. In particular, the
secure exchange of computer data is of great importance to banking, government, and
commercial communications.
Cryptography played a major role in the course of World War II, and some of the first working
computers were dedicated to cryptanalytic tasks.
Cryptography and computer science are intimately associated, since in the present-day
computing devices are in charge of performing complex calculations in order to encipher and
decipher messages, the capability of the computing resources is in direct relationship with the
amount of complexity in the method to be applied.
The transformation of data in cryptography provide solutions to two major problems of data
security: the privacy problem, preventing an opponent from extracting information from a
communication channel, and the authentication problem, preventing an opponent from
injecting false data into the channel or altering messages so that their meaning is changed.
A very simple expression for this relationship between original message and encrypted
message, is that where we have a plaintext or unenciphered message P, which is to be
communicated to a legitimate receiver susceptible to the attack of a third party. To prevent the
outsider from learning the contents of P, the transmitter enciphers or encrypts P with an
invertible key K to produce the cryptogram or ciphertext C = K(P). When the legitimate
receiver obtains C he deciphers or decrypts it with the inverse transformation K-1, P = K-1 (C).
If cryptanalyst cannot deduce P from C, or C from P without prior knowledge of the key, the
cryptographic system is said to be secure.
Beginning with some basic transformations and then going through some exercises applying
linear algebra, we are going to examine a number of representative examples of cryptography
systems:
1. Substitution
Have been used throughout history, one of the most famous is the caesarian cypher, named
after Julius Caesra (100BC - 44BC). In a Caesar cypher, the cyphertext is always shifted by 3
from the plaintext, A = D, B = E, C = F, etc. In this method each letter of the alphabet from the
plaintext is substituted with a different letter to obtain the cypher text, the key is one of the
possible permutations of the alphabet.
Example:
ABCDEFGHIJKLMNOPQRSTUVWXYZ - BWEKQFMVYALUCONPHSIDXTRGZJ
Plaintext:
TODAY IS A GREAT DAY
Transformed:
DNKBZ YI B MSQBD KBZ
Figure 01.
2. Transposition
In transposition, the position of the plaintext letters in the message rather than the letters of the
alphabet are permuted. An early version of a transposition cipher was a Scytale, in which paper
was wrapped around a stick and the message was written. Once unwrapped, the message would
be unreadable until the message was wrapped around a same-sized stick again (see Figure 02).
Figure 02.
One modern transposition cipher is done by writing the message in rows, then forming the
encrypted message from the text in the columns.
Example:
Encrypt the message “WE ARE GOING TO THE BEACH TOMORROW AFTER TEN” in a
6x6 matrix:
Figure 03.
Substitution and transposition, although very simple and easy to decipher techniques have been
the start point in the search for more secure and sophisticated methods that evade frequency
and the employment of inverse keys in deciphering encrypted messages.
3. Polyalphabetic Cipher
It was introduced to improve monoalphabetic technique in the substitution method. It was the
cryptographers answer to frequency analysis. In this type of method, the alphabets for a
particular letter in the original world will not repeat in the resulting encrypted message.
3.1.Vigenère Cipher
Example:
The word MAMA = {(13), (1), (13), (1)} could be arranged in a 2x2 matrix:
13 1
13 1
A random Key BLXZ = {(2), (12), (24), (26)} with the same length is implemented, gives us:
2 12
24 26
+ , mod 26 =
The encrypted message would read as OMKA = {(15), (13), (11), (1)}. As we can see, the
frequency of letters is lost in the result. If needed, transposition can be added to obtain more
complexity.
The decryption operation would read as:
- , mod 26 =
The primary weakness of the Vigenère cipher is that periodic keys tend to be use by repeating
a certain combination of letters until the same length of the message is obtained. If a
cryptanalyst correctly guesses the key's length n, the cipher text can be broken.
The Kasiski examination, also called the Kasiski test, takes advantage of the fact that repeated
words are, by chance, sometimes encrypted using the same key letters, leading to repeated
groups in the ciphertext.
If a plaintext is enciphered with a periodic polyalphabetic cipher, and the resulting cryptogram
is superenciphered with a second periodic polyalphabetic cipher with a different length,
cryptanalysis of such multiple systems is more difficult but can still be decipher.
Another form of polyalphabetic cipher is the Hill cipher, which formula is written as:
Ci = Ai Pi mod 26
i, position of the character
Ci , encrypted message
Ai, encryption key
Pi, original message or plaintext
Mod 26, is used to keep the resulting numbers in the range of 1-26 letters of the alphabet
In this case some additional steps are to be considered since the inverse of A applying modulo
26 is required, which is different to the conventional inverse of A = A-1. A modular
multiplicative inverse is needed, this is an integer x such that the product ax is congruent to 1
with respect to the modulus m. This can be written as: ax = 1 mod (m).
P = (13 1)T
(20 8)T
A= 1 1
0 3
Then we have:
Ci = 1 1 13 mod 26 = 14
0 3 1 3
Ci = 1 1 20 mod 26 = 28 = 2
0 3 8 24 24
Now to decrypt the message we need to calculate both matrix inverse and its modular
multiplicative inverse. First step, we calculate det A:
det A = 1 1 = 3,
0 3
The modular multiplicative inverse will be the number that multiplied by the determinant = 1
mod 26. The number that meets this condition is 9, as we can see:
Pi = 1 -9 14 mod 26 = -13
0 9 3 1
1 -9 2 mod 26 -214 = 20
Pi = =
0 9 24 216 8
In opposition to symmetric key algorithms, where the same key is used to both encrypt and
decrypt the message and is also shared by both the sender and the recipient, to use a secure
channel to share the key and the increase in amount of generated keys when users increase,
becomes a challenge.
Since the appearance of the concept of public-key cryptography in 1975, where a pair of keys
is created, one that can be shared and another only known by the owner, newer techniques are
developed with this approach. This can be obtained through mathematical “one-way”
functions, also known as “trap-door”, these are functions that are easy to compute in one way
but difficult to invert in terms of the needed computational capabilities.
Details on the implementation of these methods are not provided in this paper, being these
calculations outside of the scope of linear algebra and the excessively technical complexities
involved, yet it is mentioned as to present the status of current cryptography techniques.
Was created 1n 1977 as one of the first asymmetric key encryption algorithm. Thought some
consider it outdated, it continues to be broadly used in the present day. It relies on the difficulty
to perform prime numbers factorization, also requires large key lengths and therefore more
computational resources. It is described:
C = Me mod n
M = Cd mod n
Example:
M = 89
n = p x q = 53 x 59 = 3127
e=3
d = 2011
The decryption key can only be applied by a third party or an outsider, only if the value of n
is known, this could be achieved with factorization, yet in terms of human or computational
capabilities would take a large amount of time.
y2 = x3+ ax + b
CONCLUSION
In present days cryptography has become a common term in most circles due to its constant
employment in a ever more globalized world, where more information is exposed through the
different channels of communications and security has become a primary issue for users of
these mediums.
This paper has allowed for a better understanding of the mechanics behind cryptography and
in specific, the role played by algebra when performing these transformations on messages to
obtain secure codes that can be shared without the intrusion of third parties.
Cryptography makes use of the properties of an equation, expressing the relationship of two
expressions, original message (M) and encrypted message (C) through the implementation of
a key (K):
M → encryption K → C → decryption K → M
Algebra plays a primary role on defining the key (K) to both encrypt and decrypt the
information, algebra defines the rules on the application of a series of operations of adding,
subtracting, multiplying, dividing and its different variations with the purpose of transforming
an initial value to a different one.
While some of the examples that were review are very basic exercises, it is only intended to
give a brief idea on how cryptography works, yet it opens a door for all the possibilities and
complexities that algebraic rules and procedures allow.
• Commercial National Security Algorithm Suite and Quantum Computing FAQ U.S.
National Security Agency, January 2016.
• Art of the Problem. Public Key Cryptography: RSA Encryption Algorithm. Youtube.
Retrieved 22, 2021, from https://www.youtube.com/watch?v=wXB-V_Keiu8