{"id":16100805,"url":"https://github.com/pannous/xipher","last_synced_at":"2025-03-17T17:31:22.725Z","repository":{"id":26329618,"uuid":"29778180","full_name":"pannous/xipher","owner":"pannous","description":"🔒 Simple perfect xor encryption cipher 🔒","archived":false,"fork":false,"pushed_at":"2016-11-30T21:16:19.000Z","size":19,"stargazers_count":62,"open_issues_count":0,"forks_count":6,"subscribers_count":9,"default_branch":"master","last_synced_at":"2025-02-28T02:23:26.356Z","etag":null,"topics":["cipher","encrypter","encryption","xor-cipher"],"latest_commit_sha":null,"homepage":"","language":"C","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/pannous.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}},"created_at":"2015-01-24T13:58:50.000Z","updated_at":"2024-03-02T15:06:44.000Z","dependencies_parsed_at":"2022-08-27T16:41:39.729Z","dependency_job_id":null,"html_url":"https://github.com/pannous/xipher","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pannous%2Fxipher","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pannous%2Fxipher/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pannous%2Fxipher/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pannous%2Fxipher/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pannous","download_url":"https://codeload.github.com/pannous/xipher/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243872436,"owners_count":20361480,"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","encrypter","encryption","xor-cipher"],"created_at":"2024-10-09T18:48:15.016Z","updated_at":"2025-03-17T17:31:22.391Z","avatar_url":"https://github.com/pannous.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# xipher 🔐\nA very simple yet powerful [XOR cipher](https://en.wikipedia.org/wiki/XOR_cipher) scheme\n\nWith a 'key' file containing truly random noise, this encryption is unbreakable even in theory.\n\nThe [XOR cipher](https://en.wikipedia.org/wiki/XOR_cipher) is so easy, every computer science student should be able to implement this cipher by heart in a couple of lines! If it is 100% secure and incredibly easy to implement, why isn't the whole world using it?\n\nIt is in fact used all over the world albeit as part of more complicated cypher schemes.\nThe problem with the naïve application of xor is that you lose perfect security if you apply the key too often (more than once).\nAlso for big files you need to have big keys, to avoid or minimize repetition.\n\nThis project contains a very simple Algorithm to mitigate the above limitations.\n\nIn the age of the slow Internet connections, exchanging big keys with your trustees was impractical,\nunless you provided your friends with the key on physical devices. These days you can just create a key which is a couple of megabytes in size and give it to your communication partners, preferably/necessarily using a secure channel/medium like a CD**.\n\n\n\nHere is how it works:\n\nIn your Mac, Linux or Windows shell type:\n\n`git clone https://github.com/pannous/xipher.git`\n\n`cd xipher`\n\n`make`\n\n`./bin/random \u003e key`\n\n`./bin/encrypt README.md key \u003e encrypted`\n\n`./bin/decrypt encrypted key \u003e README.yay`\n\n\nWhy don't we just use the existing encryption mechanisms?\n\nNumber one: **trust**\n\nDo you really feel secure if you use an encryption scheme which you don't understand?\nEven if you have access to the source code: Do you really understand everything that happens in all steps?\nAre you sure that there is no backdoor somewhere?\n\nWith this project you can be perfectly sure:\nLook at the simple source code, understand it and compile yourself.\nAll you need is a truly a random key.\nWhat if you don't trust the random key generator on your computer?\nJust xor the generated key with some other files.\nIf you combine randomness with noise and chaos, you get almost/practically perfect randomness.\n\nNumber two: **fun and insight**\n\nSometimes the topic of encryption can get overwhelming even for people with mathematical background.\nUnderstanding the XOR operation couldn't be any simpler and writing your own encryption feels very empowering.\n\nNumber three: **simplicity**\nThis scheme is arguably even simpler then the usual ssh-keygen/openssl approach.\nYou and your friends can start right away with any arbitrary file as key to get reasonable encryption:\n`./bin/xor README.md any_random_file \u003e reasonably_encrypted`\n`./bin/xor key any_random_file \u003e practically_perfect_key`\n\nExtra: speed\nOnce the key is generated, the encryption and decryption runs in [linear time](https://en.wikipedia.org/wiki/Time_complexity#Linear_time).\n\n\nCAUTION: In its current implementation once the master key is stolen* somehow, then all files encrypted with it can be deciphered.\nThis can easily be mitigated by using several keys, but a better approach is desirable.\nIf your key is too small or if you are using it too often, you may be reducing security.\nHowever for a key of significant size (i.e. 4GB) it is almost infinitely more likely that the key will get stolen then being reverse-engineered.\n\nNOTE: You can increase security significantly if you xor/encrypt zipped files, as they already contain very little structure!\n\nOUTLOOK: This encryption can also be used locally for your own files, if you put the key on a USB stick. And it can be used in the future for peer-to-peer communication applications.\n\n\nPS: * Ideally you would have a little offline device which encrypts every file/keystroke that you make before it reaches your computer.\n\nPS3: ** You can even securly share the key over the internet using [perfect forward encryption](https://en.wikipedia.org/wiki/Forward_secrecy#Perfect_forward_secrecy), for example through extensions of [Diffie Hellman](https://github.com/pannous/Diffie-Hellman). If you trust ssh/scp/sftp these might be appropriate as well.\n\n💡","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpannous%2Fxipher","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpannous%2Fxipher","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpannous%2Fxipher/lists"}