Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

Encryption and Decryption Using DES, Assignments of Cryptography and System Security

A project report on encryption and decryption using DES

Typology: Assignments

2019/2020

Uploaded on 06/07/2020

jahnavi-prathipati
jahnavi-prathipati 🇮🇳

3.8

(5)

6 documents

1 / 16

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
1
Encryption and Decryption Using DES
Information and System Security
A PROJECT REPORT
Submitted by
K. VIKAS REDDY - 17MIS7044
K. HARTHIK REDDY 17MIS7098
Under the Guidance of
Dr. S. Sudhakar Ilango
Associate Professor, CSE,
VIT-AP
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff

Partial preview of the text

Download Encryption and Decryption Using DES and more Assignments Cryptography and System Security in PDF only on Docsity!

Encryption and Decryption Using DES

Information and System Security A PROJECT REPORT Submitted by K. VIKAS REDDY - 17MIS K. HARTHIK REDDY – 17MIS

Under the Guidance of Dr. S. Sudhakar Ilango Associate Professor, CSE, VIT-AP

TABLE OF CONTENTS

  • 1 Introduction Chapter No. Title Page No.
  • 2 Background Study
  • 3 Problem Definition
  • 4 Objective
  • 5 Methodology/Procedure
  • 6 Results and Discussion
  • 7 Conclusion and Future Scope
  • 8 References
    • Appendix – A : Coding
    • Appendix – B : Snap Shot

Chapter - Background Study The Data Encryption Standard (DES) is an outdated symmetric-key method of data encryption. DES works by using the same key to encrypt and decrypt a message, so both the sender and the receiver must know and use the same private key. Once the go- to, symmetric-key algorithm for the encryption of electronic data, DES has been superseded by the more secure Advanced Encryption Standard (AES) algorithm. Originally designed by researchers at IBM in the early 1970s, DES was adopted by the U.S. government as an official Federal Information Processing Standard (FIPS) in 1977 for the encryption of commercial and sensitive yet unclassified government computer data. It was the first encryption algorithm approved by the U.S. government for public disclosure. This ensured that DES was quickly adopted by industries such as financial services, where the need for strong encryption is high. The simplicity of DES also saw it used in a wide variety of embedded systems, smart cards, SIM cards and network devices requiring encryption like modems, set-top boxes and routers.

Chapter - Problem Definition

To accomplish encryption, most secret key algorithms use two main techniques known as substitution and permutation. Substitution is simply a mapping of one value to another whereas permutation is a reordering of the bit positions for each of the inputs. These techniques are used a number of times in iterations called rounds. Generally, the more rounds there are, the more secure the algorithm. A non-linearity is also introduced into the encryption so that decryption will be computationally infeasible2 without the secret key. This is achieved with the use of S-boxes which are basically non-linear substitution tables where either the output is smaller than the input or vice versa One of the main problems with secret key cryptography is key distribution. For this form of cryptography to work, both parties must have a copy of the secret key. This would have to be communicated over some secure channel which, unfortunately, is not that easy to achieve. As will be seen later, puplic key cryptography provides a solution to this

Chapter - Methodology/Procedure The DES algorithm is the most popular security algorithm. It's a symmetric algorithm, which means that the same keys are used to encrypt/decrypt sensitive data. Key length is 8 byte (64 bit). So, to encrypt/decrypt data, the DES algorithm uses an 8-byte key, but 1 byte (8 bit) for parity checking. It's a block cipher algorithm — that's why the data block size of DES algorithm is 64 bit. To encrypt/decrypt data, the DES algorithm uses the Feistel structure. So, it uses some round to encrypt/decrypt data. Though data block size is 64 bit, the number of rounds will be 16 rounds. So, it will use different subkeys for each round. so the number of subkeys will be 16 subkeys. For more info on the process of finding subkeys, you can learn more here. However, for this tutorial, we will be skipping this part.

Chapter - Results and Discussion The experiments are performed on a Lenovo Laptop with Intel Core i3-4030U CPU running at 1.90GHz, and supported by 8GB of RAM. The algorithm proposed in this paper is implemented using NetBeansIDE-8.2. Crypto module is used for the DES algorithm. The implementation also provides an optional user friendly interface to perform encryption and decryption operations. By selecting various messages an honest evaluation of the algorithm in terms of its efficiency, performance is made possible. We can also give different keys for same message and check whether it is same. Once a key is given to encrypt an image then the decryption must be with same key or else it doesn’t give the result. It is clear that the proposed algorithm can handle any kind of messages.

