cryptanalysis lecture

36
Jonathan Rajewski 1 Cryptanalysis © 2012 Jonathan T Rajewski

Upload: jtrajewski

Post on 18-Nov-2014

1.653 views

Category:

Education


0 download

DESCRIPTION

Here is a brief presentation Jonathan Rajewski gave on March 15, 2012 in my FOR270 Anti-Forensics and Network Forensics course. The lecture was a mini lecture on Cryptanalysis and explored the encryption and decryption of the ROT13, Columnar Transposition Cipher and Vigenère Square.

TRANSCRIPT

Page 1: Cryptanalysis Lecture

© 2012 Jonathan T Rajewski 1

Jonathan Rajewski

Cryptanalysis

Page 2: Cryptanalysis Lecture

© 2012 Jonathan T Rajewski 2

Overview

• Thirty Five Slides of Lecture• Review Cryptology• Attacking Applications• Attacking the cyphers we discussed • FOR270 Crypto Challenge– Until we have a winner!

Page 3: Cryptanalysis Lecture

© 2012 Jonathan T Rajewski 3

The 3 Siezs

Page 4: Cryptanalysis Lecture

© 2012 Jonathan T Rajewski 4

The Three C’s

• Cryptography• Cryptanalysis• Cryptology

Crypto

3 C’s

Page 5: Cryptanalysis Lecture

© 2012 Jonathan T Rajewski 5

Basic Cryptanalysis

Page 6: Cryptanalysis Lecture

© 2012 Jonathan T Rajewski 6

Quick Case Study

Page 7: Cryptanalysis Lecture

© 2012 Jonathan T Rajewski 7

Case Study

When you enter your username and password what happens?

Page 8: Cryptanalysis Lecture

© 2012 Jonathan T Rajewski 8

Case Study

Authentication

Username + Password = Success

Page 9: Cryptanalysis Lecture

© 2012 Jonathan T Rajewski 9

Page 10: Cryptanalysis Lecture

© 2012 Jonathan T Rajewski 10

Page 11: Cryptanalysis Lecture

© 2012 Jonathan T Rajewski 11

Attacking Applications

Learn how the application creates passwords!

Page 12: Cryptanalysis Lecture

© 2012 Jonathan T Rajewski 12

FTP

Filezilla Graphical User Interface

*Hypothetical Situation

Page 13: Cryptanalysis Lecture

© 2012 Jonathan T Rajewski

FTPIn our FTP client, user credentials are stored in an INI file.

Boris is the target of the investigation. We currently have no idea how the application stores user credentials.

We create a new profile named dummy with a password 1111. The PWD value appears similar to one byte per character in the password and, further, appears to look like the ASCII representation. What we find:

Password: 1 1 1 1ASCII: 0x31 0x31 0x31 0x31PWD value: 0x31 0x32 0x33 0x34

There is an obvious pattern!!!!

Let's derive the other password....

PWD value: 0x42 0x70 0x74 0x6C 0x77 0x4EASCII: 0x42 0x6F 0x72 0x69 0x73 0x49Password: B o r i s I

13

Page 14: Cryptanalysis Lecture

© 2012 Jonathan T Rajewski 14

Let’s try it!

Password.ini file contains the following data. Decrypt the password

PWD value: 0x70 0x62 0x75 0x76 0x7B 0x75 0x79 0x45 ASCII: 0x 0x 0x 0x 0x 0x 0x 0x

Password:

Page 15: Cryptanalysis Lecture

© 2012 Jonathan T Rajewski 15

Let’s try it!

Password.ini file contains the following data. Decrypt the password

PWD value: 0x70 0x62 0x75 0x76 0x7B 0x75 0x79 0x45 ASCII: 0x70 0x61 0x73 0x73 0x77 0x70 0x73 0x4C

Password: P A S S W O R D

Page 16: Cryptanalysis Lecture

© 2012 Jonathan T Rajewski 16

Basic Cryptosystems

• Basic Ciphers– Substitution• Replacing one character with another “X”

– Transposition • Rearranging the message

Page 17: Cryptanalysis Lecture

© 2012 Jonathan T Rajewski 17

Substitution Ciphers• Most famous: Caesar's Cipher– Shift each letter to the right by 3

• ROT 13

• Substitute letters for others– A is T– B is R– C is B

1 2 3 4 5 6 7 8 9 10 11 12 13 1 2 3 4 5 6 7 8 9 10 11 12 13Plaintext a b c d e f g h i j k l m n o p q r s t u v w x y zCipher n o p q r s t u v w x y z a b c d e f g h i j k l m

Page 18: Cryptanalysis Lecture

© 2012 Jonathan T Rajewski 18

Where are we seeing ROT13?

NTUSER.dat\Software\Microsoft\Windows\CurrentVersion\Explorer\UserAssist

Page 19: Cryptanalysis Lecture

© 2012 Jonathan T Rajewski 19

Where are we seeing ROT13?

http://www.csoonline.com/article/570813/data-exfiltration-how-data-gets-out

Page 20: Cryptanalysis Lecture

© 2012 Jonathan T Rajewski 20

Tools to parse ROT13

• Volatility Plugin (Levy)– http://gleeda.blogspot.com/2011/04/volatility-14-

userassist-plugin.html• RegRipper (Carvy)– http://regripper.wordpress.com/

• ROT13.com

Page 21: Cryptanalysis Lecture

