{"id":20990547,"url":"https://github.com/offa/keygen","last_synced_at":"2025-05-14T20:31:38.241Z","repository":{"id":22202435,"uuid":"25534929","full_name":"offa/keygen","owner":"offa","description":"KeyGen is a generator for keys and passwords.","archived":false,"fork":false,"pushed_at":"2024-11-15T15:09:28.000Z","size":791,"stargazers_count":17,"open_issues_count":0,"forks_count":5,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-11-15T16:21:59.514Z","etag":null,"topics":["c","c11","cmake","key-generator","openssl","password-generator","security"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/offa.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2014-10-21T17:08:01.000Z","updated_at":"2024-11-15T15:09:29.000Z","dependencies_parsed_at":"2023-11-07T16:39:52.595Z","dependency_job_id":"67428190-2c02-4759-b793-16224ee4484a","html_url":"https://github.com/offa/keygen","commit_stats":null,"previous_names":[],"tags_count":29,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/offa%2Fkeygen","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/offa%2Fkeygen/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/offa%2Fkeygen/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/offa%2Fkeygen/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/offa","download_url":"https://codeload.github.com/offa/keygen/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225308338,"owners_count":17453983,"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":["c","c11","cmake","key-generator","openssl","password-generator","security"],"created_at":"2024-11-19T06:34:09.251Z","updated_at":"2024-11-19T06:34:10.028Z","avatar_url":"https://github.com/offa.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# [KeyGen](https://github.com/offa/keygen)\n\n[![CI](https://github.com/offa/keygen/workflows/ci/badge.svg)](https://github.com/offa/keygen/actions)\n[![GitHub release](https://img.shields.io/github/release/offa/keygen.svg)](https://github.com/offa/keygen/releases)\n[![License](https://img.shields.io/badge/license-GPLv3-yellow.svg)](LICENSE)\n![C](https://img.shields.io/badge/c-11-green.svg)\n\nKeyGen is a generator for keys and passwords. It's usable as standalone application and library.\n\nThe cryptography behind is provided by *OpenSSL*.\n\n## Requirements\n\n - [**OpenSSL**](https://www.openssl.org/)\n\n\n## Building\n\nBuilding the library and application:\n\n    mkdir build\n    cd build\n    cmake ..\n    make\n\n\n## Testing\n\nAfter building, the tests are executed within the build directory using:\n\n    ctest\n\nor running `make` with one of these targets:\n\nmake        | \u003c target \u003e\n----------- | -------------------------------\n`test`      | Runs ctest (same as `ctest`)\n`unittest`  | Builds and  runs all test\n`coverage`  | Coverage (requires [gcovr](https://github.com/gcovr/gcovr))\n\n## Usage\n\nThe unit of length are (ascii-) characters (1 char = 1 byte). So a length of 20 means 20 (ascii-) char's = 20 Byte.\n\n### Application\n\nThe application is used with commandline arguments. Run `keygen -h` to print the help.\n\n#### Arguments:\n\n```\n Usage: keygen [Options]\n\n  --ascii   -a :  Generates a key of ASCII characters, ranging from '!' to'~' (default)\n  --ascii-blank -w :  Generates a key of ASCII characters, ranging from ' ' to'~';\n                      same as --ascii, but includes blanks\n  --ascii-reduced   -r :  Generates a key of reduced ASCII\n  --alphanum    -p :  Generates a key of alphanumeric characters\n  --length \u003cn\u003e  -l \u003cn\u003e :  Generates a key of \u003cn\u003e bytes length\n  --short   -s :  Shows only the key\n  --help    -h :  Shows the help\n  --version -v :  Shows version informations and license.\n```\n\n**Note:** For generating, the `--length` / `-l` parameter is *always* necessary.\n\n#### Examples\n\nKey of 24 length:\n\n    $ keygen -l 20\n\n      Generated key:\n    ----------\n    amZ5QiX\u003e9Z-=4U.XP;bD\n    ----------\n      Length : 20 / 20\n\nthis is equal to `keygen --ascii -l 20` and `keygen -a -l 20`.\n\nThe same key size, but with short (key only) output:\n\n    $ keygen -s -l 20\n    ZI^fD{dX\u003cqa?uw?%'acM\n\n\nKey of 4048 length, stored in a file:\n\n    $ keygen --short --length 4048 \u003e example.key\n\n*(Use `--short` / `-s` to write key only)*\n\n\n### Library\n\n```c\nconst int KEY_LENGTH = 100000; // Key length\nuint8_t* buffer = malloc(KEY_LENGTH * sizeof(uint8_t)); // allocate buffer\n\nif( buffer == NULL )\n{\n    // Error - malloc() failed\n}\nelse\n{\n    KeyGenError err = keygen_createKey(buffer, KEY_LENGTH, ASCII);\n\n    if( err == KG_ERR_SUCCESS )\n    {\n        // Key generated, do something\n    }\n    else\n    {\n        // Error - handle that case\n    }\n\n    // Finally clean and free the buffer\n    keygen_cleanAndFreeBuffer(buffer, length);\n}\n```\n\n## Notes\n\n - The keylength is set to a minimum of 8 - lesser length is not allowed\n - Using parameter `-s` / `--short` will reduce the output to key only\n\n## Documentation\n\n - [OpenSSL](https://www.openssl.org/)\n - [OpenSSL Wiki](http://wiki.openssl.org/index.php/Main_Page)\n\n## License\n\n**GNU General Public License (GPL)**\n\n    This program is free software: you can redistribute it and/or modify\n    it under the terms of the GNU General Public License as published by\n    the Free Software Foundation, either version 3 of the License, or\n    (at your option) any later version.\n\n    This program is distributed in the hope that it will be useful,\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n    GNU General Public License for more details.\n\n    You should have received a copy of the GNU General Public License\n    along with this program.  If not, see \u003chttp://www.gnu.org/licenses/\u003e.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foffa%2Fkeygen","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Foffa%2Fkeygen","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foffa%2Fkeygen/lists"}