Symmetric Key Cryptography Research common implementation errors in secret-key encryption algorithms that may result in

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899604
Joined: Mon Aug 02, 2021 8:13 am

Symmetric Key Cryptography Research common implementation errors in secret-key encryption algorithms that may result in

Post by answerhappygod »

Symmetric Key Cryptography
Research common implementation errors in secret-key encryption
algorithms that may result in security breaches. Specifically, look
at the following case studies:
 Monoalphabetic Substitution Cipher
 Different Ciphers and Modes
 Initial Vectors
Monoalphabetic Substitution Cipher
In a substitution cipher, the letters of a message are changed
but their positions do not. For example, consider the following
original message:
Meet Joe at the Coffee Shop. He has the instructions for you. If
we substitute the letter e for w, the original message becomes:
Mwwt Jow at thw Coffww Shop. Hw has thw instructions for
you.
If we continue to substitute each letter of the alphabet with
another letter, make all letters lower case, and remove
punctuation, the original message begins to look quite
different.
dwwi cyw zi ihw tyqqww jhyv hw hzj ihw kfjisxtikyfj qys byx
It is well known that monoalphabetic substitution ciphers (also
known as monoalphabetic ciphers) are not secure, because they can
be subjected to frequency analysis.
Specifically, this cipher could be broken through frequency
analysis where certain letters and combinations of letters occur
more frequently than others. A clever analyst can start with
commonly used one-, two-, or three-letter word combinations and
substitute into the encrypted message until a pattern begins to
emerge. In this case, we already know the original message, but
even if we didn’t, we could start guessing common alphabet patterns
and decrypt the message.
Using the common single and double letters for the English
language, we can begin to piece the message together. According to
information from http://www.richkni.co.uk/php/crypta/freq.php, the
most commonly used letters are “e”, ”a”, “o”, ”i”, “n”, “s”, “h”,
and “r”. The most commonly used trigrams (3- letter combinations)
according to https://en.wikipedia.org/wiki/Trigram are: “the”,
“and”, “tha”, “ent”, “ing”, “ion”, “tio”, and “for”.
When doing this manually, looking for patterns in trigrams
first, may lead to some initial success. If we assume we have a
popular 3-letter trigram in our message we could initial substitute
“the” for “ihw”. There are quite a few “ihw’s” found. Substituting
all of them yields this revised and partially decoded message:
deet cye zt the tyqqee jhyv he hzj the kfjtsxttkyfj qys byx
Looking at common bigrams from
https://en.wikipedia.org/wiki/Bigram, we see additional patterns to
consider such as “at”, “he” , “an”, “on”, and “in”. The word “he”
is probably already decoded properly, but “zt” could be “at” which
means “z” should be replaced “a”. If replace all “z’s” with “a’s”
the following message is revealed.
deet cye at the tyqqee jhyv he haj the kfjtsxttkyfj qys byx
At any point, you can begin guessing letters to complete words
and substituting. For example, “he haj” probably should be “he
has”. Replacing j’s with an s yields this message.
deet cye at the tyqqee shyv he has the kfstsxttkyfs qys byx
The next steps can take some trial and error by replacing other
trigrams with common 3-letter words. If we replace “qys” with “for”
the message seems to be taking a more readable form. It is still
not quite there but better.
deet coe at the toffee shov he has the kfstrxttkofs for box
Here is where a longer message may actually help you decode. I
have one long word that have many unknown letters. Continuing on,
we would look at each word or phrase and begin to make assumptions
and try combinations to see if patterns emerge.
The first word seems close to “beet”, “feet” or “meet”.
Including the next word leads me to believe “meet” would work and
“coe” should become “Joe”. Substituting “m” for “d” and “j” for “c”
we get the following:
meet joe at the toffee shov he has the kfstrxttkofs for box
More trial and error is needed. Toffee is certainly a good word
but if we replaced “toffee” with “coffee” the next word begins to
resolve to shop.
meet joe at the coffee shop he has the kfstrxctkofs for box
That last phrase still is elusive. However, if we go back and
consider popular bigrams such as “in” and replace that for one of
the remaining bigrams (“kf”) the most complex word in our message
is turning into something we recognize.
meet joe at the coffee shop he has the instrxctions for box The
“x” clearly needs to be a “u”.
meet joe at the coffee shop he has the instructions for bou.
The last word looks like it should actually be “you”.
Substituting “b” for “y” and adding punctuation yields our original
phrase.
Meet Joe at the coffee shop. He has the instructions for
you.
As you can see, this can be tedious and requires the use of the
common letters, bigrams, trigrams and pattern completion
techniques. Also, you have to keep track of the letters you have
solved for as you move through the decoding process so you don’t
accidentally change a letter you already changed. One approach to
accomplish this is to use capital letters for plaintext, so for
each letter, we know which is plaintext and which is cipher text.
You can use the tr command to do this. For example, in the
following, we replace letters a, e, and t in in.txt with letters X,
G, E, respectively; the results are saved in out.txt.
tr 'aet' 'XGE' < in.txt > out.txt
Lab secret
Monoalphabetic Substitution
Cipher
The decrypted lab secret was:
The encryption key (e.g.
‘pedyehjagiknvtzloepwotcskd’) discovered was:
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply