Code Monkey home page Code Monkey logo

eac_logsigner's Introduction

EAC Log Signer

This is a transparent implementation of the Exact Audio Copy log checksum algorithm in Python 3.7+. Includes an option to fix those pesky edited logs.

Installation

Only depends on pprp (for an implementation of Rijndael-256 with variable block sizes):

$ pip install pprp==0.2.6
$ curl https://raw.githubusercontent.com/puddly/eac_logsigner/master/eac.py > eac_logsigner
$ chmod +x eac_logsigner

Usage

usage: eac.py [-h] {verify,sign} ...

Verifies and resigns EAC logs

positional arguments:
  {verify,sign}
    verify       verify a log
    sign         sign or fix an existing log

optional arguments:
  -h, --help     show this help message and exit

Example

$ python3 eac.py sign bad.log good.log
$ python3 eac.py verify *.log
log1.log:  OK
log2.log:  OK
log3.log:  Malformed

Algorithm

  1. Strip the log file of newlines and BOMs.
  2. Cut off the existing signature block and (re-)encode the log text back into little-endian UTF-16
  3. Encrypt the log file with Rijndael-256:
    • in CBC mode
    • with a 256-bit block size (most AES implementations hard-code a 128-bit block size)
    • all-zeroes IV
    • zero-padding
    • the hex key 9378716cf13e4265ae55338e940b376184da389e50647726b35f6f341ee3efd9
  4. XOR together all of the resulting 256-bit ciphertext blocks. You can do it byte-by-byte, it doesn't matter in the end.
  5. Output the little-endian representation of the above number, in uppercase hex.

eac_logsigner's People

Contributors

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