Skip to content

A code generator for a pseudorandom permutation for an esolang.

Notifications You must be signed in to change notification settings

cmounce/give-take

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

A code generator for a pseudorandom permutation for an esolang.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages