{"id":19240780,"url":"https://github.com/yrotak/d-1","last_synced_at":"2025-02-23T14:26:59.882Z","repository":{"id":167858455,"uuid":"260573766","full_name":"yrotak/D-1","owner":"yrotak","description":"D-1 is an open source symmetric encryption algorithm","archived":false,"fork":false,"pushed_at":"2021-09-22T13:30:12.000Z","size":130,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-05T03:08:33.320Z","etag":null,"topics":["crypto","cryptography","d-1","done","encryption","encryption-algorithms","encryption-decryption","symetric-key"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/yrotak.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2020-05-01T22:53:51.000Z","updated_at":"2024-01-20T15:27:11.000Z","dependencies_parsed_at":"2024-01-20T17:50:38.789Z","dependency_job_id":null,"html_url":"https://github.com/yrotak/D-1","commit_stats":null,"previous_names":["drayneur/d-1","yrotak/d-1"],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yrotak%2FD-1","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yrotak%2FD-1/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yrotak%2FD-1/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yrotak%2FD-1/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yrotak","download_url":"https://codeload.github.com/yrotak/D-1/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240326539,"owners_count":19783867,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["crypto","cryptography","d-1","done","encryption","encryption-algorithms","encryption-decryption","symetric-key"],"created_at":"2024-11-09T17:08:59.563Z","updated_at":"2025-02-23T14:26:59.860Z","avatar_url":"https://github.com/yrotak.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# D-1\nD-1 is new open source symetric encryption alghorythm\n\n### Currently supported\n- C#\n- NodeJS\n- JS\n\nIn Future updates i will release the code in php, javascript, java, C#, C++, Python.\n\n### What is the logic behind it ?\n1. We are going to format the key:\n```\nwhile result \u003c 32:\n  for each byte in key:\n    add byte to result\n  reverse result\nreturn Subsequence(result,0,32) //Get only 32 chars\n```\n2. Generate a base alphabet from the plain text\n```\nbasic alphabet = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789\"\nrest = []\nfor each byte in plain:\n  if basic alphabet does not contain byte:\n    add byte to basic alphabet\n    add byte to rest\n    \nreturn rest \u0026 alphabet\n```\n3. We generate 32 base alphabet shifted by each byte of the key\n```\nbasic alphabet = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789\"\n\nif the first byte of key is f then the first alphabet will be\nfghijklmnopqrstuvwxyz0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcde\n```\n4. For each byte in plain we take the byte at the same index in the generated alphabet\n```\nbasic alphabet = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789\"\n\nif the first byte of key is f then the first alphabet will be\nfghijklmnopqrstuvwxyz0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcde\n\nthen if the first byte of plain is B, index is 1 in the basic alphabet so B will be g\n```\n5. In the result we add the rest encoded in base64 (this is for decryption)\n\n\nRESUME:\n```\nkey = TEST\nPlain = HELLO\nEncrypted = AIDEH\n                        E       H         L       O\nBase 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\nKey:           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\n               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\n               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 \n               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\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyrotak%2Fd-1","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyrotak%2Fd-1","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyrotak%2Fd-1/lists"}