Posted:

4 Jul 2024

Thu 11 Jul @ 18:00 Mon 15 Jul @ 18:00

Host security, public-key cryptography and code verification.

Complete parts 1 and 2. Graduate students should additionally complete part 3.

Part 1: Host security

Write a program for any Unix-like platform that will:

  • print its permissions

  • print its owner’s UID

  • print its effective UID

  • print its group ID

  • print its effective group ID

  • change its own permissions using fchmod(2) (e.g., remove executable permission for non-owner, non-group users)

  • set either the S_ISUID or S_ISGID bit

Execute this program and demonstrate that the setuid or setgid bit works as intended.

Part 2: Public-key cryptography

  1. Given an RSA cryptosystem with prime values $p = 7$ and $q = 43$, as well as a public-key exponent $b = 95$:

    1. Find the private key component $a$

    2. Show how a sender can encrypt the plaintext block $P = 25$.

    3. Show how the received ciphertext can be decrypted to yield $P$.

    4. Bonus: Show how the Extended Euclidean Algorithm can be used to compute $a$ from $p$, $q$ and $b$. You may use, e.g., the Python egcd module in lieu of computing the EEA by hand.

  2. Read the "JAR file verification" section of the manual page for the Java jarsigner tool (run man jarsigner on just about any Unix machine, or else on a web page).

    1. Use jarsigner to verify the signature of this JAR file. What cryptographic hash function was used to hash the manifest file? What algorithm was used to sign the JAR file? (provide evidence for your claims)

    2. Extract the JAR file. Compare the SHA-1 sum of any file within the extracted JAR file (e.g., using the shasum command) to that contained within the signed manifest file META-INF/MANIFEST.MF. How do they differ?

    3. Using a Base64 encoder (e.g., base64 or openssl base64 at the command line or an online tool, obtain the Base64-encoded SHA-1 hash of any .class file from the JAR file. How that that compare with the value in META-INF/MANIFEST.MF?

Part 3: Protocol dissection

Capture some HTTPS traffic using tcpdump or Wireshark. Explain, with reference to selected information from the packet capture, the process by which the communication begins, starting from the initial DNS lookup. Show all DNS and TLS packets up to the point where encrypted communication begins.