Giter Site home page Giter Site logo

hedzer / urchin Goto Github PK

View Code? Open in Web Editor NEW
1.0 2.0 0.0 2.75 MB

Urchin is a symmetric n-bit block cipher with extreme disdain for constants.

License: The Unlicense

C# 100.00%
cryptography symmetric-encryption-algorithm symmetric-encryption symmetric-cryptography symmetric-algorithm

urchin's Introduction

Urchin

Urchin is a symmetric n-bit block cipher with extreme disdain for constants.

Disclaimer

This project is not intended for production use. It is a for-fun library built to add to my experiences.

Usage

Simply build and import the library into your project. From there it's as easy as using the provided API. Here is an example:

using Urchin;
Cipher cipher = new Cipher 
{
	Key = key,  // your key
	IV = iv    // your IV (basically a salt)
};
// encrypts a string
byte[] encrypted = cipher.Encrypt("hello");
// decrypts a byte array
byte[] decrypted = cipher.Decrypt(encrypted);
// convert back to string
string original = Encoding.ASCII.GetString(decrypted);
// displays "hello"
Console.WriteLine(original);

What's it for?

It's primarily built for encrypting small snippets of text. A messaging app would be an ideal use case.

How does it behave?

Urchin is slow by design (yeah... sure). It's meant to be difficult to brute force. It has no set number of rounds, block, or words sizes; everything is pseudo-randomly selected. Pseudo-random entropy is created by using existing hash algorithms and hashing recursively. The set of hashes used is shuffled after each round.

During each round a block is broken down into words of a pseudo-randomly selected size and passed through an algorithm that transposes or modifies the bits in that word. The algorithms that transform & transpose are also in a pseudo-random order, and are continuously shuffled.

Regrets

I gave myself a week to do this project, which had originally been postponed for more than a year. I would have liked to have built a Feistel style cipher a la Bruce Schneier's Blowfish. Perhaps a 2.0 version could be worked out in the future.

urchin's People

Contributors

hedzer avatar

Watchers

 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.