Giter Site home page Giter Site logo

elixir-aes-cmac's Introduction

Hint for users of OTP >= 20

Since OTP 20 the AES-CMAC is in :crypto

You can simply use for example:

:crypto.cmac :"aes_cbc128", <<0x2b7e1516_28aed2a6_abf71588_09cf4f3c::128>>,<<0x6bc1bee2_2e409f96_e93d7e11_7393172a_ae2d8a57_1e03ac9c_9eb76fac_45af8e51_30c81c46_a35ce411::320>>

See in Erlang sources

Aescmac

Implementation of rfc4493 in elixir using :crypto from erlang for aes.

All tests from rfc4493 passing.

Aescmac.aes_cmac takes two binaries, the key and the message, where the key has to be 128bit

Usage example:

#  Aescmac.aes_cmac(key, message)
<<0x070a16b4_6b4d4144_f79bdd9d_d04a287c::128>> = Aescmac.aes_cmac(<<0x2b7e1516_28aed2a6_abf71588_09cf4f3c::128>>,<<0x6bc1bee2_2e409f96_e93d7e11_7393172a::128>>)

Documentation

Docs can be found at hexdocs.pm.

Installation

Available in Hex, the package can be installed with:

  1. Add aescmac to your list of dependencies in mix.exs:
```elixir
def deps do
  [{:aescmac, "~> 0.0.1"}]
end
```
  1. Ensure aescmac is started before your application:
```elixir
def application do
  [applications: [:aescmac]]
end
```

elixir-aes-cmac's People

Contributors

kleinernik avatar h4cc avatar arvidkahl avatar

Watchers

James Cloos 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.