Testing tools and AI - ideas what to try with some tool examples
Cryptology
1. Cryptography
“ You can’t make something secure if you
don’t know how to break it”
- Marc Weber Tobias
2. Definition
• Cryptography is the science of
disguising messages so that only the
intended recipient can decipher the
received message.
• Secret Writing
7. • Encryption: c = Ee(p)
• Decryption: p = Dd(c)
• Here p is a block of plaintext,
c is a block of ciphertext,
E is the encryption function,
e is the encryption key,
D is the decryption function and
d is the decryption key.
Cryptography
8. Cryptanalysis
• Cryptography is the art and science of
creating secret codes.
• Cryptanalysis is the art and science of
breaking those code.
15. Shift Cipher
• Encryption
o C=(P+K1) Mod 26
• Decryption
o P=(C-K1) Mod 26
https://www.youtube.com/watch?v=fEULLhEA4Vk
16. • The Additive cipher replaces each alphabet
in a text by the alphabet k positions away
(in the modulo 26 sense).
• For k = 3
W H A T I S Y O U R N A M E becomes
Z K D W L V BR X U Q D P H
18. Affine Cipher
• Combination of Additive and
Multiplicative
• Encryption
o C=(P * K1 + K2) Mod 26
• Decryption
o P=((C – K2 )* K1
-1) Mod 26
19. Cryptanalysis
• Brute-Force Attack
• Statistical Attack
• Frequency of Occurrence of
letters.(E,T,A,O,I,N,S,H,R,D……)
• Grouping of Di-gram (HE,IN,AN,IS...)
and Tri-grams (THE,ING,AND,HER…).
20. Poly-alphabetic Cipher
• Each occurrence of character may
have a different substitution.
• One to Many
• Vigenere Cipher , Play-fair Cipher, Hill
Cipher ,Vernam Cipher.
21. Vigenere Cipher
• Blaise de Vigenere, Mathematician
• Secret Key of length m (K1,K2.......,Km) is
required
• Key stream Not depend on plaintext
character.
• Encryption depends on the position of
character in the plaintext.
22.
23. Example
• Plaintext : SHE IS LISTINING
• Key : PASCAL
• Cipher text : HHW KS WXSLGNTCG
24. Plaintext S H E I S L I S T I N I N G
P Values 18 07 04 08 18 11 08 18 19 04 13 08 13 06
K Values 15 00 18 02 00 11 15 05 08 02 00 11 05 00
C Values 07 07 22 10 18 22 23 23 11 06 13 19 02 06
Cipher text H H W K S W X X L G N T C G
25. Plaintext S H E I S L I S T I N I N G
P Values 18 07 04 08 18 11 08 18 19 04 13 08 13 06
K Values 15 00 18 02 00 11 15 00 08 02 00 11 05 00
C Values 07 07 22 10 18 22 23 18 11 06 13 19 02 06
Cipher text H H W K S W X S L G N T C G
26. Play-fair Cipher
• Used by British army during World war I
• Secret key made of 25 alphabet
arranged in 5*5 Matrix.
• Two step process
o Creation of matrix
o Encryption
32. Solution
• SH EI SL IS TI NI NG
• IS = NT
• TI(SAME COLUMN) = YD
M O R N I
G A B C D
E F H J K
L P Q S T
U V W X YZ
33. Solution
• SH EI SL IS TI NI NG
• NI(SAME ROW) = IM
• NG = MC
M O R N I
G A B C D
E F H J K
L P Q S T
U V W X YZ
34. Hill Cipher
• Lester S. Hill
• Block Cipher
• Key is square matrix of order m*m
• Key Matrix need to have multiplicative
inverse.
• Difficult to break
36. One-Time Pad
• Vernam Cipher.
• Key used once can not be reused.
• Key length is equal to message length.
• Book cipher / Running Key cipher
37. Plaintext V E R N E M C I P H E R
Numeric Code 21 04 17 13 00 12 02 08 15 07 04 17
Key 76 48 06 82 44 03 58 11 60 05 48 88
Sum 97 52 33 95 44 15 60 19 75 12 52 105
Mod 26 19 00 07 17 18 15 08 19 23 12 00 01
Ciphertext T A H R S P I T X M A B
46. Symmetric Key
• Same key is used for encryption and
decryption of message.
• Key Exchange Problem
47.
48. Diffie-Hellman Algorithm
1. Pick random, secret x
2. Compute A = gx mod n
3. Send A to Bob
4. K1 = Bx Mod n
1. Pick random, secret y
2. Compute B = gy mod n
3. Send B to Alice
4. K2 = Ay Mod n
Alice and Bob agree on two
prime number n and g
49. Diffie – Hellman
K1 = (gx mod n)y = gxy mod n K2 = (gy mod n)x = gxy mod n
• Let n = 11 and g = 7
• Let x = 3 and compute A
• Let y = 6 and compute B
• Calculate K1 and K2
50. Solution
1. N = 11 , g = 7
2. x = 3 then A = 73 Mod 11 = 2
3. y = 6 then B = 76 Mod 11 = 4
4. K1 = 43 Mod 11 = 9
5. K2 = 26 Mod 11 = 9