Post on 08-Apr-2018
transcript
8/7/2019 Maths Term Paper
1/14
MATHEMATICS TERM
PAPER(USE OF MATRICES INCRYPTOGRAPHY)
NAME OF STUDENT----ARINJOY DATTA
REGISTRATION NO.----11006522AID----6383
GROUP----G7001
ROLL NO----A12
DATE OF SUBMISSION----17THNOV 2010
NAME OF FACULTY-----VANDANA JAIN
8/7/2019 Maths Term Paper
2/14
ACKNOWLEDGEMENT
I GREATFULLY THANK OUR LPU MANAGEMENT AS VELL AS OUR TEACHER MISS
VANDANA JAIN UNDER WHOSE KIND CO-OPERATION I WAS ABLE TO COMPLETE
THIS PROJECT.
SECONDLY I WOULD ALSO LIKE TO THANK SOME BOOKS AND SOME WEBSITES
WHO HELPED ME MAKE THE PROJECT.
THIS PROJECT IS THE TERM PAPER OF MATHEMATICS FOR THE FIRST
SEMISTER OF FIRST YEAR OF 1201D BATCH 2010.
! THANK YOU !
BY ARINJOY DATTA
8/7/2019 Maths Term Paper
3/14
CONTENTS
INTRODUCTION
HISTORY
USING MATRICES IN CRYPTOGRAPHY
BIBLOGRAPHY
8/7/2019 Maths Term Paper
4/14
USE OF MATRICES IN CRYPTOGRAPHY
INTRODUCTION----
ryptography, to most people, is concerned with keeping communications private. Indeed,
the protection of sensitive communications has been the emphasis of cryptography
throughout much of its history. Encryption is the transformation of data into someunreadable form. Its purpose is to ensure privacy by keeping the information hidden from anyone
for whom it is not intended, even those who can see the encrypted data. Decryption is the reverse
of encryption; it is the transformation of encrypted data back into some intelligible form.
C
Cryptography is the stuff of spy novels and action comics. Kids once saved up Ovaltine labelsand sent away for Captain Midnights Secret Decoder Ring. Almost everyone has seen atelevision show or movie involving a nondescript suit-clad gentleman with a briefcase
handcuffed to his wrist. The term espionage conjures images of James Bond, car chases, and
flying bullets. And here you are, sitting in your office, faced with the rather mundane task of
sending a sales report to a coworker in such a way that no one else can read it. You just want tobe sure that your colleague is the actual and only recipient of the email and you want him or her
to know you were unmistakably the sender. Its not national security at stake, but if your
companys competitor got hold of it, it could cost you. How can you accomplish this? You canuse cryptography. You may find it lacks some of the drama of code phrases whispered in dark
alleys, but the result is the same: information revealed only to those for whom it was intended.
8/7/2019 Maths Term Paper
5/14
HISTORY OF CRYPTOGRAPHY
Cryptology is the study of hidden writing. It comes from the Greek words Kryptos, meaninghidden, and Graphen, meaning to write. Cryptology is actually the study of codes and ciphers.
Concealment messages aren't actually encoded or enciphered, they are just hidden. Invisible inkis a good example of a concealment message.
A code is a prearranged word, sentence, or paragraph replacement system. Foreign languages arejust like secret code, where the English word "hi" is represented as the word "Hola" in Spanish,
or some other word in another language. Most codes have a code book for encoding and
decoding.
The name cipher originates from the Hebrew word "Saphar," meaning "to number." Most ciphers
are systematic in nature, often making use of mathematical numbering techniques. One exampleof a cipher is the Spartan stick method.
The Spartans enciphered and concealed a message by using a scytale, a special stick and belt.
The encipherer would wrap the belt around the stick and write a message on it. The belt was thenunwound from the stick and sent to another person. Using a stick of similar size, the decipherer
would wrap the belt around the stick to watch the secret message appear. If a stick of the wrong
size appeared the message would be scrambled. Try this with 2 or 3 pencils bound together to
make a stick, a long strip of paper, and another pencil for writing.
Julius Caesar used a simple alphabet (letter) substitution, offset by 3 letters. Taking the word
"help" you would move ahead in the alphabet 3 letters to get "jgnr." This worked for a while,until more people learned to read and studied his secret cipher.
Gabriel de Lavinde made cryptology a more formally understood science when he published hisfirst manual on cryptology in 1379. A variety of codes and mechanical devices were developed
over the next few centuries to encode, decode, encipher, and decipher messages.
In the 1600's Cardinal Richelieu invented the grille. He created a card with holes in it and used it
8/7/2019 Maths Term Paper
6/14
to write a secret message. When he was done he removed the card and wrote a letter to fill in the
blanks and make the message look like a normal letter. The grille proved to be difficult to solve
unless the decoder had the card which created the encrypted message.
In 1776 Arthur Lee, an American, developed a code book. It wasn't long before the US army
adopted a code book of their own for use in the military.
The Rosetta Stone (black basalt), found in Egypt in 1799, had a message encrypted on its surface
in three different languages! Greek, Egyptian, and Hieroglyphics messages all said the samething. Once the Greek and Egyptian languages were found to have the same message the
Hieroglyphics language was deciphered by referencing each letter to a symbol!
Morse Code, developed by Samuel Morse in 1832, is not really a code at all. It is a way ofenciphering (cipher) letters of the alphabet into long and short sounds. The invention of the
telegraph, along with Morse code, helped people to communicate over long distances. Morse
code can be used in any language and takes only 1 to 10 hours of instruction/practice to learn!
The first Morse code sent by telegraph was "What hath God wrought?", in 1844.
During WWI Karl Lody sent the following telegram "Aunt, please send money immediately. Iam absolutely broke. Thank heaven those German swine are on the run." The clerk realized that
this message didn't make any sense and forwarded it to the proper authorities who found Karl
Lody guilty of espionage (spying). Can you see why his message must be a secret code or
cipher? Why doesn't it make any sense?
In 1917, during WWI, the US army cryptographic department broke the code of the Germans.
The code was actually stolen by Alexander Szek, a man working in a radio station in Brussels atthe time. Unknown to the Germans, Szek was an English sympathizer and was stealing a few
code words every day. When the Zimmerman telegraph was sent in 1918, asking Mexico to go to
war against the United States, the US army cryptography department broke the code and decodedthe telegraph.
The Germans learned from this experience and changed their codes. But the British were able toobtain copies of new code books from sunken submarines, blown up airplanes, etc., to continue
breaking the new codes. By WWII navy code books were bound in lead to help the code books
sink to the bottom of the ocean in the event of an enemy takeover.
The little known native Indian language of the Navajo was used by the US in WWII as a simple
word substitution code. There were 65 letters and numbers that were used to encipher a single
word prior to the use of the Navajo language. The Navajo language was much faster and accuratecompared to earlier ciphers and was heavily used in the battle of Io-jima.
The Germans in WWII used codes but also employed other types of secret writings. Onesuspected spy was found to have large numbers of keys in his motel room. After inspecting the
keys it was found that some of the keys were modified to unscrew at the top to show a plastic
nib. The keys contained special chemicals for invisible ink! However, codes and secret ink
messages were very easily captured and decoded.
8/7/2019 Maths Term Paper
7/14
The Germans, responsible for much of the cipher science today, developed complex ciphers near
the end of WWII. They enciphered messages and sent them at high rates of speed across radiowave bands in Morse code. To the unexpecting it sounded like static in the background. One
gentleman tried to better understand the static and listened to it over and over again. The last
time he played his recording he forgot to wind his phonograph. The static played at a very slowspeed and was soon recognized as a pattern, Morse code!
The invention of computers in the 20th century revolutionized cryptology. IBM corporationcreated a code, Data Encryption Standard (DES), that has not been broken to this day. Thousands
of complex codes and ciphers have been programmed into computers so that computers can
algorithmically unscramble secret messages and encrypted files.
Some of the more fun secret writings are concealment messages like invisible inks made out of
potato juice, lemon juice, and other types of juices and sugars! Deciphering and decoding
messages take a lot of time and be very frustrating. But with experience, strategies, and most of
all, luck, you'll be able to crack lots of codes and ciphers.
USING MATRICES IN CRYPTOGRAPHY
In the newspaper, usually on the comics page, there will be a puzzle that looks similar to this:
BRJDJ WT X BWUJ AHD PJYXDBODJ JQJV ZRJV GRJDJ'T VH EJDBXWV YSXEJ
BH FH. 1
Cryptograms are very common puzzles, along with crossword puzzles. Each cipher letter
represents a plaintext letter. The above puzzle is usually fairly easy to solve because the lengths
of the words can easily be seen, along with any punctuation. But, what if the above message
were written as follows:
BRJFJ WTXBW UJAHD PJYXD BODJJ QJVZR JVGRJ TVHEJ DBXWV YSXEJ
BHFH
This would not be as easy to solve since there is no punctuation nor any indication as to how
long the words are. The example above is called a mono-alphabetic cipher message. It is so
named because there is only one alphabet used to make the cipher message. In this paper,polyalphabetic cipher messages will be used to encrypt and decrypt a message. Polyalphabetic
means more than one alphabet will be used.
Moreover, matrices will be used to encrypt these messages.
Take a simple message, such as:
THE RAIN IN SPAIN FALLS MAINLY ON THE PLAIN.
The following matrix will be used to encrypt this message:
8/7/2019 Maths Term Paper
8/14
The matrix is modulo 26, since there are 26 letters in the alphabet. So, taking each letter to
represent a number, where A is 1, B is 2, etc., the matrix and the vector made up of the _rst two
letters, T and H, will be multiplied together.
The T and the H in the plaintext is encrypted to be D and Z in the cipher text (since Z, the 26th
letter, is congruent to 0 modulo 26). Following in similar fashion, the entire message would beencrypted to read:
DZO WJGW TI JQHGM YDJXP EJGXDX UR VFL JJGTP
Notice that the two times the plaintext \THE" appears, it's a different cipher: DZO the first time
and VFL the second time. If this were put in groups of five, it would be even harder to discern:
DZOWJ GWTIJ QHGMY DJXPE JGXDX URVFL JJGTP
In order to decrypt this message, the corresponding inverse matrix would need to be used:
Multiplying this matrix by the vector based on the first two letters of the cipher text will give
back the original letters:
The question is: Will there always be an inverse to any matrix that is chosen modulo 26? The
answer is no. There are 14 numbers that do not have inverses modulo 26. Any number that is not
relatively prime, that is its greatest common divisor is greater than 1, does not have an inverse
modulo 26. The same goes for matrices. In the above example, 18 was in the inverse of theoriginal matrix (gcd(18,26)=2), but that matrix still has an inverse. It needs to be shown that the
matrices that are being dealt with have inverses. Consider this linear transformation Ta:
where fis any positive integer, and xi; yi; aij ; ai are matrices in
8/7/2019 Maths Term Paper
9/14
will be called the schedule ofTa and will be designated as Pa = [(aij); ai]: The square array off2matrices Ma = (aij) will be called the basis ofTa. Jwill be denoted as the set of all
transformations which can be obtained in this way, for a _xed integerf, from the range
8/7/2019 Maths Term Paper
10/14
WXAFR KORNK OOUHM SHINY KJUDO UNNKX RYUAM AWHLP WVRZK
GRGYA QGRGA KKDSW FALXH WBTIW
XAKCQ VSGON GGSIJ QOEHU QQMIV OHHKY DIMSW BEEBE V
How would one go about decrypting this message, without any prior knowledge of what kind of
method being used? Some tools will be needed in order to solve this cipher message. It is knownthat the 26 letters of the alphabet do not occur with equal frequency. Thus, the probabilities pA;
pB; _ _ _ ; pZare not equal. All have positive values between 0 and 1, and their sum is 1:
The amount by which pA differs from the average probability, 1/26 , is pA 1/26 . This is similar for each letter.
The sum of these deviations cannot be used to determine the measure of roughness of the ciphermessage because the sum is 0, as shown below:
The way to get around this is to square the measure of roughness, or M.R. for short.
8/7/2019 Maths Term Paper
11/14
However, the above equation is only good when the original message is known. There needs to
be a way to approximate PZA p2i. Using the probability that two letters chosen at random will
be the same, a good approximation can be found. What needs to be done is to count the pairs ofidentical letters there are in the cipher message, and then divide by the total number of possible
pairs.
Suppose there are x letters in the set. The number of pairs is determined as follows: for the firstchoice, the selection can be made from x letters. After which, x-1 letters remain. This makes a
total ofx(x-1) possibilities. However, counting this way, each pair has been counted twice, since
each pair can be received two different ways. Thus, the number of pairs of letters that can bechosen from a given set ofx is 12x(x-1):
If the observed frequency of A in the cipher message is fA, then the number of pairs of A's that
can be formed from these fA letters is 12 fA(fA-1). It is the same for B, and so on. Thus, the total
number of pairs, regardless of the identity of the letter, is the sum
If the total number of letters is N, then the total possible number of pairs of letters is 12N(N-1). This leads to the following equation, called the index of coincidence,or I.C. for short. It
is defined as follows:
Using the I.C., we can determine the number of alphabets, m, used in a cipher message:
Taking the I.C. on the above cipher message, it's equal to a value of .040, which puts it at around10 alphabets used for the cipher message. It's possible that this number is not accurate, since the
message is not very long. It is fairly obvious that the message is polyalphabetic.
The next step is to list the repetitions found within the cipher message and their locations. This
will give a better indication as to how many alphabets there could be.
The only common factor between the two repetitions is 3, so there's a good chance that there'sthree alphabets being used, most likely in a matrix form, since the I.C. was so low.
The focus will now be to try to discover the matrix that was used to encipher this message. The
ciphertext WXA is a very interesting one because it occurs at the very beginning of the message.The most frequent digraph in the English language is TH, and the next most popular is HE.7 So,
it is a possibility that WXA might be THE. If so, all that would need to be done is to solve the
following system of equations:
8/7/2019 Maths Term Paper
12/14
Or, in matrix form:
WXAFR KORNK OOUHM SHINY KJUDO UNNKX RYUAM AWHLP WVRZK GRGYA QGRGA
thei v o p j x i x KKDSW FALXH WBTIW XAKCQ VSGON GGSIJ QOEHU QQMIV OHHKY DIMSW BEEBE V
t s c e t hee w j
This text looks a lot more promising. There are still q's and x's in the message, but there are less
of them, and they're more evenly spaced. Let's see what can be done about the second row (a21,a22 and a23). By examining the text, a \u" must follow the q, and also looking at the ther",maybe an e" would follow that. Thus, we get the following system of equations:
Solving this system gives the values a21 = 19, a22 = 11 and a23 = 9. Putting these values into
the message, we can find the second letters out of each group of three:WXAFR KORNK OOUHM SHINY KJUDO UNNKX RYUAM AWHLP WVRZK GRGYA QGRGA
thequ ck r o nf xj mp do e r he nd hKKDSW FALXH WBTIW XAKCQ VSGON GGSIJ QOEHU QQMIV OHHKY DIMSW BEEBE V
e no ny ow sa t here sn th ng o r ve
The message is really starting to take form. By inspection, it looks like the text `n th ng' could be
the word nothing". Also quick" could be quack" or quick", and wi h" could be with" orwish". So, there are a few different sets of equations that could be solved:
It turns out that systems (2) and (3) have the same solutions: a31 = 4, a32 = 6 and a33 = 3. This
gives us the complete decoded message:
8/7/2019 Maths Term Paper
13/14
THE QUICK BROWN FOX JUMPED OVER THE LAZY DOG, WITH A HEY AND A HO,
AND A HEY NONNY NO. WE SAY THERE IS NOTHING MORE THAT CAN BE SAID.
BURMA SHAVE.The message is not particularly deep. However, by using the inverse matrix that was found:
The original matrix that was used to encrypt the message can be found:
This is one way that matrices can be used for encrypting messages. The encryption can be made
more secure by not using a direct substitution for the alphabet (i.e. A=1, B=2, etc.). Also, the sizeof the matrix can be increased to make decoding more di_cult. The other problem is that when
choosing matrices modulo 26, one has to be careful about which matrix to choose, since all of
the matrices do not have inverses modulo 26. It might be better to choose a di_erent basis, suchas modulo 29, which has no divisors except 1 and 29. That way, the 26 letters can be used with
some punctuation characters. All in all, matrices are very useful for encoding messages.
8/7/2019 Maths Term Paper
14/14
BIBLOGRAPHY
1) Sinkov, Abraham. Elementary Cryptanalysis - A Mathematical Approach New York:
Random House, 1968.
2)Hill, Lester S. "Concerning Certain Linear Transformation Apparatus of Cryptograph."American Mathematical Monthly Volume 38, Issue 3 (Mar., 1931): 135-154.
3)http://aix1.uottawa.ca/~jkhoury/cryptography.htm