{"id":25311470,"url":"https://github.com/mttbernardini/mbc","last_synced_at":"2025-07-11T17:42:18.792Z","repository":{"id":54526900,"uuid":"86947170","full_name":"mttbernardini/mbc","owner":"mttbernardini","description":"🔐 Library and CLI for the MBC encryption algorithm. C remake of https://github.com/mttbernardini/mbencrypter.","archived":false,"fork":false,"pushed_at":"2021-02-12T19:55:51.000Z","size":183,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-07T11:38:40.532Z","etag":null,"topics":["algorithm","c-library","cryptography","hex-strings","library","raw-data","symmetric-keys","text"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mttbernardini.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}},"created_at":"2017-04-01T22:40:23.000Z","updated_at":"2021-06-03T20:25:03.000Z","dependencies_parsed_at":"2022-08-13T18:40:44.288Z","dependency_job_id":null,"html_url":"https://github.com/mttbernardini/mbc","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/mttbernardini/mbc","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mttbernardini%2Fmbc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mttbernardini%2Fmbc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mttbernardini%2Fmbc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mttbernardini%2Fmbc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mttbernardini","download_url":"https://codeload.github.com/mttbernardini/mbc/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mttbernardini%2Fmbc/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264863923,"owners_count":23675264,"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":["algorithm","c-library","cryptography","hex-strings","library","raw-data","symmetric-keys","text"],"created_at":"2025-02-13T14:24:56.599Z","updated_at":"2025-07-11T17:42:18.727Z","avatar_url":"https://github.com/mttbernardini.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# MBC - Mattyw \u0026 MeBeiM symmetric encryption algorithm #\n\n[![license][license-img]][license-link]\n[![travis][travis-img]][travis-link]\n[![appveyor][appveyor-img]][appveyor-link]\n[![codecov][codecov-img]][codecov-link]\n\nThis repository provides a C library for the *MBC symmetric encryption algorithm*, plus a parametric CLI program.\n\nThis is a remake of the [mbencrypter][1] project, however the new algorithm is not compatible.\n\n\n## Disclaimer ##\n\nThis is a **work in progress**, backwards compatibility is not guaranteed (have a look at `developing` branch).\n\n**The *MBC symmetric encryption algorithm* shall not be used in any production environment, nor for any kind of cryptographic purposes**, since it's NOT a secure encryption algorithm.\n\nThis software is developed just for fun and educational purposes and is therefore provided \"as is\", without warranty of any kind.\n\n\n## Download ##\n\nClone this repo:\n\n\t$ git clone https://github.com/mttbernardini/mbc.git\n\t$ cd mbc\n\nOr just download one of the available [releases][2].\n\n\n## Building and installation ##\n\nCreate a \"build\" directory and run `cmake` from there:\n\n\t$ mkdir build\n\t$ cd build\n\t$ cmake ..\n\n### Unix systems (Linux, MacOS, Cygwin, etc...) ###\n\nBuild \u0026 install using `make`:\n\n\t$ sudo make install\n\n### Windows (MinGW) ###\n\nBuild \u0026 install using `mingw32-make` from an elevated command prompt:\n\n\t\u003e mingw32-make install\n\n\n## Testing ##\n\nAll tests can be run using `make` (or `mingw32-make` on Windows):\n\n\t$ make mbc_test\n\nOr selective tests can be run:\n\n\t$ make unit_tests\n\t$ ./mbc_unit_tests\n\n\t$ make integration_tests\n\t$ ./mbc_integration_tests\n\nRandom test (only for Unix, requires `bash`):\n\n\t$ make random_test\n\t$ ./mbc_random_test \u003cdata-size\u003e \u003ckey-size\u003e\n\n*NB: `\u003cdata-size\u003e` and `\u003ckey-size\u003e` are mandatory and allow suffixes like `k`, `M`, `G` and so on (refer to `dd` documentation).*\n\n\n## Basic algorithm description ##\n\n1. Bit-Swap encoding, by MeBeiM:\n   - The key is converted into a swap map (see [`/doc/notes.md`][3] for detailed information).\n   - The swap map is reduced to generate the `swap_key`, each byte indicating the position of two bits to swap in each byte of data.\n   - Each byte of data is processed applying the swaps indicated by the `swap_key`.\n\n2. Per-Byte XOR encoding:\n   - If the key is shorter than data, it will be cycled until the end of data.\n   - If data is shorter than the key, it will be cycled until the end of the key.\n   - Each byte of data is XORed with each byte of the key.\n\n\n## Documentation and more ##\n\nAll source files provide descriptive comments above functions prototypes and definitions. A complete documentation will be available in the `/doc` folder along with additional information.\n\n---\n*Copyright © 2017 Matteo Bernardini \u0026 Marco Bonelli.*\n\n[1]: https://github.com/mttbernardini/mbencrypter\n[2]: https://github.com/mttbernardini/mbc/releases\n[3]: https://github.com/mttbernardini/mbc/blob/master/doc/notes.md#make_swap_key-rationale\n\n[license-img]:   https://img.shields.io/github/license/mttbernardini/mbc.svg\n[license-link]:  https://github.com/mttbernardini/mbc/blob/master/LICENSE\n[travis-img]:    https://img.shields.io/travis/mttbernardini/mbc/master.svg\n[travis-link]:   https://travis-ci.org/mttbernardini/mbc\n[appveyor-img]:  https://img.shields.io/appveyor/ci/mttbernardini/mbc/master.svg\n[appveyor-link]: https://ci.appveyor.com/project/mttbernardini/mbc/branch/master\n[codecov-img]:   https://img.shields.io/codecov/c/github/mttbernardini/mbc/master.svg\n[codecov-link]:  https://codecov.io/gh/mttbernardini/mbc/branch/master\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmttbernardini%2Fmbc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmttbernardini%2Fmbc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmttbernardini%2Fmbc/lists"}