SlideShare una empresa de Scribd logo
1 de 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

Más contenido relacionado

Similar a 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 a 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
 

Último

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
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
ciinovamais
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
heathfieldcps1
 
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
 

Último (20)

Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impact
 
Disha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfDisha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdf
 
Student login on Anyboli platform.helpin
Student login on Anyboli platform.helpinStudent login on Anyboli platform.helpin
Student login on Anyboli platform.helpin
 
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
 
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"
 
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
 
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
 
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
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
Advance Mobile Application Development class 07
Advance Mobile Application Development class 07Advance Mobile Application Development class 07
Advance Mobile Application Development class 07
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot Graph
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communication
 
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
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy Reform
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 
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
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SD
 
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...
 

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 :