Download presentation
Presentation is loading. Please wait.
Published byΙάνθη Δαγκλής Modified over 5 years ago
1
Computer Security Mohammad Alauthman
2
CRYPTOLOGY Definition: Cryptology : from the Greek
Crypto meaning secret or hidden, and ology meaning doctrine, theory, or science Two major divisions: Cryptography & Cryptanalysis 4/5/2019 © 2004 Dr. Khalid Kaabneh.
3
Cryptography & Cryptanalysis
Cryptography: Methods that turn ordinary text (plaintext) into unreadable ciphertext. Only unreadable as long as an adversary cannot invert (recover) the information Cryptanalysis: Methods that recover plaintext from ciphertext and/or methods to forge ciphertext so it appears to be authentic 4/5/2019 © 2004 Dr. Khalid Kaabneh.
4
Secure Distribution Channel Plaintext Message X Y
Cryptanalyst Now is the time for all.. ………. ... country Key Source Encryption Algorithm Decryption Secure Distribution Channel Plaintext Message X Y K X’ K’ Destination Ciphertext 4/5/2019 © 2004 Dr. Khalid Kaabneh.
5
Methods for Information Hiding: 2 Main Forms
Steganography - literally meaning covered writing and depends on hiding the very existence of a secret message from an adversary. Cryptography - uses an algorithm and key to transform a message into an unreadable form that can only be inverted by using the same key and running the algorithm backwards. It is also possible (as usual) to combine methods. 4/5/2019 © 2004 Dr. Khalid Kaabneh.
6
Basic Definitions: Plaintext : The original intelligible message
Ciphertext: The transformed message Cipher: An algorithm for transforming an intelligible message into one that is unintelligible by transposition and/or substitution methods Key: Some critical information used by the cipher, known only to the sender & receiver Encipher (encode): The process of converting plaintext to ciphertext using a cipher and a key Decipher (decode): The process of converting ciphertext back into plaintext using a cipher and a key Code: An algorithm for transforming an intelligible message into an unintelligible one using a code-book 4/5/2019 © 2004 Dr. Khalid Kaabneh.
7
Cryptographic Goals: (1) Privacy or confidentiality.
Confidentiality is a service used to keep the content of information from all but those authorized to have it. Secrecy is a term synonymous with confidentiality and privacy. There are numerous approaches to providing confidentiality, ranging from physical protection to mathematical algorithms which render data unintelligible. (2) Data integrity. Data integrity is a service which addresses the unauthorized alteration of data. To assure data integrity, one must have the ability to detect data manipulation by unauthorized parties. Data manipulation includes such things as: 1. Insertion. 2. Deletion. 3. Substitution. 4/5/2019 © 2004 Dr. Khalid Kaabneh.
8
Cryptographic goals: (3) Authentication. (4) Non-repudiation.
Authentication is a service related to identification. This function applies to both entities and information itself. Two parties entering into a communication should identify each other. Information delivered over a channel should be authenticated as to origin, date of origin, data content, time sent, etc. For these reasons this aspect of cryptography is usually subdivided into two major classes: entity authentication and data origin authentication. Data origin authentication implicitly provides data integrity (for if a message is modified, the source has changed). (4) Non-repudiation. Non-repudiation is a service which prevents an entity from denying previous commitments or actions. When disputes arise due to an entity denying that certain actions were taken, a means to resolve the situation is necessary. For example, one entity may authorize the purchase of property by another entity and later deny such authorization was granted. A procedure involving a trusted third party is needed to resolve the dispute. 4/5/2019 © 2004 Dr. Khalid Kaabneh.
9
Cryptographic Primitives
Arbitrary length hash functions Unkeyed Primitives One-way permutations Random sequences Symmetric-key ciphers Arbitrary length hash functions(MACs) Block ciphers Stream Block ciphers Symmetric-key ciphers Stream ciphers Arbitrary length hash functions(MACs) Security Primitives Symmetric-key Primitives Signatures Pseudorandom sequences Identification primitives Public-key ciphers Public-key Primitives Signatures Identification primitives 4/5/2019 © 2004 Dr. Khalid Kaabneh.
10
Primitives Evaluation Criteria's:
Level of security Functionality. Methods of operation. Performance. Ease of implementation. 4/5/2019 © 2004 Dr. Khalid Kaabneh.
11
Conventional Encryption Principles
An encryption scheme has five ingredients: Plaintext Encryption algorithm Secret Key Ciphertext Decryption algorithm Security depends on the secrecy of the key, not the secrecy of the algorithm 4/5/2019 © 2004 Dr. Khalid Kaabneh.
12
A Brief History of Cryptography
Ancient Ciphers Have a history of at least 4000 years. Ancient Egyptians enciphered some of their hieroglyphic writing on monuments. 4/5/2019 © 2004 Dr. Khalid Kaabneh.
13
A Brief History of Cryptography
Wheatstone disc originally invented by Wadsworth in 1817, but developed by Wheatstone in 1860's, comprised two concentric wheels used to generate a polyalphabetic cipher 4/5/2019 © 2004 Dr. Khalid Kaabneh.
14
A Brief History of Cryptography
Machine Ciphers Jefferson cylinder, developed in 1790s, comprised 36 disks, each with a random alphabet, order of disks was key, message was set, then another row became cipher 4/5/2019 © 2004 Dr. Khalid Kaabneh.
15
A Brief History of Cryptography
Machine Ciphers Rotor machines with multiple cylindrical rotors, each with 26 input lines, and 26 output lines. Each input line is connected to an output line producing a simple substitution cipher (e.g., a in, t out). For each input character typed, the rotor advances. This is a polyalphabetic cipher with a repeating cycle of 26. Relatively easy to break. 4/5/2019 © 2004 Dr. Khalid Kaabneh.
16
A Brief History of Cryptography
Enigma Rotor machine one of a very important class of cipher machines, heavily used during 2nd world war, comprised a series of rotor wheels with internal cross-connections, providing a substitution using a continuously changing alphabet 4/5/2019 © 2004 Dr. Khalid Kaabneh.
17
Classical Cryptographic Techniques
Substitution : The ciphers letters are replaced by other letters Transposition: The ciphers the letters are arranged in a different order 4/5/2019 © 2004 Dr. Khalid Kaabneh.
18
SUBSTITUTION TECHNIQUES
4/5/2019 © 2004 Dr. Khalid Kaabneh.
19
SUBSTITUTION TECHNIQUES:
Caesar Cipher: Replace each letter of message by a letter a fixed distance away Graphically, the Caesar cipher, for k = 3 is: 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 Z 4/5/2019 © 2004 Dr. Khalid Kaabneh.
20
SUBSTITUTION TECHNIQUES:
Caesar Cipher: the mapping is ABCDEFGHIJKLMNOPQRSTUVWXYZ DEFGHIJKLMNOPQRSTUVWXYZABC 4/5/2019 © 2004 Dr. Khalid Kaabneh.
21
PHHWPHDIWHUWKHWRJDSDUWB MEETMEAFTERTHETOGAPARTY
Caesar Cipher: Problem1: decipher the following message using Caesar Cipher? PHHWPHDIWHUWKHWRJDSDUWB MEETMEAFTERTHETOGAPARTY 4/5/2019 © 2004 Dr. Khalid Kaabneh.
22
Caesar Cipher: MYNAMEISKHALID UGVIUMQASITQL Problem1:
Encrypt the following message using Caesar Cipher shift = 8? MYNAMEISKHALID UGVIUMQASITQL 4/5/2019 © 2004 Dr. Khalid Kaabneh.
23
Caesar Cipher: Then we can describe this cipher as:
Encryption C = E(p) = (p + 3) mod 26 (shift three spaces) Or Encryption C = E(p) = (p + k) mod 26 (shift k spaces) 4/5/2019 © 2004 Dr. Khalid Kaabneh.
24
Brute Force Decryption
Key try Message produced 1 gy yknn cvvcem cv feyp vtqwj vjg nghv hncpm 2 xf xjmm buubdl bu edxo uispvi uif mfgu gmbol 3 we will attack at dawn through the left flank 4 ……… 5 …… . 25 ai ampp exxego ex hear xlvvsyl xli pijx jpero Another method uses the frequency of occurrence of letters in the English alphabet (if the message is in English). E is the most common character in frequency of appearance in the English language. 4/5/2019 © 2004 Dr. Khalid Kaabneh.
25
SUBSTITUTION TECHNIQUES:
Vigenère Cipher: basically multiple caesar ciphers key is multiple letters long K = k_(1) k_(2) ... k_(d) ith letter specifies ith alphabet to use use each alphabet in turn, repeating from start after d letters in message Plaintext THISPROCESSCANALSOBEEXPRESSED Keyword CIPHERCIPHERCIPHERCIPHERCIPHE Ciphertext VPXZTIQKTZWTCVPSWFDMTETIGAHLH based on a Vigenère Table shown next 4/5/2019 © 2004 Dr. Khalid Kaabneh.
26
SUBSTITUTION TECHNIQUES:
Vigenère Cipher: ABCDEFGHIJKLMNOPQRSTUVWXYZ A ABCDEFGHIJKLMNOPQRSTUVWXYZ B BCDEFGHIJKLMNOPQRSTUVWXYZA C CDEFGHIJKLMNOPQRSTUVWXYZAB D DEFGHIJKLMNOPQRSTUVWXYZABC E EFGHIJKLMNOPQRSTUVWXYZABCD F FGHIJKLMNOPQRSTUVWXYZABCDE G GHIJKLMNOPQRSTUVWXYZABCDEF H HIJKLMNOPQRSTUVWXYZABCDEFG I IJKLMNOPQRSTUVWXYZABCDEFGH J JKLMNOPQRSTUVWXYZABCDEFGHI K KLMNOPQRSTUVWXYZABCDEFGHIJ L LMNOPQRSTUVWXYZABCDEFGHIJK M MNOPQRSTUVWXYZABCDEFGHIJKL N NOPQRSTUVWXYZABCDEFGHIJKLM O OPQRSTUVWXYZABCDEFGHIJKLMN P PQRSTUVWXYZABCDEFGHIJKLMNO Q QRSTUVWXYZABCDEFGHIJKLMNOP R RSTUVWXYZABCDEFGHIJKLMNOPQ S STUVWXYZABCDEFGHIJKLMNOPQR T TUVWXYZABCDEFGHIJKLMNOPQRS U UVWXYZABCDEFGHIJKLMNOPQRST V VWXYZABCDEFGHIJKLMNOPQRSTU W WXYZABCDEFGHIJKLMNOPQRSTUV X XYZABCDEFGHIJKLMNOPQRSTUVW Y YZABCDEFGHIJKLMNOPQRSTUVWX Z ZABCDEFGHIJKLMNOPQRSTUVWXY 4/5/2019 © 2004 Dr. Khalid Kaabneh.
27
What is the message if the key is: deceptive
Vigenère Cipher Example: What is the message if the key is: deceptive Cipher text is: ZICVTWQNGRZGVTWAVZHCQYGLMGJ Answer: We are discovered save yourself 4/5/2019 © 2004 Dr. Khalid Kaabneh.
28
One-Time Pad Cipher (OTP):
This technique was introduced by army signal officer Joseph Mauborgne. Which is also called Vernam. He suggested using a random key that is as long as the message. A message encrypted using a one-time pad cannot be broken because the encryption key is a random number and because the key is used only once. 4/5/2019 © 2004 Dr. Khalid Kaabneh.
29
One-Time Pad Cipher (OTP):
Step 1: Create the key... · You need to create a random key HLMSEZRBHPSJOTDW · You need a method for converting alphabet characters into numbers. 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 Z 4/5/2019 © 2004 Dr. Khalid Kaabneh.
30
One-Time Pad Cipher (OTP):
Step 1: HLMSEZRBHPSJOTDW · To make the key easier to work with, break it into blocks of two characters each, thus HL MS EZ RB HP SJ OT DW Now use the conversion table shown above to convert the alphabet characters into numbers. For example H=08 and L=12, so the first block HL becomes The result is (The key) 4/5/2019 © 2004 Dr. Khalid Kaabneh.
31
One-Time Pad Cipher (OTP):
Step 2: Format your message... · Message MY SECRET. Key HL MS EZ RB HP SJ OT DW 4/5/2019 © 2004 Dr. Khalid Kaabneh.
32
One-Time Pad Cipher (OTP):
Guidelines... Rule 1 – Numbers. Spell out all numbers in full in your plaintext. For example, 365 becomes THREE SIX FIVE. Rule 2 – Negatives. Always add emphasis to the word NOT in your plaintext. For example, you would write AGENT ALPHA NOT RPT NOT AVAILABLE FOR MEETING TUESDAY, where RPT stands for REPEAT. Rule 3 – Punctuation. Use an X for each period in your plaintext. For example, MESSAGE RECEIVEDX SEND MORE INFOX. All other punctuation must be written out in full. For example, COMMA. Rule 4 – Termination. End your plaintext with XX. If necessary, add dummy characters after XX in order to pad out the message to frustrate cryptanalysis and to conclude on a doublet (ensuring the numeric string ends with four digits). 4/5/2019 © 2004 Dr. Khalid Kaabneh.
33
One-Time Pad Cipher (OTP):
Step 3: Encrypt your message... · We need some way to indicate to our recipient where the key begins, otherwise he/she won't be able to decrypt. Remember in our earlier example, we created a key and stroked off (in gray) the blocks we'd already used. Here's what our key looked like. The starting position in the key is at block So we'll place the string 1319 at the beginning of our message so the recipient will know how to decrypt. The plaintext message of becomes because we place the pointer 1319 at the beginning of the string. 4/5/2019 © 2004 Dr. Khalid Kaabneh.
34
One-Time Pad Cipher (OTP):
Step 3: Encrypt your message... · First we write out the plaintext. Then directly below it we write out the key. Then we add the key to the plaintext using Fibonicci addition. This means we do no carrying. For example, would yield 1 not 11. And 7 plus 6 would yield 3 not 13. Here's how the spy's working sheet would look. Plaintext Key Ciphertext Encrypted message 4/5/2019 © 2004 Dr. Khalid Kaabneh.
35
One-Time Pad Cipher (OTP):
Step 3: Decrypting the message... We subtract the key from the ciphertext using Fibonicci subtraction . We allow no negative numbers. For example, would yield 3 (because we add 10 so that we're able to subtract 9 from 12). · Ciphertext Key Plaintext 4/5/2019 © 2004 Dr. Khalid Kaabneh.
36
One-Time Pad Cipher (OTP):
How to test your skills... QUIZ Here is a piece of ciphertext and a one-time pad you can use to verify your new skills. The one-time pad is The ciphertext is Remember that the first four-digit group in the ciphertext is a pointer indicating where to begin in the one-time pad. 4/5/2019 © 2004 Dr. Khalid Kaabneh.
37
Playfair - Charles Wheatstone 1854
Multiple letter encryption mapping two letters into a two cipher letters. Masks the symbol frequency better than simpler ciphers. Used by British in the Boer War, WWI, and to some extent in WWII. Maps letters into a 5 x 5 matrix (Z is omitted) and follows three rules. The matrix is populated and both ends know the mapping. 4/5/2019 © 2004 Dr. Khalid Kaabneh.
38
Playfair Mapping is a spiral starting at lower-right corner. I H G F E
J U T S D K V Y R C L W X Q B M N O P A 4/5/2019 © 2004 Dr. Khalid Kaabneh.
39
Playfair Rules Arrange plaintext into pairs. If a double letter (e.g., tt) Insert an X. If an odd number, insert an X pad at the end. If pair is in same row, cipher pair is two letters to the right wrapped to left column (IG = HF; XB = QL). 2. If pair is in same column, cipher pair is below, wrap to top (FQ = SP; UN = VH; FS = SR). 3. If pair is at corners of a rectangle of letters, 1st encrypts to corner of same row, 2nd to corner in its row (EK = IC; UR = SV; AI = ME). 4/5/2019 © 2004 Dr. Khalid Kaabneh.
40
Playfair Example Plain = ME Rx RI LY WE RO Lx LA LO NG I H G F E J U T
S D K V Y R C L W X Q B M N O P A Cipher = AI YQ KF XK BH YP WQ BM XM OH 4/5/2019 © 2004 Dr. Khalid Kaabneh.
41
Hill Cipher The Hill Cipher uses matrix multiplication to encrypt a message. First, you need to assign two numbers to each letter in the alphabet and also assign numbers to space, . , and ? or !. The key space is the set of all invertible matrices over Z was chosen because there are 26 characters, which solves some problems later on. The encryption function, in its most basic form looks like this: ek(x)=k (x) 4/5/2019 © 2004 Dr. Khalid Kaabneh.
42
Hill Cipher example: Using the following table and 00 for spaces:
F O U R S C O R E A N D …. Using the following table and 00 for spaces: 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 Z The Code: 4/5/2019 © 2004 Dr. Khalid Kaabneh.
43
Hill Cipher example: The key, k, will be a 2x2 matrix. For example:
To encrypt the message, we take two letters at a time and make a vector. Thus "Fo" becomes the vector 4/5/2019 © 2004 Dr. Khalid Kaabneh.
44
Hill Cipher example: You then encrypt V by multiplying by K and reducing mod 26: V---->KV mod 26 (K11x P1 + K12P2 ) mod 26 (K21x P1 + K22P2 ) mod 26 (03 X X 15) mod 26 = 15 (06 X X 07) mod 26 = 13 4/5/2019 © 2004 Dr. Khalid Kaabneh.
45
Hill Cipher Decryption:
In order to decrypt, you first need to find the inverse of your original 2x2 matrix. First, you need to figure out the determinate of the key: For 2 X 2 matrix, determinate = K11K22 – K12K21 The for the above example determinate is: = 11 Inverse of a 2x2 matrix The inverse of a 2x2 matrix can be written explicitly, namely 4/5/2019 © 2004 Dr. Khalid Kaabneh.
46
Hill Cipher Decryption:
In general: C = Ek(P) = KP mod 26 P = Dk(C) = K-1C mod 26 = K-1KP = P 4/5/2019 © 2004 Dr. Khalid Kaabneh.
47
TRANSPOSITION TECHNIQUES
4/5/2019 © 2004 Dr. Khalid Kaabneh.
48
TRANSPOSITION TECHNIQUES
transposition or permutation ciphers hide the message contents by rearranging the order of the letters. Scytale cipher. Reverse cipher. Rail Fence cipher. Geometric Figure. Row Transposition ciphers. 4/5/2019 © 2004 Dr. Khalid Kaabneh.
49
TRANSPOSITION TECHNIQUES
Scytale cipher 4/5/2019 © 2004 Dr. Khalid Kaabneh.
50
TRANSPOSITION TECHNIQUES
Reverse cipher write the message backwards Plain: I CAME I SAW I CONQUERED Cipher: DEREU QNOCI WASIE MACI 4/5/2019 © 2004 Dr. Khalid Kaabneh.
51
TRANSPOSITION TECHNIQUES
Rail Fence cipher write message with letters on alternate rows then read off cipher row by row Plain: I A E S W C N U R D C M I A I O Q E E Cipher: IAESW CNURD CMIAI OQEE 4/5/2019 © 2004 Dr. Khalid Kaabneh.
52
TRANSPOSITION TECHNIQUES
Geometric Figure write message following one pattern and read out with another 4/5/2019 © 2004 Dr. Khalid Kaabneh.
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.