Assignment 1

CYBR 171 2023 T1: Assignment 1

days Due 09 Apr 23:59

Goals

The goals for this assignment are to be able to
  • work with classical symmetric cryptography.
  • work with modern symmetric and public-key cryptography.
  • use cryptography to check the authenticity, confidentiality and integrity of data.
  • demonstrate an understanding of xor cryptography and one time pads.
  • demonstrate an understanding of the weaknesses of substitution ciphers.
  • reason about the risks of exhaustive key searching, dictionary attacks and the impact of quantum computing.
  • read and comprehend industry news sources regarding current malware threats.

Preparation

Read through the whole assignment and review the videos of the model answers to labs 1 and 2, and make sure you understand all the components of the answers.

Use barretts to do this work, while logged into that machine follow these steps to obtain the necessary files.

To Submit

  • Make sure you always show your working unless explicitly specified, you can only receive a small amount of marks for not showing us how you arrived at your answer.
  • Use the provided template for written answers and submit as PDF.
  • ciphers.des.enc for core part.
  • ciphers.aes.enc for core part.
  • payroll.bf.enc for challenge part.

Remember to submit your files. When you have submitted them, check that you can read the files listed on the submission page, and complete the submission process.

Structure of the Assignment

This assignment has Core, Completion, and Challenge parts.

Tutors will provide help for the core and completion, but you should talk to Harith for broad hints regarding the challenges.

Core

Caesar Cipher

Below, is a ciphertext encrypted using a Caesar cipher by shifting each letter to the right by an agreed amount (the key).

It is also in the assignment zip file as caesar-cipher.txt.

fnulxvn cx cqn oajlcdanm odcdan, cqn orabc lnwcdah oxuuxfrwp cqn brwpdujarch. njacq qjb j yxydujcrxw xo axdpquh j kruurxw qxvrwrmb. oxa cqn vxbc yjac, cqnh jan qjyyh frcq cqnra uxc, urerwp rw j yanbnaen jc cqn kxccxv xo j pajerch fnuu. cqxbn fqx jan dwqjyyh qjen nvrpajcnm, sxrwrwp xwn xa jwxcqna xo cqn bfjavrwp mnwbncqrwtna lujmnb cqjc oxp cqn rwwna bxuja bhbcnv frcq j mdbc xo vxunlduja vjlqrwnah bx cqrlt cqjc rc xkbldanb cqn bdw. nglnyc oxa cqn bxurcjah urpqcqxdbn knjv cqjc ynayncdjuuh cajltb cqn njacq rw rcb xakrc, cqn bhbcnv oaxv xdcbrmn anbnvkunb j byqnarlju oxpkjwt ajmrjcrwp rw cqn rwoajanm bynlcadv; j vjcahxbqtj kajrw, wnbcnm mhbxw byqnanb kdruc oaxv cqn mrbvjwcunm kxwnb xo vxxwb jwm yujwncb. cqn byurwcnah vncjlxwblrxdbwnbb xo cqn bxuja bhbcnv qjb ujapnuh bfxaw xoo rcb yan-yxbcqdvjw lxdbrwb mracbrmn, kdc rcb vrwmb bxvncrvnb fjwmna wxbcjuprjfrbn. fqnw cqjc qjyynwb, rc ljbdjuuh byjvb njacq rb ao bynlcadv frcq yujwb oxa ljcjluhbvrljuuh mrbadycren cnlqwxuxprnb cqjc nvdubroh fqxun rwmdbcarnb, lducdanb, jwm byrarcdju bhbcnvb. j bjwn bynlrnb fxdum rpwxan cqnbn pnc-nexuenm-zdrlt blqnvnb, kdc cqnan rb jufjhb *bxvnxwn* fqx fruu cjtn j krcn oaxv cqn oxakrmmnw oadrc. cqnan rb jufjhb bxvnxwn fqx dwjllxdwcjkuh ljaarnb cqn unc rb-urlt-cqn-oaxinw-onwln-yxbc pnwn. cqnan rb jufjhb j odltrwp pnnt fqx fruu mx rc knljdbn rc rb j qrbcxarlju pxmmjvwnm cnlqwrlju odltrwp rvynajcren. fqncqna cqn nwurpqcnwnm, xllducrwp bvjacluxdm bnwmb xdc rcb vrbbrenb jb yajwtb, yxrbxw, xa ljan yjltjpnb rb dy oxa mnkjcn. jbtrwp rc cx ngyujrw rcb vxcrenb rb jkxdc jb yaxmdlcren jb wnpxcrjcrwp frcq jw jwc lxuxwh cx pnc rc cx jkjwmxw hxda trclqnw. fqjcnena cqn vxcren, qdvjwrch fxdum kn vdlq knccna xoo ro cqn luxdm fxdum nexuen rwcx bxvncqrwp dwrwcnanbcnm rw lxvvdwrljcrwp frcq vnjcynxyun—xa jc unjbc bvjac nwxdpq cx unc fnuu juxwn. kdc dwcru cqjc qjyyh mjh, cqnan rb cqn cnlq sdah bnaerln: mnonwmrwp cqn njacq oaxv cqn bldv xo cqn yxbc-brwpdujarch yjcnwc xoorln.

