Ty Btech Trimester-Viii (Ay 2019-2020) Computer Science and Engineering
Ty Btech Trimester-Viii (Ay 2019-2020) Computer Science and Engineering
Disclaimer:
a. Information included in these slides came from multiple sources. We have tried our
best to cite the sources. Please refer to the references to learn about the sources,
when applicable.
b. The slides should be used only for preparing notes, academic purposes (e.g. in teaching
a class), and should not be used for commercial purposes.
CS323: Information
Security
Examination Scheme:
Continuous Assessment: 50 Marks End Semester Examination: 50 Credit: 2+1
Course Objectives:
Course Outcomes:
After completion of this course students will be able to:
Use basic security principles and techniques in secured application programming.
Mathematically prove security solutions in cryptography applications.
To handle key management and authentication protocols.
To deploy network security tools and solutions of web information security.
Unit: II Mathematical Foundations and Public Key Cryptography: Mathematics for Security: Modular 8 Hrs
Arithmetic, Euclidean Algorithm, Chinese Remainder Theorem, Discrete Logarithm, Fermat
Theorem, Secret Splitting and Sharing with polynomials Asymmetric key Cryptography: RSA.
Hash algorithms: SHA1, Digital Signatures: Symmetric Key Signatures, Public Key Signatures.
Unit: III Key Management and Authentication: Pseudo Random numbers, Key Management: Types of 7 Hrs
Keys, Generation, Distribution, Cryptographic Key Infrastructures, Diffie-Hellman Key Exchange,
Digital Certificates x509. Authentication Protocols: Remote, Mutual Authentication, Passwords
attacks & defence, Symmetric key and Asymmetric key Authentication, Federated Authentication.
information Security: Unit - I Prof. U. K. Raut
Syllabus (Continue)
Unit: IV Networks and Web security: Layer wise Security concerns, Firewalls: Packet filtering, Stateless 7 Hrs
and Stateful, Intrusion detection systems: host based, network based IDS, Secured Socket Layer
Security, IP level IPSEC security, Kerberos Security System. Wireless Security.
Books:- 1. Cryptography and Network Security, William Stallings, Pearson Education 5th Edition, ISBN 13: 978-
(Text) 0-13-609704-4
2. Computer Security: Principles and Practices, Willaim Stallings and Lawrie Brown, Pearson Education,
ISBN 13-9780134794396
Books:- 1. Cryptography and Network Security, Berouz Forouzan 2 edition, TMH, ISBN :9780070702080
(Referen 2. Applied Cryptography, Bruice Schneier, 2nd Edition, Wiely India Pvt Ltd, ISBN 978-81-265-1368-0
ce)
3. Computer Security: Art and Science, by Matt Bishop, Pearson Education, ISBN:9788177584257
Supplementary Reading:
1. E-books
2. Web links
3. MOOCs
information Security: Unit - I Prof. U. K. Raut
Laboratory: Lab Assignment
Assign No. Name of Assignment
A Core Level security (Any two)
1 Implement any classical cryptographic technique using java or python or C++
2 Implement simple DES symmetric key algorithm using python or java or C++
3 Implement simple RSA asymmetric key algorithm using python or java or C++
2 To program basic cryptography hash algorithm SHA1 or MD5 Use Java or Python or C++ API. Additionally
demonstrate client server authentication using socket programming.
3 Write program for demonstration of digital signature and its verification using Java or Python or C++.
Journal
30% 15
Submission
Understanding
30% 15
(Orals)
Attendance 10% 5
Total 50
note terms
• threat: a potential for violation of security
• attack: an assault on system security, a deliberate attempt to evade security
services
information Security: Unit - I Prof. U. K. Raut
Security Attacks - Security threats
Information Information
source destination
a) Normal flow
d) Modification
information Security: Unit - I Prof. U. K. Raut
e) Fabrication
Passive Attack: make use of information from the system but does not affect system
resource
Observe pattern
of messages
Note: in dealing with passive attacks is on prevention rather than detection. i.e. encryption
Confidentiality (privacy)
Authentication (who created or sent the data)
Integrity (has not been altered)
Non-repudiation (the order is final)
Access control (prevent misuse of resources)
Availability (permanence, non-erasure)
a)Interruption 1)integrity
b)Interception 2)availability
c)Modification 3)authentication
d)Fabrication
4)confidentiality
Problem 1: Consider an automated teller machine (ATM) in which users provide a personal
identification number (PIN) and a card for account access. Give examples of confidentiality,
integrity, and availability requirements associated with the system and, in each case, indicate the
degree of importance of the requirement.
Solution: The system must keep personal identification number (PIN) confidential, both in the host
system and during transmission for a transaction. In addition, for security the personal identification
number must encrypted.
It must protect the integrity of account records and of individual transactions.
Availability of the host system is important to the economic well being of the bank, but not to its
fiduciary responsibility. The availability of individual teller machines is of less concern.
Cipher: D E F G H I J K L M N O P Q R S T U V W X Y Z A B C
Example: mit pune PLW SXQH E.g. break ciphertext “GCUA VQ DTGCM”
Answer: easy to break
Mathematically, map letters to numbers:
a b c d e f g h i j k l m Then the general Caesar cipher is:
0 1 2 3 4 5 6 7 8 9 10 11 12 c = EK(p) = (p + k) mod 26 p
n o p q r s t u v w x y z = DK(c) = (c – k) mod 26
13 14 15 16 17 18 19 20 21 22 23 24 25
Shuffle the letters and map each plaintext letter to a different random ciphertext letter:
Plain letters: abcdefghijklmnopqrstuvwxyz
Cipher letters: DKVQFIBJWPESCXHTMYAUOLRGZN
Plaintext: ifwewishtoreplaceletters
Ciphertext: WIRFRWAJUHYFTSDVFSFUUFYA
ci = pi XOR ki
Becauseof these difficulties, the one-time pad is of limited utility and is useful primarily for
low-bandwidth channels requiring very high security.
Decryption: ABEEESWHTTRE h e a v e n
4 2 1 6 3 5
W E A R E T
H E B E S T
Problem: Using Transposition cipher encrypt message “WE ARE THE BEST” use key ‘HEAVEN’
h e a v e n
4 2 1 6 3 5
W E A R E T
H E B E S T
ABEEESWHTTRE a n o t h e r
1 4 5 7 3 2 6
A B E E E S W
H T T R E
information Security: Unit - I Prof. U. K. Raut
Modes of Operation
The message is divided into blocks, and each block is encrypted separately.
If two plaintext blocks are identical then the ciphertext block are also same . Therefore, a
known plaintext attack is possible.
uses: secure transmission of single values
Ci = EK(Pi)
The message is divided into blocks, and each block is encrypted separately.
An initialisation is random number is used to increase security.
It can be used to generate the hash value.
Ci = EK(Pi XOR Ci-1)
uses: bulk data encryption, authentication C-1 = IV
Can be used when the block size is smaller than the required block
size.
The block size may be a bit or bytes, so there is no need of padding. Ci = Pi XOR EK(Ci-1)
uses: stream data encryption, authentication C-1 = IV
Consider the CFB of operation where the block cipher is permutation cipher and key is mutation
1 2 3 4 . If the intial vector is taken as 1010 the compute the ciphertext correspond to
the
3 4 2 1 plaintext 010010111100
The plaintext is divided into two halves (L0 and R0). Then the two halves pass through
n
rounds of processing then combine to produce the cipher block.
Each round i has as input L i-1 and Ri-1 derived from the previous round as well as a sub-
key Ki derived from the overall
information K
Security: Unit - I Prof. U. K. Raut
information Security: Unit - I Prof. U. K. Raut
The design of Feistel cipher depends on following parameter:
Block Size: (larger block means greater security) 64 bits.
Key Size:56-128 bits.
Number of Rounds: a single round offers inadequate security, a typical size is 16 rounds.
Sub-key Generation Algorithms: greater complexity should lead to a greater difficulty of
cryptanalysis.
Round function: Again, greater complexity generally means greater resistance
to cryptanalysis.
Initial
Step 2 Permutatio
n (IP)
Step 3 LPT RPT
Thefirst bit of the output is taken from the 58th bit of the input; the second bit from the 50th bit,
and so on, with the last bit of the output taken from the 7th bit of the input. i.e. transposition
Key Transformation
Expansion Permutation
S-Box Substitution
P-Box Permutation
14 17 11 24 1 5 3 28 15 6 21 10
Compression Permutation 23 19 12 4 26 8 16 7 27 20 13 2
41 52 31 37 47 55 30 40 51 45 33 48
44 49 39 56 34 53 46 42 50 36 29 32
inf ormatio Securit y: Unit I Prof U. K. Ra ut
n - .
Step 2: Expansion Permutation
32-bit RPT is divided into 8 blocks (each block 4-bits)
Each 4-bit block is expanded to 6-bit block. Two bits -- repeated first and forth bits
1 2 3 4 5 6 7 8 9 10 11 12 43 44 45 46 47 48
Output Block 1 (6 bits) Output Block 2 (6 bits) Output Block 3 (6 bits)
S-box
Substitution
16 7 20 21 29 12 28 17 1 15 23 26 5 18 31 10
2 8 24 14 32 27 3 9 19 13 30 6 22 11 4 25
32-bit Left Plain Text (LPT) Block 32-bit Right Plain Text (RPT) Block
Key Transformation
(not involved directly)
Expansion Permutation
S-box Substitution
P-box Permutation
XOR
32-bit Left Plain Text (LPT) Block 32-bit Right Plain Text (RPT) Block
Next round
information Security: Unit - I Prof. U. K. Raut
Final
permutation
Same algorithm and key are used for encryption and decryption
Key reversal is used i.e. K16, K15, …… K1
Analysis of DES
Useof S-boxes: The table used for substitution in DES are kept secret by IBM. It takes 17 years
come up with internal design of the S-boxes.
Key Length: There are 256 possible keys i.e. 7.2 x 1016 keys. Thus, it seems that a brute-force
attack on DES is impractical. A single computer performing one DES encryption per
microsecond would require more than 1000 years to break DES.
K2 K1
EK1(P) T = EK1(P) EK2(EK1(P)) C = EK2(EK1(P))
Temporary
P Encrypt Encrypt C
result (T)
K2 K3
K2 K1
information Security: Unit - I Prof. U. K. Raut
DES Weaknesses
DES has the 56-bit key size and being too small.
In January 1999, distributed.net and the Electronic Frontier Foundation collaborated to publicly
break a DES key in 22 hours and 15 minutes
The number of operations required to brute force a 256-bit cipher is 3.31 x 10^56. This is roughly
equal to the number of atoms in the universe!
In this operation, a Round Key is applied to the State by a simple bitwise XOR .
Key schedule
This consists of two components: the Key Expansion and the Round Key Selection.
The basic principle is the following:
The total number of Round Key bits is equal to the block length multiplied by the number
of rounds plus 1. (i.e. 128 x 11 = 1408, 1408/32 = 44)
The Cipher Key is expanded into an Expanded Key.
Round Keys are taken from this Expanded Key in the following way: the first Round Key
consists of the first Nb words, the second one of the following Nb words, and so on.
Input : 32 43 f6 a8 88 5a 30 8d 31 31
98 a2 e0 37 07 34
Key : 2b 7e 15 16 28 ae d2 a6 ab f7
15 88 09 cf 4f 3c
Round
The Round Key values StarttheofKey ExpansionAfter
are taken from example After After Round Key
Number Round SubByte ShiftRows MixColumns Value
Rijndael can be implemented to run at speeds unusually fast for a block cipher on a Pentium
(Pro). There is a trade-off between table size/performance.
Rijndael can be implemented on a Smart Card in a small amount of code, using a small amount
of RAM and taking a small number of cycles. There is some ROM/performance trade-off.
As the cipher does not make use of arithmetic operations, it has no bias towards big-or little
endian processor architectures.
The inverse cipher is less suited to be implemented on a smart card than the cipher itself: it
takes more code and cycles. (Still, compared with other ciphers, even the inverse is very fast)
In software, the cipher and its inverse make use of different code and/or tables.
In hardware, the inverse cipher can only partially re-use the circuitry that implements the
cipher.
BASIS FOR DES (DATA ENCRYPTION STANDARD) AES (ADVANCED ENCRYPTION STANDARD)
COMPARISON
Basic In DES, the data block is divided into two In AES, the entire data block is processed as a
halves. single matrix.
Principle DES work on Feistel Cipher structure. AES work on block Cipher structure.
Plaintext Plaintext is of 64 bits Plaintext can be of 128,192, or 256 bits
Key size DES in comparison to AES has smaller key AES has larger key size as compared to DES.
size.
Rounds 16 rounds 10 rounds for 128-bit algo, 12 rounds for 192-bit
algo 14 rounds for 256-bit algo
Rounds Names Expansion Permutation, Xor, Subbytes, Shiftrows,
S-box, P-box, Xor and Mix columns, Addroundkeys.
Swap.
Security DES has a smaller key which is less secure. AES has large secret key comparatively hence, more
secure.
Speed DES is comparatively slower. AES is faster.
information Security: Unit - I Prof. U. K. Raut