Code Monkey home page Code Monkey logo

des's Introduction

This code is written in C++ and python.

For simplicity, you can run, ./encode.sh to get a demo encode. The 8 byte plain text is in ./encode/enc0, the 64 bit plain text is in ./encode/enc. The 8 byte encoded cypher text is in ./encode/ans0, the 64 bit encoded cypher text is in ./encode/ans.

You can run ./decode.sh to get a demo decode The 8 byte cypher text is in ./decode/dec0, the 64 bit cypher text is in ./decode/dec. The 8 byte decoded plain text is in ./decode/ans0, the 64 bit decoded plain text is in ./decode/ans.

Details:

%-----------------------------------------------------------------

Encoding: all example I/O files are in directory "encode"

%-----------------------------------------------------------------

  1. If your inputs are 8-byte askii code: You should build a file named "enc0" Format: key: 8-byte key plain text: 8-byte text Example file in ./encode/enc0 and run python a2b.py < ./encode/enc0 The output is a file named "enc" Format: key: 64-bit key plain text: 64-bit text Example file in ./encode/enc

  2. If your inputs are 64-bit binary code: You should build a file named "enc", the format is the same as the output of step 1. Example file in ./encode/enc

  3. run make Then run ./DES --mode enc --file ./encode/enc The output file is named "ans": Format: key: 64-bit key cypher: 64-bit text Example file in ./encode/ans

  4. If you want to get a 8-byte cypher text, run python b2a.py < ./encode/ans The output file is named "ans0" Format: key: 8-byte key cypher: 8-byte text Example file in ./encode/ans0

Step 3 and 4 get the file with the encoded cypher.

%-----------------------------------------------------------------

Decoding: all example I/O files are in directory "decode"

%-----------------------------------------------------------------

  1. If your inputs are 8-byte askii code: You should build a file named "dec0" Format: key: 8-byte key cypher: 8-byte text Example file in ./decode/dec0 and run python a2b.py < ./decode/dec0 The output is a file named "dec" Format: key: 64-bit key cypher: 64-bit text Example file in ./decode/dec

  2. If your inputs are 64-bit binary code: You should build a file named "dec", the format is the same as the output of step 1. Example file in ./decode/dec

  3. run make Then run ./DES --mode dec --file ./decode/dec The output file is named "ans": Format: key: 64-bit key plain text: 64-bit text Example file in ./decode/ans

  4. If you want to get a 8-byte cypher text, run python b2a.py < ./decode/ans The output file is named "ans0" Format: key: 8-byte key plain text: 8-byte text Example file in ./decode/ans0

Step 3 and 4 get the file with the decoded plain text.

des's People

Contributors

huangjingxian 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.