Code Monkey home page Code Monkey logo

sm4-xts-openssl's Introduction

Credits

Inspired by https://gist.github.com/ants/862cb941057bdb8db00c72711d2b826c#file-ssl-encrypt-c

I went about making my own tools for verification and testing against the PYCA Cryptography library in Python.

Install

git clone https://github.com/mewmix/sm4-xts-openssl
cd sm4-xts-openssl
make

Usage

SM4(128)

Usage: ./sm4_xts <-e|-d> <SM4_key> <input_text_or_ciphertext>

AES(256)

Usage: ./xts_debug <-e|-d> <AES_key> <input_text_or_ciphertext>

Example

SM4

$ ./sm4_xts_debug -e 68d90424687cc2043595091a78a44ec2c639c3ecc6b14d7ac42ce74e582fa3dc 601cd97ddeb1c75bbe5865072f3dc7a8 686579667269656E64736C657473676574656E6372797074656421
>>SM4 Key (binary): 68d90424687cc2043595091a78a44ec2c639c3ecc6b14d7ac42ce74e582fa3dc
>>IV (binary): 601cd97ddeb1c75bbe5865072f3dc7a8
>>Plaintext (binary): 686579667269656e64736c657473676574656e6372797074656421
>>Ciphertext (hex): 34143fbf6cb3a97feb84f866d85e01f8d15ed03905552cb12cd567
$ ./sm4_xts_debug -d 68d90424687cc2043595091a78a44ec2c639c3ecc6b14d7ac42ce74e582fa3dc 601cd97ddeb1c75bbe5865072f3dc7a8 34143fbf6cb3a97feb84f866d85e01f8d15ed03905552cb12cd567
>>SM4 Key (binary): 68d90424687cc2043595091a78a44ec2c639c3ecc6b14d7ac42ce74e582fa3dc
>>IV (binary): 601cd97ddeb1c75bbe5865072f3dc7a8
>>Decrypted Text: heyfriendsletsgetencrypted!

sm4-xts-openssl's People

Contributors

mewmix avatar

Watchers

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