{"id":27024723,"url":"https://github.com/ismaelsadeeq/crypto-utils","last_synced_at":"2025-04-04T21:30:02.933Z","repository":{"id":278589955,"uuid":"936121345","full_name":"ismaelsadeeq/crypto-utils","owner":"ismaelsadeeq","description":null,"archived":false,"fork":false,"pushed_at":"2025-02-20T15:27:18.000Z","size":4,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-20T16:28:42.227Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/ismaelsadeeq.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":"2025-02-20T15:05:33.000Z","updated_at":"2025-02-20T15:27:21.000Z","dependencies_parsed_at":"2025-02-20T16:28:45.416Z","dependency_job_id":"2bf853fa-6e13-4a36-a8a7-bf5a36e22acc","html_url":"https://github.com/ismaelsadeeq/crypto-utils","commit_stats":null,"previous_names":["ismaelsadeeq/crypto-utils"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ismaelsadeeq%2Fcrypto-utils","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ismaelsadeeq%2Fcrypto-utils/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ismaelsadeeq%2Fcrypto-utils/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ismaelsadeeq%2Fcrypto-utils/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ismaelsadeeq","download_url":"https://codeload.github.com/ismaelsadeeq/crypto-utils/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247251835,"owners_count":20908582,"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":[],"created_at":"2025-04-04T21:30:02.204Z","updated_at":"2025-04-04T21:30:02.916Z","avatar_url":"https://github.com/ismaelsadeeq.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"### This repository contains cryptography utility functions.  \n\n#### **random.h**  \n\nThis file includes the function `GenerateCryptographicallySecureRandomNumber`, which generates random bytes.\n\nCurrently supported platforms are **Linux** and **Apple**. The entropy level of this random bytes depends on the machine; if the machine has high entropy, the generated bytes will also have high entropy.\n\nThe method uses `/dev/urandom` which is assumed to be cryptographically secure.\n\n##### **Usage:**  \nTo use this function, include `crypto-utils/random.h`.  \n\n```cpp\n#include \"crypto-utils/random.h\"\n\nsize_t num_bytes = 16;  \nstd::vector\u003cunsigned char\u003e random_bytes = GenerateCryptographicallySecureRandomNumber(num_bytes);\n```\n\nThe function `GenerateCryptographicallySecureRandomNumber` takes a single parameter of type `size_t`, which specifies the number of random bytes to generate.  \n\nIt returns a `std::vector\u003cunsigned char\u003e` containing the generated random bytes as elements in the vector.  \n\n---\n\n### **hex.h**  \n\nThis file contains two functions:  \n\n- `to_hex`: Takes a `std::vector\u003cunsigned char\u003e` and returns its hexadecimal string representation.  \n- `from_hex`: Takes a hexadecimal string and converts it into a `std::vector\u003cunsigned char\u003e`.  \n\n##### **Usage:**  \nTo use these functions, include `crypto-utils/hex.h`.  \n\n```cpp\n#include \"crypto-utils/hex.h\"\n\nstd::string msg(\"hi\");\nstd::vector\u003cunsigned char\u003e data(msg.begin(), message.end());  \nstd::string hex_string = to_hex(data);  \n\nstd::vector\u003cunsigned char\u003e decoded_data = from_hex(hex_string);  \n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fismaelsadeeq%2Fcrypto-utils","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fismaelsadeeq%2Fcrypto-utils","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fismaelsadeeq%2Fcrypto-utils/lists"}