{"id":16002979,"url":"https://github.com/soreing/des-cpp-encrypt","last_synced_at":"2025-04-05T01:26:23.343Z","repository":{"id":110409734,"uuid":"392624909","full_name":"Soreing/des-cpp-encrypt","owner":"Soreing","description":"Simple DES encryption library for C++","archived":false,"fork":false,"pushed_at":"2021-08-08T18:39:52.000Z","size":5,"stargazers_count":3,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-10T09:43:56.278Z","etag":null,"topics":["cpp","cryptography","des"],"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/Soreing.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":"2021-08-04T09:18:24.000Z","updated_at":"2023-12-21T01:40:40.000Z","dependencies_parsed_at":null,"dependency_job_id":"2cd27deb-bb6e-40e0-84ad-3e4d8c93fed2","html_url":"https://github.com/Soreing/des-cpp-encrypt","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/Soreing%2Fdes-cpp-encrypt","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Soreing%2Fdes-cpp-encrypt/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Soreing%2Fdes-cpp-encrypt/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Soreing%2Fdes-cpp-encrypt/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Soreing","download_url":"https://codeload.github.com/Soreing/des-cpp-encrypt/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247274178,"owners_count":20912062,"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":["cpp","cryptography","des"],"created_at":"2024-10-08T10:05:25.363Z","updated_at":"2025-04-05T01:26:23.323Z","avatar_url":"https://github.com/Soreing.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# des-cpp-encrypt\n\n# Description\n\ndes-cpp-encrypt is a simple C++ library for generating DES keys and encrypting or decrypting data. Encryption is only implemented for 1 block of data. If you want to encrypt more than 8 bytes, you will need to implement different modes of operation, like des-ecb.\n\n# Installation\nInclude `DES.h` in your project for defining the functions. If you want to compile the library from source, include the cpp file  `DES.cpp` for the implementation. Alternatively, you can compile the source code to a static library and include it that way.\n\n# Usage\n\n## Creating Keys\nTo create round keys, you need a character array of 8 bytes. The `DES_CreateKeys` function will create 16 round keys based on your input key, which is stored as a `[16][8]` 2D character array.\n```c++\nchar key[8] = {0xAA,0xBB,0x09,0x18,0x27,0x36,0xCC,0xDD};\nchar roundKeys[16][8];\n\nDES_CreateKeys(key, roundKeys);\n\n```\n\n## Encryption\nAfter you generated the round keys, you can encrypt some data. You need to provide this data in the form of a character array of 8 bytes. The result is stored in an 8 byte large buffer you also need to provide.\n**The buffer MUST be initialized to 0**\n```c++\nchar plainText[8]  = {'T','e','s','t','D','a','t','a'};\nchar cipherText[8] = {0,0,0,0,0,0,0,0};\n\nDES_Encrypt(plainText, roundKeys, cipherText);\n```\n\n## Decryption\nTo Decrypt the ciphertext, you need to perform similar steps to encryption. You need to have the round keys, and you need to have an 8 byte ciphertext, and the result is stored in an 8 byte buffer.\n**The buffer MUST be initialized to 0**\n```c++\n// 1 Extra character for the null terminator\nchar original[9] = {0,0,0,0,0,0,0,0,0};\nDES_Decrypt(cipherText, roundKeys, original);\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsoreing%2Fdes-cpp-encrypt","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsoreing%2Fdes-cpp-encrypt","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsoreing%2Fdes-cpp-encrypt/lists"}