CSE 100 Lab - PowerPoint PPT Presentation

1 / 19
About This Presentation
Title:

CSE 100 Lab

Description:

This one is a Simple Cipher. We've replaced letters with ... make sure we all have the same environment ... see it in a controllable manner. press q to exit ... – PowerPoint PPT presentation

Number of Views:55
Avg rating:3.0/5.0
Slides: 20
Provided by: ories
Category:
Tags: cse | lab | manner

less

Transcript and Presenter's Notes

Title: CSE 100 Lab


1
CSE 100 Lab
  • Decrypting a simple cipher commands

2
What is a Cipher?
  • This one is a Simple Cipher
  • Weve replaced letters with other letters

3
How are we going to crack it?
  • Very Simple Statistical Analysis

4
Lets do it.
5
Login to eniac
6
Bash
  • make sure we all have the same environment
  • you can use the up arrow to see and edit past
    commands

7
cat /home/c/cse100/lab/x.cipher
  • x is 1,2, or 3. Choose which one you want to
    decrypt
  • Read the file

8
cat /home/c/cse100/lab/x.cipher more
  • see it in a controllable manner
  • press q to exit

9
cat /home/c/cse100/lab/x.cipher tr 'A-Z'
'a-z' more
  • make all lowercase

10
cat /home/c/cse100/lab/x.cipher tr 'A-Z'
'a-z' tr -d '\040-\140''\173-\377' more
  • get rid of characters other than lower case
    letters

11
sed 's/a-z/ /g'
  • add a space after each character a-z

12
tr ' ' '\012'
  • make the spaces in to new lines

13
sort
  • sort the lines

14
uniq c
  • count the number of each line (i.e. number of
    each letter)

15
sort nr
  • sort by most frequent

16
compare with the sample from 1,000,000 words,
and replace most common for most common
17
cat /home/c/cse100/lab/x.cipher tr 'A-Z'
'a-z' gt/temp
  • get lowercase text

18
sed s/a/B/g temp
  • Replace a with Capital B(no capitals in the text)
  • Repeat for each match in the files

19
Caveats
  • Variance in frequency
  • Use two and three letter combinations
  • Short messages 
Write a Comment
User Comments (0)
About PowerShow.com