Git Product home page Git Product logo

d-1's Introduction

D-1

D-1 is new open source symetric encryption alghorythm

Currently supported

  • C#
  • NodeJS
  • JS

In Future updates i will release the code in php, javascript, java, C#, C++, Python.

What is the logic behind it ?

  1. We are going to format the key:
while result < 32:
  for each byte in key:
    add byte to result
  reverse result
return Subsequence(result,0,32) //Get only 32 chars
  1. Generate a base alphabet from the plain text
basic alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"
rest = []
for each byte in plain:
  if basic alphabet does not contain byte:
    add byte to basic alphabet
    add byte to rest
    
return rest & alphabet
  1. We generate 32 base alphabet shifted by each byte of the key
basic alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"

if the first byte of key is f then the first alphabet will be
fghijklmnopqrstuvwxyz0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcde
  1. For each byte in plain we take the byte at the same index in the generated alphabet
basic alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"

if the first byte of key is f then the first alphabet will be
fghijklmnopqrstuvwxyz0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcde

then if the first byte of plain is B, index is 1 in the basic alphabet so B will be g
  1. In the result we add the rest encoded in base64 (this is for decryption)

RESUME:

key = TEST
Plain = HELLO
Encrypted = AIDEH
                        E       H         L       O
Base alphabet: A B C D [E] F G [H] I J K [L] M N [O] P Q R S T U V W X Y Z
Key:           T U V W  X  Y Z [A] B C D  E  F G [H] I J K L M N O P Q R S
               E F G H [I] J K  L  M N O  P  Q R  S  T U V W X Y Z A B C D
               S T U V  W  X Y  Z  A B C [D] E F  G  H I J K L M N O P Q R 
               T U V W  X  Y Z  A  B C D [E] F G  H  I J K L M N O P Q R S

d-1's People

Contributors

yrotak avatar

Stargazers

 avatar

Watchers

 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.