{"id":15446229,"url":"https://github.com/moul/otp","last_synced_at":"2025-05-07T11:24:15.301Z","repository":{"id":66871490,"uuid":"188805660","full_name":"moul/otp","owner":"moul","description":"One-Time Pad utility","archived":false,"fork":false,"pushed_at":"2022-08-23T14:55:01.000Z","size":9,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-01T16:57:05.694Z","etag":null,"topics":["conference","cryptography","one-time-pad","otp","xor"],"latest_commit_sha":null,"homepage":"https://manfred.life/cryptography","language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/moul.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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},"funding":{"github":["moul"],"patreon":"moul","open_collective":"moul","custom":["https://manfred.life/donate"]}},"created_at":"2019-05-27T08:43:03.000Z","updated_at":"2021-04-24T08:18:45.000Z","dependencies_parsed_at":"2023-02-23T10:45:59.030Z","dependency_job_id":null,"html_url":"https://github.com/moul/otp","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moul%2Fotp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moul%2Fotp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moul%2Fotp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moul%2Fotp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/moul","download_url":"https://codeload.github.com/moul/otp/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252866820,"owners_count":21816546,"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":["conference","cryptography","one-time-pad","otp","xor"],"created_at":"2024-10-01T20:00:26.520Z","updated_at":"2025-05-07T11:24:15.272Z","avatar_url":"https://github.com/moul.png","language":"Jupyter Notebook","funding_links":["https://github.com/sponsors/moul","https://patreon.com/moul","https://opencollective.com/moul","https://manfred.life/donate"],"categories":[],"sub_categories":[],"readme":"# otp\n\n[One-Time Pad](https://en.wikipedia.org/wiki/One-time_pad) utility\n\n## Synopsis\n\n    INPUT | otp \u003cpad\u003e\n\n## Description\n\nThe `otp` utility applies the [OTP](https://en.wikipedia.org/wiki/One-time_pad) cipher against the text passed as input with the key passed as argument.\n\nAs for [ROT13](https://en.wikipedia.org/wiki/ROT13), `otp` is its own inverse; that is, to undo `otp`, the same algorithm is applied with the same key.\n\n    $plaintext == $plaintext | otp $key | otp $key\n\n## Usage\n\n```console\n$ cat file.plain | otp \"a-random-string-with-same-the-length-of-the-input-file\" \u003e /path/to/file.encrypted\n```\n\n## Example\n\n```console\n$ echo -n \"hello world!\" | hexdump -C\n00000000  68 65 6c 6c 6f 20 77 6f  72 6c 64 21              |hello world!|\n```\n\n```console\n$ echo -n \"@@@@@@@@@@@@\" | hexdump -C\n00000000  40 40 40 40 40 40 40 40  40 40 40 40              |@@@@@@@@@@@@|\n```\n\n```console\n$ echo -n \"hello world!\" | otp \"@@@@@@@@@@@@\" | hexdump -C\n00000000  28 25 2c 2c 2f 60 37 2f  32 2c 24 61              |(%,,/`7/2,$a|\n```\n\n```console\n$ echo -n \"@@@@@@@@@@@@\" | otp \"hello world!\" | hexdump -C\n00000000  28 25 2c 2c 2f 60 37 2f  32 2c 24 61              |(%,,/`7/2,$a|\n```\n\n```console\n$ echo -n \"hello world!\" | otp \"@@@@@@@@@@@@\" | otp \"@@@@@@@@@@@@\" | hexdump -C\n00000000  68 65 6c 6c 6f 20 77 6f  72 6c 64 21              |hello world!|\n```\n\n```console\n$ echo -n \"hello world!\" | otp \"hello world!\" | hexdump -C\n00000000  00 00 00 00 00 00 00 00  00 00 00 00              |............|\n```\n\n```console\n$ printf \"\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\" | otp \"hello world!\" | hexdump -C\n00000000  68 65 6c 6c 6f 20 77 6f  72 6c 64 21              |hello world!|\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmoul%2Fotp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmoul%2Fotp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmoul%2Fotp/lists"}