Giter Site home page Giter Site logo

you-jay / s-des-simplified-data-encryption-standard-algorithm-in-cpp Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 275 KB

Implementation of Simplified-Data Encryption Standard (S-DES) algorithm using C++

C++ 100.00%
cpp s-des sdes simplified-data-encryption-standard s-des-implementation s-des-algorithm s-des-key-generation-algorithm s-des-cpp sdes-algorithm cryptography

s-des-simplified-data-encryption-standard-algorithm-in-cpp's Introduction

S-DES-Simplified-Data-Encryption-Standard-Algorithm-in-CPP

Simplified Data Encryption Standard (S-DES) is a simple version of the DES Algorithm. It is similar to the DES algorithm but is a smaller algorithm and has fewer parameters than DES. It was made for educational purposes so that understanding DES would become simpler.

Sample Output

Enter 10-bit Master Key (using space)
1 0 0 1 0 0 0 0 0 1 0

KEY GENERATION..

After P10 Permutation: 1 0 0 0 0 0 1 1 0 0 

After split, 
l = 1 0 0 0 0 
r = 0 1 1 0 0 

After LeftShift-1, 
l = 0 0 0 0 1 
r = 1 1 0 0 0 

After P8, Key-1: 1 0 1 0 0 1 0 0 

After LeftShift-2, 
l = 0 0 1 0 0 
r = 0 0 0 1 1 

After P8, Key-2: 0 1 0 0 0 0 1 1 
_____________________________________________________________________________

Enter e for Encryption | Enter d for Decryption | Enter b for Both
b
Enter 8-bit Plain Text (using space)
1 0 0 1 0 1 1 1

ENCRYPTING..

After IP: 0 1 0 1 1 1 0 1 

After split, 
l = 0 1 0 1 
r = 1 1 0 1 

Round Function(fk)-1
After EP: 1 1 1 0 1 0 1 1 

XOR with key
0 1 0 0 1 1 1 1 

After Split
l = 0 1 0 0 
r = 1 1 1 1 

After S-Box: 1 1 1 1 

After P4
1 1 1 1 

XOR with leftarray
1 0 1 0 

After combine
1 0 1 0 1 1 0 1 

After Swap
l = 1 1 0 1 
r = 1 0 1 0 

Round Function(fk)-2
After EP: 0 1 0 1 0 1 0 1 

XOR with key
0 0 0 1 0 1 1 0 

After Split
l = 0 0 0 1 
r = 0 1 1 0 

After S-Box: 1 1 1 1 

After P4
1 1 1 1 

XOR with leftarray
0 0 1 0 

After combine
0 0 1 0 1 0 1 0 

After IP-Inverse, 8-bit Cipher Text is: 
0 0 1 1 1 0 0 0 
_____________________________________________________________________________
IP
0 0 1 0 1 0 1 0 
Split
0 0 1 0 
1 0 1 0 
Round Function(fk)-1
After EP: 0 1 0 1 0 1 0 1 

XOR with key
0 0 0 1 0 1 1 0 

After Split
l = 0 0 0 1 
r = 0 1 1 0 

After S-Box: 1 1 1 1 

After P4
1 1 1 1 

XOR with leftarray
1 1 0 1 

After combine
1 1 0 1 1 0 1 0 

swap
1 0 1 0 
1 1 0 1 
Round Function(fk)-2
After EP: 1 1 1 0 1 0 1 1 

XOR with key
0 1 0 0 1 1 1 1 

After Split
l = 0 1 0 0 
r = 1 1 1 1 

After S-Box: 1 1 1 1 

After P4
1 1 1 1 

XOR with leftarray
0 1 0 1 

After combine
0 1 0 1 1 1 0 1 

After IP-Inverse, 8-bit Plain Text is: 
1 0 0 1 0 1 1 1 

s-des-simplified-data-encryption-standard-algorithm-in-cpp's People

Contributors

you-jay avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.