Answer the following questions.

right 1. What is the most common letter in the ciphertext?

right 2. Explain how you can use your knowledge of the most common letter to work out the value of the key. (Hint: this is a useful resource http://letterfrequency.org/).

right 3. What is the decrypted text?

Vignère cipher

The Viginere cipher below is also in the assignment zip file as vigienere.txt.

UKFNLEOLOFWFFQFJJIULFTZFSHBULNFRGEUBTWJDFIBQHFLOUKFVQJUHETWBUHTUKFSHBHDOFUBXDTXLOELOHGPXQUIHDPOEXDSXDTIHBULOHXQBQEUKFJENQFXBVUIHOFZFTWPGQFXQFTVFTWIFFPNSBSDUJYFMBGFZXJUFTVUJWDILOHWPHHUIHSUKFMDSHHSVQJWHSTLUZUFTHBSFIDHOUHSTDSPXOEWIFZPSOEQXMTHEXLUIDOFZIFDSUEFBWUIHJOWFSQFUSSPWPDRMJSBOGXILMFWIFZPSOEXLEFZFCZBTVUJOMBGFDDEFRSTRBXDZUKFJQUFUOFWXBVBSHBMSMBFFGRSBJSPZJOJOVPCFUPGFPNSVUHSTDWWBFYSMPUFSVBOGBEYFOWVSHSTUFBGZURTFWTBLMPQUIHWJUUVDMTHBURFYSMPUFBQEFAQMRJUWIJVOFZGSROULFSLOOLOFWFFQFJJIUBTJAIBYJOJSFFFOWMZOPTWIJVSFVFBUDIJSBQUBVUSROPPFSFMJIGPUETWPMOXBVNBGFBFPNSVUHSTBTUHNBGNJQXJWIUKFXDWFRGBKBOGCZWIFPBODHFPFOWPGOBXUFOFFCHSLHMFBMBEPSDUPUZTSIZVJDVEFSBSWNFQUDRNNDOEHEURHPIPSWIBQEBGNJQJTWFSVUPOMERWFLOURXIDUBSQFDSFGUPEFBVJNSMFWBTNGPUIJVGJUTUGBZROUKFKRCJQWFVUJJBULOHDTFYFOWZGLWFFFOWFSUPSLOUKFDRNQXUFUBDFPVQUULNFFIBUHFVMJWUMHEJGIFNOPZUIDUUKJTVJYEJURWFUDIDSHHXPXMEWBLHPWHSILTMLGFIPSWIFQFYWTJANPQUIVBOGIBYFUKJTVFMIQSRDMDJNHECHSLHMFBIJSQJHSVECJQHTKPVOEFUTXLUIWIFICJWIFFJBWIFQTBDOEWIFJFSPBOSPMLDFDMMLOQXSTXJURGUKFTRVSFFBQFTWPGEMBFLIDUIDDLHSTDOEDUBQHMHEXHCPIJOWFSQBULPODMFVQJROBJF

We assume that the key is three characters long and have provided the cryptogram.

right 4. Create three splits following the instructions below and use the following online tool to make a frequency histogram for each split of the ciphertext.

Creating splits: You can do this by hand but it is easier and less error-prone to use Python (or your favourite language).

Use the python operator [ start :: step ] to a set of letters starting at start and the next at start+step, start+2*step, and so forth. Here is an example showing you how I can split "abcabcabc" into three strings.

I enter the python command and get the header information telling me what version of Python that I have started. After that, I enter my string "ABCabc123" and use the split operation to generate three strings to show that I can extract string starting at the 1st (0th position), 2nd (1st position) and 3rd (2nd position). We count from zero.

You can use this code, just replace ABCabc123 with the cryptogram.

% python
Python 3.10.9 (main, Dec 30 2022, 16:32:58) [GCC 12.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> "ABCabc123"[0::3]
'Aa1'
>>> "ABCabc123"[1::3]
'Bb2'
>>> "ABCabc123"[2::3]
'Cc3'
>>> 

Link to histogram tool: https://csfieldguide.org.nz/en/interactives/frequency-analysis/

right 5. What is the top two guesses for the shift value for each of the frequency histograms cryptogram?

Justify your answer using no more than a couple of sentences for each split.

right 6. Experiment with possible keys until you find the right one that can successfully reveal the plaintext. Include examples of your working and the final plaintext. State the Vignère key in terms of a three-letter key that can be used to decrypt the cryptogram correctly.

Note you can use the table below to map from a numeric shift value to a letter:

ABCDEFGHIJKLM
0123456789101112
NOPQRSTUVWXYZ
13141516171819202122232425

Link to tool: https://cryptii.com/pipes/vigenere-cipher

To answer these questions, you may want to use Wolfram Alpha to work with large numbers. You can approximate to powers of 10.

Make sure you show your working.

right 7. Microsoft Office 2007 onwards allows the use of the AES cryptographic algorithm with a 128-bit shared secret to protect access to documents. Assume you can perform encryption and decryption at a rate of 10,000,000,000 operations per second. What is the maximum amount of time in seconds that it would take for a brute-force attack on a single document?

right 8. Microsoft Office 2030 onwards allows the use of the RSA cryptographic algorithm with a 1024-bit public and private key pair to protect access to documents. Assume that you can perform encryption and decryption at a rate of 10,000,000,000 operations per second. What is the maximum amount of time in years that it would take for a brute-force attack on a single document?

XOR cryptography

Make sure you show your working.

right 9. Encrypt the string "ASSIGNMENT" with the key"BAABBAABBA" using the XOR operator. Express your answer as a binary number rather than converting to Unicode. You can use these online tools: https://www.browserling.com/tools/binary-xor and https://toolnanny.com/.

Hashes

right 10. Using the command line only, download the disk image slax-ipxe.iso from the slax website and get the hash found on that page to verify its integrity. Show how you have done this and include any relevant output from commands you have used (do not forget to include the commands too).

right 11. Explain why proving the integrity of the downloaded file does not guarantee its authenticity. (Note: your answer should be no more than three sentences).

Note: you can use the md5sum command to calculate the MD5 hash function for a file.

barretts% md5sum test.txt
e6cc594278562923ce9dabd9c8b9c1b6  test.txt
barretts% 

Symmetric cryptography using command line tools

right 12. Encrypt the file ciphers.txt using DES in CBC mode using your ECS username as the encryption password. Make sure that you use the option -pbkdf2. Include the command you used to do this in your answers as well and submit the encrypted file as ciphers.des.enc.

right 13. Encrypt the file ciphers.txt using the AES 256 algorithm in ECB mode using your ECS username as the encryption password. Make sure that you use the option -pbkdf2. Include the command you used to do this in your answers as well and submit the encrypted file as ciphers.aes.enc.

right 14. What is the message contained within the file treasure.bf.enc. It has been encrypted using the blowfish algorithm in CBC mode under the password lucre. Include the commands used to do the decryption.

*Note:the new version of OpenSSL, by default, does not support old/insecure algorithms. Hence, you will need to add the following flags/arguments while encrypting/decrypting using some ciphers, e.g., Blowfish. You may get the following error message (or a similar one):

Error setting cipher BF-CBC
40C799C4DA7F0000:error:0308010C:digital envelope routines:inner_evp_generic_fetch:unsupported:crypto/evp/evp_fetch.c:373:Global default library context, Algorithm (BF-CBC : 14), Properties ()

Use the following arguments along with your command to resolve the issue.

-provider legacy -provider default

Public key cryptography using command line tools

Questions 15 and 16 make use of GPG Key shown below.

Here is the GPG key (cybr171.pub.key in the assignment zip file):

-----BEGIN PGP PUBLIC KEY BLOCK-----

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
xu30hqafTLYmFtkXsrAVv2CozpsF8JCkmhgMvSc=
=pv1o
-----END PGP PUBLIC KEY BLOCK-----

The fingerprint is 1A36 CCAA 172B 659F 8885  FE6D C54C 701B 32A6 E1C9.

right 15. We have provided two documents - document1.asc and document2.asc. One of the above documents were modified after it was signed. Use the verify command on both and tell us which one! Show the output from GPG that proves your assertion.

right 16. Given your knowledge of signing, explain what information must be stored in the PGP signatures of the messages from question 15?

right 17. Download key 1C6DC77C from the key server and verify the signed message message.asc.

  • Whose key is this?
  • Can you trust this key because it came from an official key server?
  • Can you trust the message really comes from who it claims to come from?
  • Why or why not? (Hint: you may need to read about the web of trust and how key servers work to answer this question).

Hint: gpg2 has a command for downloading a key from a keyserver. Any key server will do, because they synchronise, but the NZ open pgp keyserver (DNS name: pgp.net.nz) definitely has the key you are looking for

Completion

XOR encryption

right 18. Demonstrate how you would implement a one time pad to encrypt a message "APPLE". Use XOR not a shift cipher. Show your working.

Substitution ciphers

It might have occurred to you that combining classical cryptographic algorithms might lead to greater security.

right 19. Demonstrate using a worked example that applying a Caesar Cipher twice using different keys does not result in a ciphertext that is harder to break than applying a Caesar Cipher once. Include the keys used, the plaintext, ciphertexts and frequency histograms as part of your answer.

right 20. During World War II, members of the Māori Battalion wrote their battlefield orders in Te Reo Māori to make it harder to decrypt their messages. Decrypt the following whakataukī (proverb) encrypted using a Caesar cipher. Remember to document your working. The ciphertext is also available as maori-battalion.txt in the assignment zip file.

PKEWHNG PKNNG PKEWHNG UWHK PKEWHNG RUNU PKEWHNG PKAM 

You have the following information:
  • The Māori alphabet is: a, e, h, i, k, m, n, ng, o, p, r, t, u, w and wh. For the purposes of the exercise, you can ignore macrons.
  • You have a "crib", this is a plaintext and ciphertext pair. The crib is the plaintext word "TE" and its corresponding ciphertext "AM").
  • You may want to refer to the Maori dictionary.

Quantum computers

With advances in quantum computing, it may be possible at some point in the future to build a computer that can implement Grover's algorithm that gives a reduction in time from n to the square root of n. For example, AES-128 has a 128-bit key requiring 2128 tries. Grover reduces this to 264 tries.

right 21. Assume you have a quantum computer, what difference does this make to an exhaustive key search for 1024-bit public and private keys? Again assume that you can perform encryption and decryption at a rate of 10,000,000,000 operations per second. Show your working.

Searching smarter

right 22. A dictionary attack doesn't blindly search through all possible keys and instead takes advantage of the fact that people may use previous passwords or easy-to-remember words instead of random keys.

Calculate the worst-case time in seconds for brute forcing an AES encrypted message using a dictionary attack.

You will find it easier to do this calculation using decimal numbers rather than powers of 2 and state the final answer to at least two decimal points.

You can assume the following:

  • Only lowercase letters are used.
  • Each key is composed of two eight-letter dictionary words.
  • Each key is 128 bits long.
  • Repetitions of the same dictionary word are possible, for example, "AARDVARKAARDVARK".

Each word came from a dictionary of 40,161 eight-letter words.

The cracker operates at 1,000,000 tries per second.

Public key cryptography

Use the following keys to answer the questions.

The keys are also available in the files alice.txt, bob.txt and carol.txt in the assignment zip file.

Alice's keys

-----BEGIN RSA PUBLIC KEY-----
MEgCQQCSJUNrtCnB5/27RnXoOcPRu5iRQrBSdjRLi2buyWlm48nwNwgVic5W25Hh
HqqAkTFPLBXRaiebagT+d0mLq1FBAgMBAAE=
-----END RSA PUBLIC KEY-----

-----BEGIN RSA PRIVATE KEY-----
MIIBOQIBAAJBAJIlQ2u0KcHn/btGdeg5w9G7mJFCsFJ2NEuLZu7JaWbjyfA3CBWJ
zlbbkeEeqoCRMU8sFdFqJ5tqBP53SYurUUECAwEAAQJAPlUGXHmLFdkMr0NuJo38
pweMGuiGq6UeyNm8HTxqaCc6NUrLZHiESW4E5d9lZ3uHKN+WYHPH0+5D5hKSOcG4
wQIhAM4frPmc39Np98YnUpStbJ5HzxUgLoAnmkvh3RoJi6b3AiEAtYI+JOXx2X9C
U9KrTeKq0Iixj7ZEz2LnY+8d2KVBo4cCIELWbJ2IK9/+9ZQwfgut7JGqkVC1Xb66
mMLQW4Ss4bbjAiBejBuG6OiUHQAV3dUx2vKTccDcVVt+k8xod/QaF+sbHQIgDE7T
CxQ8LzaLG1Zfp9d14BkVT+vNBGqQDZRKmSwsIJ4=
-----END RSA PRIVATE KEY-----

Bob's keys

-----BEGIN RSA PUBLIC KEY-----
MEgCQQCR3/sdyR0OXlRh6EQOt6s5ItRx+jA7fpYZikeQvtxiqxvMNOscEDQ9DUcA
3v/C8q2zuAHrsoJ/NAG8ca5teZirAgMBAAE=
-----END RSA PUBLIC KEY-----

-----BEGIN RSA PRIVATE KEY-----
MIIBPQIBAAJBAJHf+x3JHQ5eVGHoRA63qzki1HH6MDt+lhmKR5C+3GKrG8w06xwQ
ND0NRwDe/8LyrbO4Aeuygn80Abxxrm15mKsCAwEAAQJBAIG0RfQV/l/oP99ORjVP
2k7TSVKOwpQj2hKbgUaSbiLL6U5YNnrpcCd7xGszgs1SslgcuLMKhg2JXwO51zXo
sgECIQDPM+X/hKj5a+dQBbE0zLCNayCcLOcwai1AexVGb+1fqQIhALQ6rIbZwiND
85WG8/O6IqMeNcJ10WVgc4KjhMaIcXozAiEAmjOQdpG+wyjnk6k40QeIWSahtTjB
sUlDdhpjofEIYkkCIQCzdvWTNkVN7n0geQh0uvWArjVkFQPUye1buc4eD4HH5wIh
AM7nc9sT1sKfLAyEjazSUDjbSrbsH5i5aKTv6c8ZoOBZ
-----END RSA PRIVATE KEY-----

Carol's keys

-----BEGIN RSA PUBLIC KEY-----
MEgCQQCYY0TvDKOU/Cx3k+v1Icb6mU1HhJxxlu6KjkVic8MJAEZX39KXCIGa82yU
NQsFPZYzWzfKoH0u1799OtuhrHVVAgMBAAE=
-----END RSA PUBLIC KEY-----

-----BEGIN RSA PRIVATE KEY-----
MIIBOwIBAAJBAJhjRO8Mo5T8LHeT6/UhxvqZTUeEnHGW7oqORWJzwwkARlff0pcI
gZrzbJQ1CwU9ljNbN8qgfS7Xv30626GsdVUCAwEAAQJAOX97SxdhwZ1EyfmuVlfg
VD3zwsBupw1kBDOaSoOTW5mB4Mnze7WcIOtJEfVz5wqxgFNZP1Z6Y1Pi0I2xfBYE
AQIhAMguerYM4NUTKmjc/245fn5ANtrZffd1cgstirvM7+7hAiEAwuEipQ2Uqw4L
VWfh0dZx5g9qqXDZCsyL/KalFolf2PUCIQCNI3AzcSsIMCYjn0Wc8n6EB0Rl0xik
Y7MPvIFnXdwBIQIhAJqEHY8W/IjAQvY9vsw9JuQN1zlv83dfhaMWkpES7T89AiBy
VKwpCUYahP7FC/bnPd/FYaSEEBiAGli8TRD8JqUQ7g==
-----END RSA PRIVATE KEY-----

right 23. Encrypt the following reply from Carol to Alice using the appropriate key that ensures the message can only be read by Alice. Make sure you explain your reasoning.

Use this tool to do the RSA encryption: https://csfieldguide.org.nz/en/interactives/rsa-encryption/

DO NOT TRUST BOB. HE LIES. FRIENDS DONT LIE.

right 24. Decrypt the following message sent by Bob to Alice using the appropriate key that ensures the message could only come from Bob and not anyone else. Make sure you explain your reasoning. Note that the ciphertext is available as message-bob-to-alice.txt in the assignment zip file.

Use this tool to do the RSA decryption: https://csfieldguide.org.nz/en/interactives/rsa-decryption/

V5SuxykPvRYU7zNEAotFPMmgF+ZS+veb3V/dTDgWjTa6ezuCHl42nhbFDHx81Ul8Jx3P5JhPh/p8QAUP+tMuhw==

right 25. Alice wants to send the message below in plaintext but attach a digital signature proving that she wrote this.

Illustrate how she would do this using examples showing step-by-step the process of constructing and verifying the plaintext plus digital signature.

ALICE WROTE THIS

Use these tools:

Malware threats

right 26. Threatpost is a good source of news about cybersecurity and reports on recent malware discoveries. Visit their malware page and answer the following questions.
  • Pick ONE story appearing in Threatpost's feed of malware stories.
  • Discuss the malware appearing in the story and how it might cause a loss to an organisation.
  • Describe TWO controls from CERT NZ top 10 critical controls that would have prevented the loss caused by the malware. Make sure you explain how it would have prevented the loss.

Note:

  • You should not discuss an example of malware from lectures.
  • You should provide links at the end of your answer to the news story that you chose.
  • You can refer to additional sources of information, also provide links at the end of your answer.
  • Your answer to this question should be around 250 words (+/- 10%) not including the links.

Challenge

Challenge-response authentication

right 27. Alice is suspicious and decides to challenge Carol to prove that it is really her instead of a hacker pretending to be her.

Illustrate, using examples, a challenge-response protocol that Alice could use to authenticate Carol. Use the keys defined earlier and the online tools from the Computer Science Field Guide (CSFG).

Notes:

  • Assume that the attacker can read, modify and replay messages exchanged between Alice and Carol.
  • You can only use RSA encryption and decryption operations as well as knowledge (or lack) of the relevant keys by Alice, Carol and the attacker.

Stegnography

Steganography is the art of hiding a secret in plain sight. We have provided the files cat-a.jpg, cat-b.jpg and cat-c.jpg. Your challenge is to discover the three CTF flags hidden in the files. You will be able to spot the flags because they all use the format FLAG{XXXX} where XXXX is the content of the flag. You may need to install some software, but two necessary programs are already available on barretts.

right 28. Document the steps taken and the details of the three flags.

Hint: This is a useful set of resources.

Cut and Paste attack

Your name is Bob and you are a programmer working for Acme Enterprises who wants to increase your salary without actually needing to get promoted.

Luckily, you have managed to gain access to the encrypted payroll file (payroll.bf.enc) that records annual salaries for each of the employees. It has been protected by being encrypted using the Blowfish algorithm in ECB mode.

You know that the other employees are Alice, Carol, David and Eve. Each line of the payroll is 16 bytes in length with the first 8 bytes being the name and the remainder the salary. You know the file is sorted alphabetically and that both Alice and Eve earn more than you.

right 29. Describe how you can manage to successfully increase your salary to the same as Alice and Eve's. Include the commands used and upload the modified payroll file to the submission system so we can check your answer is correct.