Giter VIP home page Giter VIP logo

ciphyor's Introduction

Ciphyor Social Banner

Ciphyor

What's it?

A Java implementation of my own encryption algorithm inspired by Vernam one

How does it work ?

Encryption

  • You enter two String: a key and a message
  • The message is encoded in base32 (using Guava)
  • The key is hashed into a SHA-3 (515 bits) hash that we will call h1 (it's an int)
  • A pseudo random number called salt is generated according to a small algorithm which confers a property: once added to h1 the result is necessarily between Integer.MIN_VALUE and Integer.MAX_VALUE (included)
  • The result of salt and h1 addition is hashed into another SHA-3 (515 bits) hash that we will call h2 (it's still an int)
  • A random generator is initialized with h2
  • It will generate a sequence of numbers used to shift the characters of the base32 of the initial message into the alphabet.

Example : The base32 alphabet contains letters + numbers so there are 36 characters. If we want to shift the letter C of 25 (the third letter in the alphabet), we add 25 to 3 and we get 28. The twenty eighth letter of the alphabet is 1 (25 is Y, 26 is Z, 27 is 0, etc). If the result is not into the alphabet (for example 38), we substract 36 to it (so it's 2)

  • We cipher the sal's base32 using a random generator initialized with h1
  • A String which contains ciphered sal + ciphered message is returned

Decipherment

  • You enter two String: a key and a ciphered message
  • The ciphered sal is separated from the rest of the ciphered message
  • To decipher the sal, the same principle is used as for encrypting but subtracting the numbers generated by the pseudo-random generator initialized with the key rather than adding them
  • The seed is got using the deciphered sal and the key
  • The rest of the message is deciphered using the same method but with the seed
  • The message is decoded from base32 (using Guava)
  • A String which contains the deciphered message is returned

Download

Here you can download the latest release: https://github.com/Th0rgal/Ciphyor/releases

ciphyor's People

Contributors

th0rgal avatar

Stargazers

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