Code Monkey home page Code Monkey logo

give-take's Introduction

GiveTake is a 30-bit-wide keyed pseudorandom permutation, designed for efficient implementation in the ZZT-OOP scripting language.

If that's confusing, think of it like a cipher that encrypts 30-bit messages. A 30-bit number goes in, plus an encryption key, and some other 30-bit number comes out.

Running ./generate.rb 'some arbitrary key' will generate ZZT-OOP code for computing GiveTake, with the given key baked into the generated code. Note that although GiveTake is invertible, ./generate.rb only generates code for the forward permutation.

GiveTake gets its name from ZZT-OOP's math instructions: the language was never meant to do any heavy numerical work, so it only has two math commands: #give (addition) and #take (subtract-or-branch).

I make no claim that GiveTake is secure. In fact, I will claim the opposite! 30 bits is ridiculously small, which raises the danger of statistical attacks. The exact danger depends on how you use it, of course, but you should really use something different if you're doing anything serious.

However, if your use case is something silly (e.g., generating game passwords), and an attacker would have an easier way in than cryptanalysis (e.g., reverse-engineering your code), then GiveTake might not be the weakest link in your chain of security.

give-take's People

Contributors

cmounce avatar

Watchers

James Cloos avatar  avatar Kristofer Munsterhjelm 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.