GithubHelp home page GithubHelp logo

michpro / xtea-cipher Goto Github PK

View Code? Open in Web Editor NEW
2.0 1.0 1.0 17 KB

XTEA cipher library, with MAC support, for the Arduino environment.

License: MIT License

C++ 50.01% C 49.99%
arduino arduino-library encryption cipher cipher-algorithms mac message-authentication-code decryption iot cryptography cryptography-library hash xtea-cipher

xtea-cipher's Introduction

Arduino CI Arduino-lint GitHub release

XTEA-Cipher library for Arduino

XTEA cipher library with MAC code calculation support for Arduino environment. Supported encryption modes are: ECB, CFB and OCB and for generating message authentication codes is CFB-MAC. 'C' code of this library was optimized for lowest possible use of program memory. Contrary to reference implementation, base data type is uint8_t[] instead of uint32_t.


Constants

Configure library settings in file xtea.h, or better in your sketch, by adding directive #define XTEA_ROUNDS n or/and #define XTEA_MAC_ROUNDS n before directive including this cipher library e.g.:

...
#define XTEA_ROUNDS 48
#define XTEA_MAC_ROUNDS 24

#include "XTEA-Cipher.h"
...
  • XTEA_ROUNDS

    actual number of Feistel rounds during cipher is 2 * XTEA_ROUNDS

    [default value is 32]

  • XTEA_MAC_ROUNDS

    actual number of Feistel rounds during MAC calculation is 2 * XTEA_MAC_ROUNDS

    [default value is 32]


    known attack is on 36 Feistel rounds (18 XTEA_ROUNDS or XTEA_MAC_ROUNDS)

  • XTEA_BLOCK_SIZE

    data block size = 64-bit [8 bytes]

    [Do NOT change its value]

  • XTEA_IV_SIZE

    size of initialization vector [IV] (a.k.a. NONCE) = 64-bit [8 bytes]

    [Do NOT change its value]

  • XTEA_KEY_SIZE

    key size = 128-bit [16 bytes]

    [Do NOT change its value]


Library Content

Read the source code for details.


Examples

  • XTEA Test 'C' style

    Sketch shows examples of calling 'C' code functions and validating them with test vectors.

  • XTEA Test Arduino style

    This sketch shows examples of calling methods of a c++ class and validating them with test vectors.


Installation Guide

Arduino IDE - Additional libraries installation guide.


Reporting bugs

Create an issue on GitHub.


License

Copyright © 2020-2021 Michal Protasowicki

Source: https://github.com/michpro/XTEA-Cipher

This project is released under MIT License.

License: MIT

Support

If You find my projects interesting and You wanted to support my work, You can give me a cup of coffee or a keg of beer :)

PayPal Direct     ko-fi     Coinbase

xtea-cipher's People

Contributors

michpro avatar

Stargazers

 avatar  avatar

Watchers

 avatar

Forkers

cdragos573

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.