CS Chapter 3-0 2016
CS Chapter 3-0 2016
Instructor: Zufan W.
Cryptography
Cryptography is come from Greek Words Crypto
“secret”/ “hidden” and graphy “writing”.
A Cryptosystem/Cipher system is an
implementation of cryptographic techniques and
their supplementary infrastructure to provide
information security services.
03/11/2024
complex. Computer Security 13
Asymmetric-key /Public-Key Cryptography System
Classical Modern
Cryptography Cryptograph
Modern Ciphers
The modern ciphers or encryption could
be conducted in to either Block Ciphers or
Stream Cipher -----XOR
Stream Cipher
A stream cipher is one that encrypts a
digital data stream one bit or one byte at
a time.
XOR
Key 0 1 0 1 0 1 0 1
000
110
Cipher Text 1 1 1 1 0 0 1 0
011
101
Key 0 1 0 1 0 1 0 1
Cipher Text 1 1 1 1 0 0 1 0
Plain Text 1 0 1 0 0 1 1 1
Block Ciphers
In block cipher, a block of plaintext characters of a
fixed size is encrypted at once to produce a cipher
text block of equal length and sent to the receiver.
P TXT 1010 1001 0011 0100 0101 0111 0111 1001 1001 1011 1011 1100 1101 1111 1111 0001
Key 0101 0101 0110 0110 0101 0101 0110 0110 0101 0101 0110 0110 0101 0101 0110 0110
Class Activity
Plain text: YOUR NAME TSEGGAYE
Key: ETHIOPIA
a b c d e f g h i j k l m
0 1 2 3 4 5 6 7 8 9 10 11 12
n o p q r s t u v w x y z
13 14 15 16 17 18 19 20 21 22 23 24 25
if k>25 character Z does not able to encrypt it self thus k can not >25 but k
can be
K<1 thus negative k+26 mod 26 we can get the value
03/11/2024 Computer Security 32
Caesar Cipher
Class Activity quiz :Encrypt and Decrypt the given plain text use the following formula
Plain Text: MY NAME IS
Key=6
Class Activity quiz : If the Caesar Cipher Key 1 ≤ K ≤ 25 all alphabet character
can have the following numerical value
a b c d e f g h i j k l m
0 1 2 3 4 5 6 7 8 9 10 11 12
n o p q r s t u v w x y z
13 14 15 16 17 18 19 20 21 22 23 24 25
Plain: 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
Cipher: D K V Q F I B J W P E S C X H T M Y A U O L R G Z N
Plain: i f w e w i s h t o r e p l a c e l e t t e r s
Cipher: W I R F R W A J U H Y F T S D V F S F U U F Y A
Class Activity: Encrypt and Decrypt the given plain text use the following formula
Plain Text: Plaintext is TEXT
Initial Key=3
Initial Key=3 Plaintext is TEXT C=E(P+K)mod 26
Initial Key=3*1=3 Plain Text=T=19 C=19+3=22%26=22=W
C=E(P,K)=(P+K) mod (26) Next Key=3*2=6 Next Text=E=4 C=4+6=10%26=10=K
P=D(C,K)=(C-K) mod (26) Next Key=3*3=9 Next Text=X=23 C=23+9=32%26=6=G
Next Key=3*4=12 Next Text=T=19 C=19+12=31%26=5=F
Next Key=…. Cipher is Text=WKGF
a b c d e f g h i j k l m
0 1 2 3 4 5 6 7 8 9 10 11 12
n o p q r s t u v w x y z
13 14 15 16 17 18 19 20 21 22 23 24 25
Encryption Process
Example: Plain Text: TREE IS GREEN
Keyword: HACK
Width of the rows and permutation of the columns are defined by a key.
If any spare (extra, unused) spaces are filled with null or left
blank or placed by a character(Example: _ ).
Create 4 column and 4 row then put the plain text in the cell sequential
next the cipher is the sequential alphabet order of key. Thus
Cipher text: R I R _ E S E _ T_ G N E_ E_
03/11/2024 Computer Security 52
Columnar Transposition Cipher
Then write the cipher text in columns again, then reorder the
columns by reforming the keyword.
Columnar Transposition
The number of columns is the key information.
To encipher: Plaintext is written horizontally in k
columns, and is then transcribed vertically column -
by-column.
Columnar Transposition
Solution: We write the plaintext horizontally in 9 columns as
follows:
NOTHINGIN
THEWORLDI
SMOREDANG
EROUSTHAN
SINCEREIG
NORANCEAN
DCONSCIEN
TIOUSSTUP
IDITY
03/11/2024 Information Assurance and Security 56
Columnar Transposition Cipher
Columnar Transposition Cipher
DIV 7 = 5 full rows and one partial row with 39 MOD 7 = 4 letters.
Decryption Progresses
Put the cipher text in table format based on the key
sequential alphabet order of keyword then collate the
character from 1st row to the last row.
To decipher it the recipient has to work out the column
lengths by dividing the message length by the key length.
Keyword: HACK, Length of keyword:4,
Cipher text: R I R _ E S E _ T_ G N E_ E_
The message length: 16
The key length:4
03/11/2024 So, Length Computer
of columnSecurityis 16/4 = 4 59
Product Ciphers