4 Jul 2024
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
orS_ISGID
bit
Execute this program and demonstrate that the setuid
or setgid
bit works as intended.
Part 2: Public-key cryptography
-
Given an RSA cryptosystem with prime values $p = 7$ and $q = 43$, as well as a public-key exponent $b = 95$:
-
Find the private key component $a$
-
Show how a sender can encrypt the plaintext block $P = 25$.
-
Show how the received ciphertext can be decrypted to yield $P$.
-
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.
-
-
Read the "JAR file verification" section of the manual page for the Java
jarsigner
tool (runman jarsigner
on just about any Unix machine, or else on a web page).-
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) -
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 fileMETA-INF/MANIFEST.MF
. How do they differ? -
Using a Base64 encoder (e.g.,
base64
oropenssl 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 inMETA-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.