SlideShare a Scribd company logo
1 of 8
(DES)Data Encryption Standard:
A block cipher processes the plaintext
input in fixed-sized blocks and produces a
block of cipher text of equal size for each
plaintext block
The plaintext is 64 bits in length and the key
(k) is 56 bits in length (16 rounds of
processing (16 sub keys (k (left shift to k1)
k1…..k16 are generated for each round
based on left shift)

The plaintext block is divided into two
halves, LE0 and RE0. The two halves of the
data pass through 16 rounds of processing
and then combine to produce the cipher
text block.
A substitution is performed on the left half
of the data. This is done by applying a
round function F(left circular shift shuffles
the input block) to the right half of the data
and then taking the exclusive-OR (XOR) of
the output of that function and the left half
of the data.
Permutation is performed that consists of
the interchange of the two halves of the
data.
Implemtation of simple DES
            Algorithm
Program:
import java.security.*; // Java Security
Packages There are three security-
related packages in java 1. JCA/JCE
(Java Cryptography Architecture & Java
Cryptography Extensions) 2. JSSE( Java
Secure-Sockets Extension). 3. JAAS( Java
Authentication & Authorization Service)
import javax.crypto.*; // Provides the
classes and interfaces for cryptographic
operations. Operation include
encryption, key generation and key
agreement, and Message Authentication
Code (MAC) generation.
public class PrivateExample
{
public static void main(String[] args)
throws Exception
{
if (args.length != 1)
{
System.err.println("Usage:Java
PrivateExample text");
System.exit(1);
}
byte[] plainText =
args[0].getBytes("UTF8"); /* 8-bit
Unicode Transformation Format */
System.out.println("n start generating
DES key");
KeyGenerator KeyGen =
KeyGenerator.getInstance("DES");
KeyGen.init(56);
Key key= KeyGen.generateKey();
System.out.println("n finish generating
DES key");
Cipher cipher=
Cipher.getInstance("DES/ECB/PKCS5Pa
dding");//electronic code book : public
key crypto standard 5
System.out.println("n"+cipher.getProvid
er().getInfo());
System.out.println("n start encryption ");
cipher.init(Cipher.ENCRYPT_MODE,ke
y);
byte[] cipherText =
cipher.doFinal(plainText);
System.out.println("Finish Encryption");
System.out.println(new
String(cipherText,"UTF8"));
System.out.println("n Start
Decryption");
cipher.init(Cipher.DECRYPT_MODE,ke
y);
byte[] newPlainText =
cipher.doFinal(cipherText);
System.out.println("Final decryption");
System.out.println(new
String(newPlainText, "UTF8"));
}
}
Output :
Des1
Des1

More Related Content

Similar to Des1

A General Session Based Bit Level Block Encoding Technique Using Symmetric Ke...
A General Session Based Bit Level Block Encoding Technique Using Symmetric Ke...A General Session Based Bit Level Block Encoding Technique Using Symmetric Ke...
A General Session Based Bit Level Block Encoding Technique Using Symmetric Ke...
ijcseit
 

Similar to Des1 (20)

icwet1097
icwet1097icwet1097
icwet1097
 
New modification on feistel DES algorithm based on multi-level keys
New modification on feistel DES algorithm based on  multi-level keys New modification on feistel DES algorithm based on  multi-level keys
New modification on feistel DES algorithm based on multi-level keys
 
AES effecitve software implementation
AES effecitve software implementationAES effecitve software implementation
AES effecitve software implementation
 
Comparison of AES and DES Algorithms Implemented on Virtex-6 FPGA and Microbl...
Comparison of AES and DES Algorithms Implemented on Virtex-6 FPGA and Microbl...Comparison of AES and DES Algorithms Implemented on Virtex-6 FPGA and Microbl...
Comparison of AES and DES Algorithms Implemented on Virtex-6 FPGA and Microbl...
 
Network Security UNIT-II
Network Security UNIT-IINetwork Security UNIT-II
Network Security UNIT-II
 
Next generation block ciphers
Next generation block ciphersNext generation block ciphers
Next generation block ciphers
 
Computer security module 2
Computer security module 2Computer security module 2
Computer security module 2
 
Network security R.Rathna Deepa 2nd M.sc.,Computer Science
Network security R.Rathna Deepa 2nd M.sc.,Computer ScienceNetwork security R.Rathna Deepa 2nd M.sc.,Computer Science
Network security R.Rathna Deepa 2nd M.sc.,Computer Science
 
Unit 2
Unit 2Unit 2
Unit 2
 
Aes 128 192_256_bits_project_report
Aes 128 192_256_bits_project_reportAes 128 192_256_bits_project_report
Aes 128 192_256_bits_project_report
 
Chapter 3-block-cipher-des1
Chapter 3-block-cipher-des1Chapter 3-block-cipher-des1
Chapter 3-block-cipher-des1
 
FPGA Implementation of Mix and Inverse Mix Column for AES Algorithm
FPGA Implementation of Mix and Inverse Mix Column for AES AlgorithmFPGA Implementation of Mix and Inverse Mix Column for AES Algorithm
FPGA Implementation of Mix and Inverse Mix Column for AES Algorithm
 
Using Cipher Key to Generate Dynamic S-Box in AES Cipher System
Using Cipher Key to Generate Dynamic S-Box in AES Cipher SystemUsing Cipher Key to Generate Dynamic S-Box in AES Cipher System
Using Cipher Key to Generate Dynamic S-Box in AES Cipher System
 
Implementation of Various Cryptosystem Using Chaos
Implementation of Various Cryptosystem Using ChaosImplementation of Various Cryptosystem Using Chaos
Implementation of Various Cryptosystem Using Chaos
 
A General Session Based Bit Level Block Encoding Technique Using Symmetric Ke...
A General Session Based Bit Level Block Encoding Technique Using Symmetric Ke...A General Session Based Bit Level Block Encoding Technique Using Symmetric Ke...
A General Session Based Bit Level Block Encoding Technique Using Symmetric Ke...
 
Security Analysis of AES and Enhancing its Security by Modifying S-Box with a...
Security Analysis of AES and Enhancing its Security by Modifying S-Box with a...Security Analysis of AES and Enhancing its Security by Modifying S-Box with a...
Security Analysis of AES and Enhancing its Security by Modifying S-Box with a...
 
Java implementation and performance evaluation of some
Java implementation and performance evaluation of someJava implementation and performance evaluation of some
Java implementation and performance evaluation of some
 
Unit 2
Unit  2Unit  2
Unit 2
 
Renas Rajab Asaad
Renas Rajab AsaadRenas Rajab Asaad
Renas Rajab Asaad
 
Aes
AesAes
Aes
 

Recently uploaded

Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Krashi Coaching
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
QucHHunhnh
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
PECB
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
SoniaTolstoy
 

Recently uploaded (20)

Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3
 
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..
 
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdf
 
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
 
Advance Mobile Application Development class 07
Advance Mobile Application Development class 07Advance Mobile Application Development class 07
Advance Mobile Application Development class 07
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
 
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptxINDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
 
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across Sectors
 

Des1

  • 1. (DES)Data Encryption Standard: A block cipher processes the plaintext input in fixed-sized blocks and produces a block of cipher text of equal size for each plaintext block The plaintext is 64 bits in length and the key (k) is 56 bits in length (16 rounds of processing (16 sub keys (k (left shift to k1) k1…..k16 are generated for each round based on left shift) The plaintext block is divided into two halves, LE0 and RE0. The two halves of the data pass through 16 rounds of processing and then combine to produce the cipher text block. A substitution is performed on the left half of the data. This is done by applying a round function F(left circular shift shuffles the input block) to the right half of the data and then taking the exclusive-OR (XOR) of
  • 2. the output of that function and the left half of the data. Permutation is performed that consists of the interchange of the two halves of the data.
  • 3. Implemtation of simple DES Algorithm Program: import java.security.*; // Java Security Packages There are three security- related packages in java 1. JCA/JCE (Java Cryptography Architecture & Java Cryptography Extensions) 2. JSSE( Java Secure-Sockets Extension). 3. JAAS( Java Authentication & Authorization Service) import javax.crypto.*; // Provides the classes and interfaces for cryptographic operations. Operation include encryption, key generation and key agreement, and Message Authentication Code (MAC) generation. public class PrivateExample
  • 4. { public static void main(String[] args) throws Exception { if (args.length != 1) { System.err.println("Usage:Java PrivateExample text"); System.exit(1); } byte[] plainText = args[0].getBytes("UTF8"); /* 8-bit Unicode Transformation Format */ System.out.println("n start generating DES key"); KeyGenerator KeyGen = KeyGenerator.getInstance("DES"); KeyGen.init(56); Key key= KeyGen.generateKey();
  • 5. System.out.println("n finish generating DES key"); Cipher cipher= Cipher.getInstance("DES/ECB/PKCS5Pa dding");//electronic code book : public key crypto standard 5 System.out.println("n"+cipher.getProvid er().getInfo()); System.out.println("n start encryption "); cipher.init(Cipher.ENCRYPT_MODE,ke y); byte[] cipherText = cipher.doFinal(plainText); System.out.println("Finish Encryption"); System.out.println(new String(cipherText,"UTF8")); System.out.println("n Start Decryption"); cipher.init(Cipher.DECRYPT_MODE,ke y);
  • 6. byte[] newPlainText = cipher.doFinal(cipherText); System.out.println("Final decryption"); System.out.println(new String(newPlainText, "UTF8")); } } Output :