{"id":22260788,"url":"https://github.com/hrvadl/security","last_synced_at":"2025-03-25T13:25:51.209Z","repository":{"id":255721967,"uuid":"853209154","full_name":"hrvadl/security","owner":"hrvadl","description":"Security (cryptography) labs","archived":false,"fork":false,"pushed_at":"2024-10-24T13:26:42.000Z","size":64,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-30T12:24:45.514Z","etag":null,"topics":["cipher","cryptography","encryption","encryption-decryption","golang","rsa","security","signature"],"latest_commit_sha":null,"homepage":"","language":"Go","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/hrvadl.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,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-09-06T07:46:56.000Z","updated_at":"2024-10-12T07:10:22.000Z","dependencies_parsed_at":"2024-09-06T21:45:24.034Z","dependency_job_id":"450ecc20-1d01-4a29-a1da-b7749c02b1d8","html_url":"https://github.com/hrvadl/security","commit_stats":null,"previous_names":["hrvadl/security"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hrvadl%2Fsecurity","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hrvadl%2Fsecurity/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hrvadl%2Fsecurity/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hrvadl%2Fsecurity/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hrvadl","download_url":"https://codeload.github.com/hrvadl/security/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245469535,"owners_count":20620606,"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":["cipher","cryptography","encryption","encryption-decryption","golang","rsa","security","signature"],"created_at":"2024-12-03T09:10:00.383Z","updated_at":"2025-03-25T13:25:51.179Z","avatar_url":"https://github.com/hrvadl.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Security (cryptography) labs\n\nThis program can\n\n1. Encrypt/decrypt data using one of the following methods:\n\n   - [Rearrangement](https://github.com/hrvadl/security/blob/master/internal/cryptoalgo/domain/cipher/rearrangement/rearrangement.go) (lab 1).\n   - [Caesar](https://github.com/hrvadl/security/blob/master/internal/cryptoalgo/domain/cipher/ceasar/ceasar.go) (lab 2).\n   - [Gamma](https://github.com/hrvadl/security/blob/master/internal/cryptoalgo/domain/cipher/gamma/cipher.go) (lab 3).\n\n2. [Guess the key](https://github.com/hrvadl/security/blob/master/internal/cryptoalgo/domain/analysis/decrypt.go) for the Cipher encoded data (lab 4).\n3. [Create signature](https://github.com/hrvadl/security/blob/master/internal/sign/domain/sign/signer.go) and verify it using RSA keypair (lab 5).\n\nThe app reads inputs and provides outputs to the files. But it can be easily extended to work with the stdin/stdout.\n\n## Folder structure\n\n- [internal/sign](https://github.com/hrvadl/security/tree/master/internal/sign) contains app logic related for the signing/verifying signature of the file.\n- [internal/cryptoalgo](https://github.com/hrvadl/security/tree/master/internal/cryptoalgo) contains app logic related to the implementing DIY encryption algorithms.\n\n## How to run ciphers?\n\n**NOTE**: Program works correcly only with latin alphabet letters, both uppercase and lowercase. It's not recommended to use\ncyryllic letters or any other symbols.\n\nMake sure you have [taskfile](https://taskfile.dev/) and [Go](https://go.dev/) installed. Then to encrypt/decrypt data using\nCaesar cipher from the root of the repo run:\n\n```sh\ntask encrypt-caesar\n```\n\nIt will look for `in.txt` and `key.txt` files in the `static/cipher/rearrangement` folder, then it will encrypt `in.txt` using `key.txt`\nand create `encrypted.cipher.txt` and `decrypted.cipher.txt`. The `key.txt` should contain only one integer digit which will be used as a key(shift).\nIn example: `echo \"4\" \u003e\u003e key.txt`\n\nTo run a program, which will encrypt/decrypt data using Gamma cipher you can run:\n\n```sh\ntask encrypt-gamma\n```\n\nIt will look for `in.txt` files in the `static/cipher/rearrangement` folder, then it will encrypt `in.txt`\nand create `encrypted.cipher.txt` and `decrypted.cipher.txt`.\n\nTo run a program, which will encrypt/decrypt data using rearrangement cipher you can run:\n\n```sh\ntask encrypt-rearrangement\n```\n\nIt will look for `in.txt` and `key.txt` files in the `static/cipher/rearrangement` folder, then it will encrypt `in.txt` using `key.txt`\nand create `encrypted.cipher.txt` and `decrypted.cipher.txt`. The `key.txt` should contain comma separated integer list with indexes of the\nword. For example, to encrypt word \"Kyiv\" (**four** letter) we should provide list with **four indexes** `echo \"4,3,2,1\" \u003e\u003e key.txt`\n\n## How to create signature?\n\nTo run a program, which will create and verify signature for a given file you can run:\n\n```sh\ntask sign\n```\n\nIt will look for a file named `in.txt` in the `static/sign` folder, then sign it using a newly generated private key and then verify the signature with the\npulic key. Private and public key will be also stored to the file in base64 encoded PEM format. Signed file will store as\na separate file with the `*.signed` suffix.\n\n```sh\n❯ ls static/sign/\nin.txt        in.txt.signed private.key   public.key\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhrvadl%2Fsecurity","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhrvadl%2Fsecurity","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhrvadl%2Fsecurity/lists"}