References [1] Christophe De Canniere, Alex Biryukov and Bart Preneel, “An introduction to block cipher cyrptanalysis,” Proceedings of The IEEE, Vol. 94, No. 2, pp. 346-356,February 2006. [2] W. Diffe and M. Hellman, “Exhaustive cryptanalysis of the NBS Data Encryption Standard,” COMPUTER, Vol. 10, No. 6, pp.74-84, June 1977. [3] M. J. Wiener, “Efficient DES Key Search,” Crypto ’93, Santa Barbara, California, USA, August 1993. Reprinted in Practical Cryptography for Data Internetworks, W. Stallings editor, IEEE Computer Society Press, 1996, pp. 31-

[4] M. Blaze, W. Diffie, R. L. Rivest, B. Schneier, T. Shimomura, E. Thompson, and M. Wiener, “Minimal Key Lengths for Symmetric Ciphers to Provide Adequate Commercial Security,” Technical report, Security Protocols Workshop, Cambridge, UK, January 1996. Available at http://www.counterpane.com/keylength.html. [5] Electronic Frontier Foundation, Cracking DES: Secrets of Encryption Research, Wiretap Politics & Chip Design. O’Reilly & Associates Inc., July

[6] S. Kumar, C. Paar, J. Pelzl, G. Pfeiffer, and M. Schimmler, “Breaking Ciphers with COPACOBANA - A Cost-Optimized Parallel Code Breaker”. In L. Goubin and M. Matsui, editors, Proceedings of the Workshop on Cryptograpic Hardware and Embedded Systems (CHES 2006), volume 4249 of LNCS, pages 101 – 118. Springer-Verlag, 2006. Available at http://www.copacobana.org/paper/copacobana_CHES2006.pdf. [7] National Bureau of Standards, FIPS PUB 46, The Data Encryption Standard, Federal Information Processing Standard, NIST, U.S. Dept. of Commerce, Jan.

[8] B.Schneier, Applied Cryptography, second ed. John Wiley and Sons, 1996

Appendix – A Coding import javax.swing.*; import java.security.SecureRandom; import javax.crypto.Cipher; import javax.crypto.KeyGenerator; import javax.crypto.SecretKey; import javax.crypto.spec.SecretKeySpec; import java.util.Random ; public class DES { byte[] skey = new byte[1000]; String skeyString; static byte[] raw; String inputMessage,encryptedData,decryptedMessage; public DES() { try { generateSymmetricKey(); inputMessage=JOptionPane.showInputDialog(null,"Enter message to encrypt"); byte[] ibyte = inputMessage.getBytes(); byte[] ebyte=encrypt(raw, ibyte); String encryptedData = new String(ebyte); System.out.println("Encrypted message "+encryptedData); JOptionPane.showMessageDialog(null,"Encrypted Data"+"\n"+encryptedData);

private static byte[] getRawKey(byte[] seed) throws Exception { KeyGenerator kgen = KeyGenerator.getInstance("DES"); SecureRandom sr = SecureRandom.getInstance("SHA1PRNG"); sr.setSeed(seed); kgen.init(56, sr); SecretKey skey = kgen.generateKey(); raw = skey.getEncoded(); return raw; } private static byte[] encrypt(byte[] raw, byte[] clear) throws Exception { SecretKeySpec skeySpec = new SecretKeySpec(raw, "DES"); Cipher cipher = Cipher.getInstance("DES"); cipher.init(Cipher.ENCRYPT_MODE, skeySpec); byte[] encrypted = cipher.doFinal(clear); return encrypted; } private static byte[] decrypt(byte[] raw, byte[] encrypted) throws Exception { SecretKeySpec skeySpec = new SecretKeySpec(raw, "DES"); Cipher cipher = Cipher.getInstance("DES"); cipher.init(Cipher.DECRYPT_MODE, skeySpec); byte[] decrypted = cipher.doFinal(encrypted); return decrypted; }

public static void main(String[] args) { DES des = new DES(); } }

And then it will show decrypted message and then click ok again.

This will be shown after the code was successful

THANK YOU