{"id":49353759,"url":"https://github.com/leventkaragol/libcpp-crypto","last_synced_at":"2026-04-27T11:32:12.795Z","repository":{"id":234554128,"uuid":"789132377","full_name":"leventkaragol/libcpp-crypto","owner":"leventkaragol","description":"Easy-to-use, symmetric (AES-256) and asymmetric (RSA) encryption and also hash (SHA-256) library for C++ (17+)","archived":false,"fork":false,"pushed_at":"2025-07-02T11:00:01.000Z","size":100,"stargazers_count":2,"open_issues_count":5,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-07-02T11:47:19.905Z","etag":null,"topics":["aes-256","asymmetric-encryption","cryptography","decryption","encryption","encryption-library","hash-library","hashing","rsa","sha-256","symmetric-encryption"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/leventkaragol.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2024-04-19T19:06:01.000Z","updated_at":"2025-07-02T10:58:05.000Z","dependencies_parsed_at":"2024-04-19T20:25:38.336Z","dependency_job_id":"2cc50d54-ffd3-49ff-bf77-0dc413451c81","html_url":"https://github.com/leventkaragol/libcpp-crypto","commit_stats":null,"previous_names":["lk-libs/libcpp-crypto","leventkaragol/libcpp-crypto"],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/leventkaragol/libcpp-crypto","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leventkaragol%2Flibcpp-crypto","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leventkaragol%2Flibcpp-crypto/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leventkaragol%2Flibcpp-crypto/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leventkaragol%2Flibcpp-crypto/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/leventkaragol","download_url":"https://codeload.github.com/leventkaragol/libcpp-crypto/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leventkaragol%2Flibcpp-crypto/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32335296,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-26T23:26:28.701Z","status":"online","status_checked_at":"2026-04-27T02:00:06.769Z","response_time":128,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["aes-256","asymmetric-encryption","cryptography","decryption","encryption","encryption-library","hash-library","hashing","rsa","sha-256","symmetric-encryption"],"created_at":"2026-04-27T11:32:11.765Z","updated_at":"2026-04-27T11:32:12.788Z","avatar_url":"https://github.com/leventkaragol.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# libcpp-crypto\n\nEasy-to-use, symmetric (AES-256) and asymmetric (RSA) encryption and also hash (SHA-256) library for C++ (17+)\n\n[![linux](https://github.com/leventkaragol/libcpp-crypto/actions/workflows/linux.yml/badge.svg)](https://github.com/leventkaragol/libcpp-crypto/actions/workflows/linux.yml)\n[![windows](https://github.com/leventkaragol/libcpp-crypto/actions/workflows/windows.yml/badge.svg)](https://github.com/leventkaragol/libcpp-crypto/actions/workflows/windows.yml)\n\n\n\u003e [!TIP]\n\u003e Please read this document before using the library. I know, you don't have time but reading\n\u003e this document will save you time. I mean just this file, it's not long at all. Trial and error\n\u003e will cost you more time.\n\n# Table of Contents\n\n* [How to add it to my project](#how-to-add-it-to-my-project)\n* [How to use? (Symmetric Encryption with AES)](#how-to-use-symmetric-encryption-with-aes)\n* [How to use? (Hash with SHA-256)](#how-to-use-hash-with-sha-256)\n* [How to use? (Hash with HMAC SHA-256)](#how-to-use-hash-with-hmac-sha-256)\n* [How to use? (Asymmetric Encryption with RSA)](#how-to-use-asymmetric-encryption-with-rsa)\n* [How do I generate Public/Private Keys?](#how-do-i-generate-publicprivate-keys)\n* [Relationship between key size and max text length that can be encrypted](#relationship-between-key-size-and-max-text-length-that-can-be-encrypted)\n* [How to handle Exceptions (AES)?](#how-to-handle-exceptions-aes)\n* [How to handle Exceptions (RSA)?](#how-to-handle-exceptions-rsa)\n* [Semantic Versioning](#semantic-versioning)\n* [Full function list](#full-function-list)\n* [License](#license)\n* [Contact](#contact)\n\n## How to add it to my project?\n\nThis is a header only library. So actually, all you need is to add the libcpp-crypto.hpp file\nin src folder to your project and start using it with #include.\n\nBut this library is a kind of OpenSSL wrapper that uses OpenSSL under the hood. So, you also need to add OpenSSL to\nyour project before to use it.\n\nYou can find usage examples in the examples folder, also find a sample CMakeLists.txt file content below.\n\n```cmake\ncmake_minimum_required(VERSION 3.14)\n\nproject(myProject)\n\nfind_package(OpenSSL REQUIRED)\n\nadd_executable(myProject main.cpp libcpp-crypto.hpp)\n\ntarget_link_libraries(myProject PRIVATE OpenSSL::SSL OpenSSL::Crypto)\n\n```\n\n## How to use? (Symmetric Encryption with AES)\n\nTo encrypt and decrypt the given text with AES-256, all you need to do is call the **\"encryptWithAES\"** and\n**\"decryptWithAES\"** functions with a key you choose for encryption.\n\n```cpp\n#include \"libcpp-crypto.hpp\"\n\nusing namespace lklibs;\n\nint main() {\n\n    auto plainText = \"This text will be encrypted soon\";\n    auto key = \"mySecretKey\";\n    \n    auto encryptedText = CryptoService::encryptWithAES(plainText, key);\n    \n    std::cout \u003c\u003c \"Encrypted Text: \" \u003c\u003c encryptedText \u003c\u003c std::endl;\n    \n    auto decryptedText = CryptoService::decryptWithAES(encryptedText, key);\n    \n    std::cout \u003c\u003c \"Decrypted Text: \" \u003c\u003c decryptedText \u003c\u003c std::endl;\n\n    return 0;\n}\n```\n\n\u003e [!TIP]\n\u003e In fact, the key you need to use with AES-256 must be 32 characters long. However, the library adds a sufficient\n\u003e amount of \"0\" to the end of keys shorter than 32 characters, and ignores the last parts of keys longer than\n\u003e 32 characters, allowing you to use the key you want without any errors.\n\n## How to use? (Hash with SHA-256)\n\nAll you need to do is call the **\"hash\"** function to hash the given text with SHA-256.\n\n```cpp\n#include \"libcpp-crypto.hpp\"\n\nusing namespace lklibs;\n\nint main() {\n\n    auto plainText = \"This text will be hashed soon\";\n    \n    auto hashText = CryptoService::hash(plainText);\n    \n    std::cout \u003c\u003c \"Hash: \" \u003c\u003c hashText \u003c\u003c std::endl;\n\n    return 0;\n}\n```\n\n## How to use? (Hash with HMAC SHA-256)\n\nAll you need to do is call the **\"hashWithHMACSHA256\"** function to hash the given text by given secret key with HMAC SHA-256.\n\n```cpp\n#include \"libcpp-crypto.hpp\"\n\nusing namespace lklibs;\n\nint main() {\n\n    auto plainText = \"This text will be hashed soon\";\n    \n    const auto key = \"mySecretKey\";\n\n    const auto hashedText = CryptoService::hashWithHMACSHA256(plainText, key);\n    \n    std::cout \u003c\u003c \"Hash: \" \u003c\u003c hashedText \u003c\u003c std::endl;\n\n    return 0;\n}\n```\n\n## How to use? (Asymmetric Encryption with RSA)\n\nTo encrypt and decrypt the given text with RSA, all you need to do is call the **\"encryptWithRSA\"** and\n**\"decryptWithRSA\"** functions with a pair of public/private key.\n\n\u003e [!TIP]\n\u003e If you don't know how to generate public/private keys, please see the next topic\n\n```cpp\n#include \"libcpp-crypto.hpp\"\n\nusing namespace lklibs;\n\nint main() {\n\n    auto plainText = \"This text will be encrypted soon\";\n\n    auto publicKey = \"-----BEGIN PUBLIC KEY-----\\n\"\n        \"MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAwIASR0gIwizgv0j/Gzj6\\n\"\n        \"E/gS1J6gwUXeDBND7c4rDdqh/NP78N6pWNKxa5YAytTAOsoqxLDRL29pq55HyRw5\\n\"\n        \"47M35hwdmEfE8bOjnogvHRRKu7A2iGV7akkK0cP6XgHgcJVlXBX2xCT70nIX4dDk\\n\"\n        \"vGhSKwrps1o+3XVhtnVoPsCDQEESApGalhQ55OT8s0fM7OTFMfqsV3GD9J9FO4wP\\n\"\n        \"BlawHpQ5rbWGsyNYXnjXzGpmuyKl4xQBVdbx1tzh+1XlwqMhbXibMozo5U5De0oH\\n\"\n        \"A9z1Owbt3++3t+LykQDcHEtiKcvYt71by1X3J2IQOBAwWJ2jRjZQ5QJWaGXirPdR\\n\"\n        \"VwIDAQAB\\n\"\n        \"-----END PUBLIC KEY-----\";\n\n    auto privateKey = \"-----BEGIN PRIVATE KEY-----\\n\"\n        \"MIIEvAIBADANBgkqhkiG9w0BAQEFAASCBKYwggSiAgEAAoIBAQDAgBJHSAjCLOC/\\n\"\n        \"SP8bOPoT+BLUnqDBRd4ME0PtzisN2qH80/vw3qlY0rFrlgDK1MA6yirEsNEvb2mr\\n\"\n        \"nkfJHDnjszfmHB2YR8Txs6OeiC8dFEq7sDaIZXtqSQrRw/peAeBwlWVcFfbEJPvS\\n\"\n        \"chfh0OS8aFIrCumzWj7ddWG2dWg+wINAQRICkZqWFDnk5PyzR8zs5MUx+qxXcYP0\\n\"\n        \"n0U7jA8GVrAelDmttYazI1heeNfMama7IqXjFAFV1vHW3OH7VeXCoyFteJsyjOjl\\n\"\n        \"TkN7SgcD3PU7Bu3f77e34vKRANwcS2Ipy9i3vVvLVfcnYhA4EDBYnaNGNlDlAlZo\\n\"\n        \"ZeKs91FXAgMBAAECggEAKiO/HJiRxkQBvQ4TPlfWMsnjAWVqRnTve1A6VhQES8eZ\\n\"\n        \"H1oedGehxb51tVoEeWJiZFw+SYl1eX9XsAh5qXZC2+wvJ/HurpfDbq/G+RzRx3la\\n\"\n        \"NMUJ4wjoH+e2dR4EMFET20FxC1wJhX2dHL/6J2ZNtErX9fExIKB4U41vIvyHofis\\n\"\n        \"ABjyPMWsoDnFgJS2dYlXqDE9du2gXMq+vxyAKFuG5iLjtoaDGiY6hUx6eSUAclHd\\n\"\n        \"hRrmc1fftBWZUh1yr+yqH/VQGP0mVG3BIVvk7R75EST4+DxZcxxIE6NEOxFkS1Jc\\n\"\n        \"jeVR6AsLz3+rkP1/K4SKD3HzQ+fNWYWulAAFsnChSQKBgQD0OgTGhpxP0X9k6NBA\\n\"\n        \"urdZLGAePZaU+TUXwLL3+t6Upz7fJoh3bogkgbAUfjXDmrexXfIliMnm1KX9d4ZT\\n\"\n        \"TB3VpDsjiYK82sLMs0adb+9jJqignX/nxoJdsWpamP2DJwAr3621nVNYLutzp4rn\\n\"\n        \"dXKJYu1KtJdsQrsb/9mT87wD7wKBgQDJx7OxR992Ly8HB/GG9e+RCJVTHHwoYkaa\\n\"\n        \"HkGFL/sxfANcWbqzJdd6qnNwUIK32GaY8F5pxo12zcpaVGLPk6J78HxQrnx6gQH/\\n\"\n        \"KT3Bc9wT4M7nHIkt/Y879Z7BaiQ+2TafSdNWmobIB2H5X9zd0JoSs9gScbbaZ0kA\\n\"\n        \"eW+KEtkBGQKBgDCEEgzKEuU8Td1i7nPdY6zgRtvbCj3f368vRZ5DhNHtA21a/0MS\\n\"\n        \"fxMZfDwl8lJAOvuOGRthuBIV7j+S7elANrEJJgJiP8l6f7Ygawe9g8WjmV4Gy7Dk\\n\"\n        \"W2N3ahRDTiEurzcIAT8R2MusznM0NkDSsQUf1NnBVE9aVkcypStiANibAoGAXWaT\\n\"\n        \"Rvx987bjjd2fb1loCzpt5IrK7eaPx8c5jO0o2T8OTzE5urNJiv5bcSHTYEZLN4AM\\n\"\n        \"M+o0kUmw4R8unec4zyYCZVZfSFVvFy1/6Iw40vq8yz3qQd+c7aREWENJg84H+rOx\\n\"\n        \"n+Tnfq/sKgK1ufdVWlLlMaRxf6dPo2iSuNcAnAECgYActoBiupT5Kc2ZK/lCylJc\\n\"\n        \"3UpJwB4dhuXypOjqvDQ6uyUSVbyD3TvneyB+8hYnPMXXTDtW6ne5pCMcxibtkK2T\\n\"\n        \"Tmy283w8+RuGbK4+7ifgV97PUGrYFAmpqWhaympDCTp5WTwgKsmCDxX0B3bq77xW\\n\"\n        \"oao1npvUquuvWx6cUaQN7Q==\\n\"\n        \"-----END PRIVATE KEY-----\";\n\n    auto encryptedText = CryptoService::encryptWithRSA(plainText, publicKey);\n    \n    std::cout \u003c\u003c \"Encrypted Text: \" \u003c\u003c encryptedText \u003c\u003c std::endl;\n    \n    auto decryptedText = CryptoService::decryptWithRSA(encryptedText, privateKey);\n    \n    std::cout \u003c\u003c \"Decrypted Text: \" \u003c\u003c decryptedText \u003c\u003c std::endl;\n\n    return 0;\n}\n```\n\n## How do I generate Public/Private Keys?\n\nYou have two different options to create a Public and Private key pair. The first option, and the easier one, is to use the\ngenerateRSAKeyPair function in the library, passing the desired key length as a parameter. Below is a sample code for this usage.\n\n```cpp\nauto keyPair = CryptoService::generateRSAKeyPair(2048);\n\nstd::cout \u003c\u003c \"2048 bit Public RSA Key:\" \u003c\u003c std::endl \u003c\u003c keyPair.publicKey \u003c\u003c std::endl;\nstd::cout \u003c\u003c \"2048 bit Private RSA Key:\" \u003c\u003c std::endl \u003c\u003c keyPair.privateKey \u003c\u003c std::endl;\n```\n\n\u003e [!TIP]\n\u003e If you are not sure of the key length you will need, please see the next topic\n\n\nOptionally, you can also pass a passphrase as follows to the generateRSAKeyPair function during key creation. In this case,\nyou will need to pass this passphrase to the decryptWithRSA function to decrypt the text.\n\n```cpp\nauto keyPair = CryptoService::generateRSAKeyPair(2048, \"myPassphrase\");\n\nstd::cout \u003c\u003c \"2048 bit Public RSA Key:\" \u003c\u003c std::endl \u003c\u003c keyPair.publicKey \u003c\u003c std::endl;\nstd::cout \u003c\u003c \"2048 bit Private RSA Key:\" \u003c\u003c std::endl \u003c\u003c keyPair.privateKey \u003c\u003c std::endl;\n```\n\nAs a second option, if OpenSSL is installed on your system, you can use the necessary OpenSSL commands from the\ncommand line to create a Public and Private key pair. As the first step in this option, when you run it by typing\nthe following line on the command line, a text file named \"private_key.pem\" will be created containing the private\nkey information.\n\n```bash\nopenssl genpkey -algorithm RSA -out private_key.pem -pkeyopt rsa_keygen_bits:2048\n```\n\nThen, when you run it by typing the following line on the command line, a text file named \"public_key.pem\" will be created\ncontaining the public key information for this private key.\n\n```bash\nopenssl rsa -pubout -in private_key.pem -out public_key.pem\n```\n\n## Relationship between key size and max text length that can be encrypted\n\nThe size of the Key used during asymmetric encryption with RSA is not only related to the security of the encryption\nprocess, but also determines what the longest text that can be encrypted with this key can be. Basically, the longest text\nthat can be encrypted with a 2\u003csup\u003ex\u003c/sup\u003e bit key can be calculated as 2\u003csup\u003ex-3\u003c/sup\u003e-11 for ASCII character set. Other\ncharacter sets can take up twice. I am sharing the table below for a quick reference.\n\n| Key Bits | Maximum Text Length |\n|----------|---------------------|\n| 2048     | 245                 |\n| 4096     | 501                 |\n| 8192     | 1013                |\n| 16384    | 2037                |\n| 32768    | 4085                |\n| 65536    | 8181                |\n\n\u003e [!IMPORTANT]\n\u003e Do not think that you can easily create a longer key to encrypt a longer text with RSA. Each row in the table consumes\n\u003e 4 times more CPU power during encryption/decryption process than the row above. Additionally, generating a 65K bit key takes\n\u003e time and requires a lot of patience, even for a high-end computer.\n\n\u003e [!CAUTION]\n\u003e 1024-bit RSA keys are not secure in the face of today's increasing computing power and advanced factorization algorithms.\n\u003e Please use keys of at least 2048 bits.\n\n## How to handle Exceptions (AES)?\n\nThere are two main Exceptions you may encounter when using the library for AES encryption. The first one is the **\"InvalidKeyException\"**\nyou will receive if the encryption key of the text you want to decrypt is incorrect, and the second one is the\n**\"CorruptedTextException\"** you will receive if the text you want to decrypt is invalid.\n\nThe code below shows you how to catch the Exception thrown in case of an invalid encryption key.\n\n```cpp\n#include \"libcpp-crypto.hpp\"\n\nusing namespace lklibs;\n\nint main() {\n\n    auto plainText = \"This text will be encrypted soon\";\n    auto key = \"mySecretKey\";\n    auto invalidKey = \"invalidKey\";\n    \n    auto encryptedText = CryptoService::encryptWithAES(plainText, key);\n    \n    try\n    {\n        auto decryptedText = CryptoService::decryptWithAES(encryptedText, invalidKey);\n    }\n    catch (const InvalidKeyException\u0026 e)\n    {\n        std::cerr \u003c\u003c e.what() \u003c\u003c std::endl; // Encryption key does not match the original encryption key \n    }\n    \n    return 0;\n}\n```\n\nThe code below also shows you how to catch the Exception thrown when you try to decrypt and invalid text.\n\n```cpp\n#include \"libcpp-crypto.hpp\"\n\nusing namespace lklibs;\n\nint main() {\n\n    auto encryptedText = \"ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890\";\n    auto key = \"mySecretKey\";\n    \n    try\n    {\n        auto decryptedText = CryptoService::decryptWithAES(encryptedText, key);\n    }\n    catch (const CorruptedTextException\u0026 e)\n    {\n        std::cerr \u003c\u003c e.what() \u003c\u003c std::endl; // Encrypted text is corrupted \n    }\n    \n    return 0;\n}\n```\n\n## How to handle Exceptions (RSA)?\n\nThe exception part for the RSA side is a little different. If the public and private keys used are not correct,\n**\"InvalidPublicKeyException\"** and **\"InvalidPrivateKeyException\"** are thrown. However, the structure of the keys\nused must be corrupt to throw these exceptions. If you use incompatible but structurally valid keys, no exception\nwill be thrown. However, the text obtained after decryption will consist of just meaningless characters.\n\n```cpp\n#include \"libcpp-crypto.hpp\"\n\nusing namespace lklibs;\n\nint main() {\n\n    auto plainText = \"This text will be encrypted soon\";\n\n    auto publicKey = \"-----BEGIN PUBLIC KEY-----\\n\"\n        \"MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAwIASR0gIwizgv0j/Gzj6\\n\"\n        \"E/gS1J6gwUXeDBND7c4rDdqh/NP78N6pWNKxa5YAytTAOsoqxLDRL29pq55HyRw5\\n\"\n        \"47M35hwdmEfE8bOjnogvHRRKu7A2iGV7akkK0cP6XgHgcJVlXBX2xCT70nIX4dDk\\n\"\n        \"vGhSKwrps1o+3XVhtnVoPsCDQEESApGalhQ55OT8s0fM7OTFMfqsV3GD9J9FO4wP\\n\"\n        \"BlawHpQ5rbWGsyNYXnjXzGpmuyKl4xQBVdbx1tzh+1XlwqMhbXibMozo5U5De0oH\\n\"\n        \"A9z1Owbt3++3t+LykQDcHEtiKcvYt71by1X3J2IQOBAwWJ2jRjZQ5QJWaGXirPdR\\n\"\n        \"VwIDAQAB\\n\"\n        \"-----END PUBLIC KEY-----\";\n\n    auto privateKey = \"-----BEGIN PRIVATE KEY-----\\n\"\n        \"SOME_INVALID_KEY/\\n\"\n        \"-----END PRIVATE KEY-----\";\n\n    auto encryptedText = CryptoService::encryptWithRSA(plainText, publicKey);\n\n    try\n    {\n        auto decryptedText = CryptoService::decryptWithRSA(encryptedText, privateKey);\n    }\n    catch (const InvalidPrivateKeyException\u0026 e)\n    {\n        std::cerr \u003c\u003c e.what() \u003c\u003c std::endl; // RSA private key is invalid\n    }\n    \n    return 0;\n}\n```\n\n## Semantic Versioning\n\nVersioning of the library is done using conventional semantic versioning. Accordingly,\nin the versioning made as **MAJOR.MINOR.PATCH**;\n\n**PATCH:** Includes possible Bug\u0026Fixes and improvements. You definitely want to get this.\n\n**MINOR:** Additional functionality added via backwards compatibility. You probably want to\nget this, it doesn't hurt.\n\n**MAJOR:** Additional functionality that breaks backwards compatibility. You'll need to know\nwhat's changed before you get it, and you'll probably have to make changes to your own code.\nIf I publish something like this, I will definitely add the changes required for migration\nsection to the documentation.\n\n## Full function list\n\nYou can find the complete list of functions in the library below.\n\n\u003e [!TIP]\n\u003e All functions and parameters descriptions are also available within the code as comment for IDEs.\n\n```cpp\nstd::string encryptWithAES(const std::string\u0026 plaintext, const std::string\u0026 key);\n\nstd::string decryptWithAES(const std::string\u0026 ciphertext, const std::string\u0026 key);\n\nRSAKeyPair generateRSAKeyPair(int keyLength, const std::string\u0026 passphrase = \"\");\n\nstd::string encryptWithRSA(const std::string\u0026 plaintext, const std::string\u0026 publicKeyStr);\n\nstd::string decryptWithRSA(const std::string\u0026 ciphertext, const std::string\u0026 privateKeyStr);\n\nstd::string hash(const std::string\u0026 text);\n```\n\n## License\n\nMIT License\n\nCopyright (c) 2024 Levent KARAGÖL\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n\n## Contact\n\nIf you have problems regarding the library, please open an\n[issue on GitHub](https://github.com/leventkaragol/libcpp-crypto/issues/new).\nPlease describe your request, issue, or question in as much detail as possible\nand also include the version of your compiler and operating system, as well as\nthe version of the library you are using. Before opening a new issue, please\nconfirm that the topic is not already exists in closed issues.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fleventkaragol%2Flibcpp-crypto","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fleventkaragol%2Flibcpp-crypto","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fleventkaragol%2Flibcpp-crypto/lists"}