NETS1035

Research: RNG, Using ent

This lab activity is intended to familiarize you with random number generation and symmetric encryption.

Using ent

Entropy Measurement

  1. Install the ent tool, or another or your choice that can generate similar output
  2. Read the tool man page
  3. Use the ent tool to measure the data from several sources
    • the man page for the tool
    • your kernel file in /boot/vmlinuz-whatever
    • your /etc/hosts file
    • the man page for ent encoded using base64
    • the ova file used for the NETS1028 virtual machine
  4. What are your thoughts on whether you could use this tool to make guesses about the content of data from an unknown source?
  5. What kinds of conclusions might you be able to draw about data from it?

Using ent to find shift value for caesar ciphers

Find the shift values for each of the following caesar-cipher encrypted files using ent if you can.

Test your deduced shift values to see if they worked right. Is frequency distribution a reliable way to find caesar cipher shift values?

Random Number Generation

On Windows or on MacOSX, identify a source of random numbers you could use on the command line and verify it works. Try using ent to compare the quality of random numbers produced by different sources in one of those operating systems.

Linux system example

Identify a source for random numbers you could use in the python programming language.

Optional: Compare PRNGs

Speed/Volume

time hpenc -r -b 10M -c 100 |dd bs=10M of=/dev/null

Quality

For each of the tools, run the tool 3 times in a row to obtain a block of random data in a size you might use for key generation, 2K bytes. Each time, use ent to measure the produced data.

  1. For each tool, does it consistently make good random numbers? poor random numbers? random numbers of unpredictable quality?
  2. What happens to the results with 4K blocks? 256 bit blocks?
dd if=/dev/urandom bs=2k count=1|ent
dd if=/dev/urandom bs=2k count=1|ent
dd if=/dev/urandom bs=2k count=1|ent

openssl rand 2048|ent
openssl rand 2048|ent
openssl rand 2048|ent

hpenc -r -b 2K -c 1 |ent
hpenc -r -b 2K -c 1 |ent
hpenc -r -b 2K -c 1 |ent

Grading

There is nothing to submit for this research activity. It is a learning reinforcement tool.