© 2012 Jonathan T Rajewski 21

How to parse ROT13 by hand

CipherText

NCCYR

1 2 3 4 5 6 7 8 9 10 11 12 13 1 2 3 4 5 6 7 8 9 10 11 12 13Plaintext a b c d e f g h i j k l m n o p q r s t u v w x y zCipher n o p q r s t u v w x y z a b c d e f g h i j k l m

PlainText

APPLE

Page 22: Cryptanalysis Lecture

© 2012 Jonathan T Rajewski 22

Breaking Basic Ciphers• Simple (monoalphabetic) substitution ciphers

easily broken with Frequency AnalysisLetters: E T O A N I R S H D L C W U M F Y G P B V K X Q J Z

Digraphs: TH HE IN ER ED AN ND AR RE EN ED TO NT EA OU NG ST AS

Trigraphs: THE AND ING HER NTH ENT THA INT ERE DTH EAR HAT OFT

• More complex (polyalphabetic) substitution ciphers use multiple alphabets!

Page 23: Cryptanalysis Lecture

© 2012 Jonathan T Rajewski 23

Columnar Transposition Cipher

• Disguising the message by rearranging the letters

– Plaintext: • FOR270 IS SO MUCH FUN DONTCA THINK

FOR270ISSOMUCHFUNDONTCHATHINKQWERTYU

• cipher: fct ohh rfi 2un 7nk 0dq iow snr str oct mhy uau• cipher enhanced: fctohhrfi2un7nk0dqiowsnrstroctmhyuau

Page 24: Cryptanalysis Lecture

© 2012 Jonathan T Rajewski 24

Breaking the Columnar Transposition Cipher

For all intensive purposes for this “cryptanalysis by hand in a quick timeframe” we are going to attempt to guess the rows

and columns

cipher: dygi ioet dutxcipher enhanced: dygiioetdutx

didyougetit

Page 25: Cryptanalysis Lecture

© 2012 Jonathan T Rajewski 25

Vigenère Square

Ciphertext is intersection of key column and plaintext row.

Plaintext: DFIRISGREAT (Side) Key: NTFSNTFSNTF (Top) Ct: QYNJVLLYRTY (Intersect)

Page 26: Cryptanalysis Lecture

© 2012 Jonathan T Rajewski 26

Vigenère Square Decryption

Ct: STYXMYYEGYRR (Intersect) Key: FATFATFATFAT (Side)Plaintext: NTFSMFTENTRY (Top)

Page 27: Cryptanalysis Lecture

© 2012 Jonathan T Rajewski 27

Page 28: Cryptanalysis Lecture

© 2012 Jonathan T Rajewski 28

Crypto Challenge

• Scenario– You work for the “SUPER SECRET 5 LETTER

AGENCY”– An ultra sophisticated ciphertext was located on

an internal server– Our team of cryptographers are actively working

on breaking the code but we need your help!!!

Page 29: Cryptanalysis Lecture

© 2012 Jonathan T Rajewski 29

Phase 1

The following ciphertext was found by the cryptographers. They believe it could have

something to do with the userassist key.

ovg_qbg_yl_fynfu_m7mKvx

1 2 3 4 5 6 7 8 9 10 11 12 13 1 2 3 4 5 6 7 8 9 10 11 12 13Plaintext a b c d e f g h i j k l m n o p q r s t u v w x y zCipher n o p q r s t u v w x y z a b c d e f g h i j k l m

Page 30: Cryptanalysis Lecture

© 2012 Jonathan T Rajewski 30

Phase 1 Review

Did you get it?– ROT13 encryption.

CT: ovg_qbg_yl_fynfu_m7mKvx PT: bit_dot_ly_slash_z7zXikPT Decoded: bit.ly/z7zXik

Page 31: Cryptanalysis Lecture

© 2012 Jonathan T Rajewski 31

Phase 2

We just learned from the cryptographers that more this code may indicated a hidden key for

the next aspect of the cryptanalysis….

Visit this link and try to decode the datahttp://bit.ly/x2qppi

Page 32: Cryptanalysis Lecture

© 2012 Jonathan T Rajewski 32

Phase 2 Review

F O R E N S I C

A T O R

Forensicator

Page 33: Cryptanalysis Lecture

© 2012 Jonathan T Rajewski 33

Phase 3

We identified the final encrypted string of ciphertext by analyzing ram using Volatility.

Yay for open source tools! Agency cryptologists believe that you will “crack

the case” and reveal the cyber villain.

Please analyze:CT: ICLKGZMRUZKey: FORENSICATOR (you wont need the entire key)

Page 34: Cryptanalysis Lecture

© 2012 Jonathan T Rajewski 34

Phase 3

Please analyze: CT: ICLKGZMRUZ (Intersect)Key: FORENSICATOR (Side) PT: (Top)

Hint – you wont need the entire Key

Page 35: Cryptanalysis Lecture

© 2012 Jonathan T Rajewski 35

Phase 3 Review

Ct: ICLKGZMRUZ(Intersect) Key: FORENSICAT(Side)Plaintext: DOUGTHEPUG(Top)

Page 36: Cryptanalysis Lecture

© 2012 Jonathan T Rajewski 36

Phase 4

The end is here. This is the most complicated ciphertext yet. Doug the Pug “cracked” during

interrogation and revealed his secret partner in crime.

Next class we will look at the ADFGVX